javax.sound.midi

Interface Synthesizer

public interface Synthesizer extends MidiDevice

Interface for MIDI audio synthesizer devices.

Since: 1.3

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.
SoundbankgetDefaultSoundbank()
Get the default Soundbank for this synth.
longgetLatency()
The processing latency for this synth in microseconds.
Instrument[]getLoadedInstruments()
Get an array containing all instruments loaded in this synthesizer.
intgetMaxPolyphony()
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.
booleanisSoundbankSupported(Soundbank soundbank)
Returns true is this synth is capable of loading soundbank.
booleanloadAllInstruments(Soundbank soundbank)
Load all soundbank instruments into this synthesizer.
booleanloadInstrument(Instrument instrument)
Load an instrument into this synth.
booleanloadInstruments(Soundbank soundbank, Patch[] patchList)
Load a subset of soundbank instruments into this synthesizer.
booleanremapInstrument(Instrument from, Instrument to)
Move an intrument from one place to another.
voidunloadAllInstruments(Soundbank soundbank)
Unload all soundbank instruments from this synthesizer.
voidunloadInstrument(Instrument instrument)
Unload an instrument from this synth.
voidunloadInstruments(Soundbank soundbank, Patch[] patchList)
Unload a subset of soundbank instruments from this synthesizer.

Method Detail

getAvailableInstruments

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

Returns: an array containing all instruments in this synthesizer

getChannels

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

Returns: an array of MIDI channels controlled by this synth

getDefaultSoundbank

public 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.

getLatency

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

Returns: the processing latency for this synth in microseconds

getLoadedInstruments

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

Returns: an array containing all instruments loaded in this synthesizer

getMaxPolyphony

public 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

getVoiceStatus

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

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

isSoundbankSupported

public 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

loadAllInstruments

public 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

loadInstrument

public 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

loadInstruments

public 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

remapInstrument

public 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

unloadAllInstruments

public 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

unloadInstrument

public 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

unloadInstruments

public 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