Methods Summary |
---|
public javax.sound.midi.Instrument[] | getAvailableInstruments()Obtains a list of instruments that come with the synthesizer. These
instruments might be built into the synthesizer, or they might be
part of a default soundbank provided with the synthesizer, etc.
Note that you don't use this method to find out which instruments are
currently loaded onto the synthesizer; for that purpose, you use
getLoadedInstruments() .
Nor does the method indicate all the instruments that can be loaded onto
the synthesizer; it only indicates the subset that come with the synthesizer.
To learn whether another instrument can be loaded, you can invoke
isSoundbankSupported() , and if the instrument's
Soundbank is supported, you can try loading the instrument.
|
public javax.sound.midi.MidiChannel[] | getChannels()Obtains the set of MIDI channels controlled by this synthesizer. Each
non-null element in the returned array is a MidiChannel that
receives the MIDI messages sent on that channel number.
The MIDI 1.0 specification provides for 16 channels, so this
method returns an array of at least 16 elements. However, if this synthesizer
doesn't make use of all 16 channels, some of the elements of the array
might be null , so you should check each element
before using it.
|
public javax.sound.midi.Soundbank | getDefaultSoundbank()Obtains the default soundbank for the synthesizer, if one exists.
(Some synthesizers provide a default or built-in soundbank.)
If a synthesizer doesn't have a default soundbank, instruments must
be loaded explicitly from an external soundbank.
|
public long | getLatency()Obtains the processing latency incurred by this synthesizer, expressed in
microseconds. This latency measures the worst-case delay between the
time a MIDI message is delivered to the synthesizer and the time that the
synthesizer actually produces the corresponding result.
Although the latency is expressed in microseconds, a synthesizer's actual measured
delay may vary over a wider range than this resolution suggests. For example,
a synthesizer might have a worst-case delay of a few milliseconds or more.
|
public javax.sound.midi.Instrument[] | getLoadedInstruments()Obtains a list of the instruments that are currently loaded onto this
Synthesizer .
|
public int | getMaxPolyphony()Obtains the maximum number of notes that this synthesizer can sound simultaneously.
|
public javax.sound.midi.VoiceStatus[] | getVoiceStatus()Obtains the current status of the voices produced by this synthesizer.
If this class of Synthesizer does not provide voice
information, the returned array will always be of length 0. Otherwise,
its length is always equal to the total number of voices, as returned by
getMaxPolyphony() . (See the VoiceStatus class
description for an explanation of synthesizer voices.)
|
public boolean | isSoundbankSupported(javax.sound.midi.Soundbank soundbank)Informs the caller whether this synthesizer is capable of loading
instruments from the specified soundbank.
If the soundbank is unsupported, any attempts to load instruments from
it will result in an IllegalArgumentException .
|
public boolean | loadAllInstruments(javax.sound.midi.Soundbank soundbank)Loads onto the Synthesizer all instruments contained
in the specified Soundbank .
|
public boolean | loadInstrument(javax.sound.midi.Instrument instrument)Makes a particular instrument available for synthesis. This instrument
is loaded into the patch location specified by its Patch
object, so that if a program-change message is
received (or has been received) that causes that patch to be selected,
subsequent notes will be played using the sound of
instrument . If the specified instrument is already loaded,
this method does nothing and returns true .
The instrument must be part of a soundbank
that this Synthesizer supports. (To make sure, you can use
the getSoundbank method of Instrument and the
isSoundbankSupported method of Synthesizer .)
|
public boolean | loadInstruments(javax.sound.midi.Soundbank soundbank, javax.sound.midi.Patch[] patchList)Loads the instruments referenced by the specified patches, from the
specified Soundbank . Each of the Patch objects
indicates a bank and program number; the Instrument that
has the matching Patch is loaded into that bank and program
location.
|
public boolean | remapInstrument(javax.sound.midi.Instrument from, javax.sound.midi.Instrument to)Remaps an instrument. Instrument to takes the
place of instrument from .
For example, if from was located at bank number 2,
program number 11, remapping causes
that bank and program location to be occupied instead by
to . Instrument from is unloaded.
|
public void | unloadAllInstruments(javax.sound.midi.Soundbank soundbank)Unloads all instruments contained in the specified Soundbank .
|
public void | unloadInstrument(javax.sound.midi.Instrument instrument)Unloads a particular instrument.
|
public void | unloadInstruments(javax.sound.midi.Soundbank soundbank, javax.sound.midi.Patch[] patchList)Unloads the instruments referenced by the specified patches, from the MIDI sound bank specified.
|