javax.sound.midi
Interface Synthesizer

All Superinterfaces:
MidiDevice

public interface Synthesizer
extends MidiDevice

Interface for MIDI audio synthesizer devices.

Since:
1.3

Nested Class Summary
 
Nested classes/interfaces inherited from interface javax.sound.midi.MidiDevice
MidiDevice.Info
 
Method Summary
 Instrument[] getAvailableInstruments()
          Get an array containing all instruments in this synthesizer.
 MidiChannel[] getChannels()
          Get the set of MIDI channels controlled by this synth.
 Soundbank getDefaultSoundbank()
          Get the default Soundbank for this synth.
 long getLatency()
          The processing latency for this synth in microseconds.
 Instrument[] getLoadedInstruments()
          Get an array containing all instruments loaded in this synthesizer.
 int getMaxPolyphony()
          Get the maximum number of notes that the synth can play at once.
 VoiceStatus[] getVoiceStatus()
          Get the current status for the voices produced by this synth.
 boolean isSoundbankSupported(Soundbank soundbank)
          Returns true is this synth is capable of loading soundbank.
 boolean loadAllInstruments(Soundbank soundbank)
          Load all soundbank instruments into this synthesizer.
 boolean loadInstrument(Instrument instrument)
          Load an instrument into this synth.
 boolean loadInstruments(Soundbank soundbank, Patch[] patchList)
          Load a subset of soundbank instruments into this synthesizer.
 boolean remapInstrument(Instrument from, Instrument to)
          Move an intrument from one place to another.
 void unloadAllInstruments(Soundbank soundbank)
          Unload all soundbank instruments from this synthesizer.
 void unloadInstrument(Instrument instrument)
          Unload an instrument from this synth.
 void unloadInstruments(Soundbank soundbank, Patch[] patchList)
          Unload a subset of soundbank instruments from this synthesizer.
 
Methods inherited from interface javax.sound.midi.MidiDevice
close, getDeviceInfo, getMaxReceivers, getMaxTransmitters, getMicrosecondPosition, getReceiver, getTransmitter, isOpen, open
 

Method Detail

getMaxPolyphony

int getMaxPolyphony()
Get the maximum number of notes that the synth can play at once.

Returns:
the maximum number of notes that the synth can play at once

getLatency

long getLatency()
The processing latency for this synth in microseconds.

Returns:
the processing latency for this synth in microseconds

getChannels

MidiChannel[] getChannels()
Get the set of MIDI channels controlled by this synth.

Returns:
an array of MIDI channels controlled by this synth

getVoiceStatus

VoiceStatus[] getVoiceStatus()
Get the current status for the voices produced by this synth.

Returns:
an array of VoiceStatus objects, getMaxPolyphony() in length

isSoundbankSupported

boolean isSoundbankSupported(Soundbank soundbank)
Returns true is this synth is capable of loading soundbank.

Parameters:
soundbank - the Soundbank to examine
Returns:
true if soundbank can be loaded, false otherwise

loadInstrument

boolean loadInstrument(Instrument instrument)
Load an instrument into this synth. The instrument must be part of a supported soundbank.

Parameters:
instrument - the Instrument to load
Returns:
true if the instrument was loaded and false otherwise
Throws:
IllegalArgumentException - if this synth doesn't support instrument

unloadInstrument

void unloadInstrument(Instrument instrument)
Unload an instrument from this synth.

Parameters:
instrument - the Instrument to unload
Throws:
IllegalArgumentException - if this synth doesn't support instrument

remapInstrument

boolean remapInstrument(Instrument from,
                        Instrument to)
Move an intrument from one place to another. The instrument at the target location is unloaded.

Parameters:
from - the instrument source
to - the instrument target
Returns:
if from was remapped
Throws:
IllegalArgumentException

getDefaultSoundbank

Soundbank getDefaultSoundbank()
Get the default Soundbank for this synth. Return null if there is no default.

Returns:
the default Soundbank for this synth, possibly null.

getAvailableInstruments

Instrument[] getAvailableInstruments()
Get an array containing all instruments in this synthesizer.

Returns:
an array containing all instruments in this synthesizer

getLoadedInstruments

Instrument[] getLoadedInstruments()
Get an array containing all instruments loaded in this synthesizer.

Returns:
an array containing all instruments loaded in this synthesizer

loadAllInstruments

boolean loadAllInstruments(Soundbank soundbank)
Load all soundbank instruments into this synthesizer.

Parameters:
soundbank - the Soundbank from which to load instruments
Returns:
true if all instruments were loaded, false othewise
Throws:
IllegalArgumentException - if the soundbank isn't supported by this

unloadAllInstruments

void unloadAllInstruments(Soundbank soundbank)
Unload all soundbank instruments from this synthesizer.

Parameters:
soundbank - the Soundbank containing the instruments to unload
Throws:
IllegalArgumentException - if the soundbank isn't supported by this

loadInstruments

boolean loadInstruments(Soundbank soundbank,
                        Patch[] patchList)
Load a subset of soundbank instruments into this synthesizer. The subset is defined by an array of Patch objects.

Parameters:
soundbank - the Soundbank from which to load instruments
patchList - the array of patches identifying instruments to load
Returns:
true if instruments were loaded, false otherwise
Throws:
IllegalArgumentException - if the soundbank isn't supported by this

unloadInstruments

void unloadInstruments(Soundbank soundbank,
                       Patch[] patchList)
Unload a subset of soundbank instruments from this synthesizer.

Parameters:
soundbank - the Soundbank containing the instruments to unload
patchList - the array of patches identifying instruments to unload
Throws:
IllegalArgumentException - if the soundbank isn't supported by this