javax.sound.midi
Interface Soundbank


public interface Soundbank

A Soundbank contains a set of Instruments that can be loaded into a Synthesizer. Note that a Java Sound Soundbank is different from a MIDI bank. MIDI permits up to 16383 banks, each containing up to 128 instruments (also sometimes called programs, patches, or timbres). However, a Soundbank can contain 16383 times 128 instruments, because the instruments within a Soundbank are indexed by both a MIDI program number and a MIDI bank number (via a Patch object). Thus, a Soundbank can be thought of as a collection of MIDI banks.

Soundbank includes methods that return String objects containing the sound bank's name, manufacturer, version number, and description. The precise content and format of these strings is left to the implementor.

Different synthesizers use a variety of synthesis techniques. A common one is wavetable synthesis, in which a segment of recorded sound is played back, often with looping and pitch change. The Downloadable Sound (DLS) format uses segments of recorded sound, as does the Headspace Engine. Soundbanks and Instruments that are based on wavetable synthesis (or other uses of stored sound recordings) should typically implement the getResources() method to provide access to these recorded segments. This is optional, however; the method can return an zero-length array if the synthesis technique doesn't use sampled sound (FM synthesis and physical modeling are examples of such techniques), or if it does but the implementor chooses not to make the samples accessible.

See Also:
Synthesizer.getDefaultSoundbank() sample code for javax.sound.midi.Synthesizer.getDefaultSoundbank() definition code for javax.sound.midi.Synthesizer.getDefaultSoundbank() , Synthesizer.isSoundbankSupported(javax.sound.midi.Soundbank) sample code for javax.sound.midi.Synthesizer.isSoundbankSupported(javax.sound.midi.Soundbank) definition code for javax.sound.midi.Synthesizer.isSoundbankSupported(javax.sound.midi.Soundbank) , Synthesizer.loadInstruments(Soundbank, Patch[]) sample code for javax.sound.midi.Synthesizer.loadInstruments(javax.sound.midi.Soundbank, javax.sound.midi.Patch[]) definition code for javax.sound.midi.Synthesizer.loadInstruments(javax.sound.midi.Soundbank, javax.sound.midi.Patch[]) , Patch sample code for javax.sound.midi.Patch definition code for javax.sound.midi.Patch , Instrument sample code for javax.sound.midi.Instrument definition code for javax.sound.midi.Instrument , SoundbankResource sample code for javax.sound.midi.SoundbankResource definition code for javax.sound.midi.SoundbankResource

Method Summary
 String sample code for java.lang.String definition code for java.lang.String getDescription sample code for javax.sound.midi.Soundbank.getDescription() definition code for javax.sound.midi.Soundbank.getDescription() ()
          Obtains a textual description of the sound bank, suitable for display.
 Instrument sample code for javax.sound.midi.Instrument definition code for javax.sound.midi.Instrument getInstrument sample code for javax.sound.midi.Soundbank.getInstrument(javax.sound.midi.Patch) definition code for javax.sound.midi.Soundbank.getInstrument(javax.sound.midi.Patch) (Patch sample code for javax.sound.midi.Patch definition code for javax.sound.midi.Patch  patch)
          Obtains an Instrument from the given Patch.
 Instrument sample code for javax.sound.midi.Instrument definition code for javax.sound.midi.Instrument [] getInstruments sample code for javax.sound.midi.Soundbank.getInstruments() definition code for javax.sound.midi.Soundbank.getInstruments() ()
          Obtains a list of instruments contained in this sound bank.
 String sample code for java.lang.String definition code for java.lang.String getName sample code for javax.sound.midi.Soundbank.getName() definition code for javax.sound.midi.Soundbank.getName() ()
          Obtains the name of the sound bank.
 SoundbankResource sample code for javax.sound.midi.SoundbankResource definition code for javax.sound.midi.SoundbankResource [] getResources sample code for javax.sound.midi.Soundbank.getResources() definition code for javax.sound.midi.Soundbank.getResources() ()
          Extracts a list of non-Instrument resources contained in the sound bank.
 String sample code for java.lang.String definition code for java.lang.String getVendor sample code for javax.sound.midi.Soundbank.getVendor() definition code for javax.sound.midi.Soundbank.getVendor() ()
          Obtains a string naming the company that provides the sound bank
 String sample code for java.lang.String definition code for java.lang.String getVersion sample code for javax.sound.midi.Soundbank.getVersion() definition code for javax.sound.midi.Soundbank.getVersion() ()
          Obtains the version string for the sound bank.
 

Method Detail

getName sample code for javax.sound.midi.Soundbank.getName() definition code for javax.sound.midi.Soundbank.getName()

String sample code for java.lang.String definition code for java.lang.String  getName()
Obtains the name of the sound bank.

Returns:
a String naming the sound bank

getVersion sample code for javax.sound.midi.Soundbank.getVersion() definition code for javax.sound.midi.Soundbank.getVersion()

String sample code for java.lang.String definition code for java.lang.String  getVersion()
Obtains the version string for the sound bank.

Returns:
a String that indicates the sound bank's version

getVendor sample code for javax.sound.midi.Soundbank.getVendor() definition code for javax.sound.midi.Soundbank.getVendor()

String sample code for java.lang.String definition code for java.lang.String  getVendor()
Obtains a string naming the company that provides the sound bank

Returns:
the vendor string

getDescription sample code for javax.sound.midi.Soundbank.getDescription() definition code for javax.sound.midi.Soundbank.getDescription()

String sample code for java.lang.String definition code for java.lang.String  getDescription()
Obtains a textual description of the sound bank, suitable for display.

Returns:
a String that describes the sound bank

getResources sample code for javax.sound.midi.Soundbank.getResources() definition code for javax.sound.midi.Soundbank.getResources()

SoundbankResource sample code for javax.sound.midi.SoundbankResource definition code for javax.sound.midi.SoundbankResource [] getResources()
Extracts a list of non-Instrument resources contained in the sound bank.

Returns:
an array of resources, exclusing instruments. If the sound bank contains no resources (other than instruments), returns an array of length 0.

getInstruments sample code for javax.sound.midi.Soundbank.getInstruments() definition code for javax.sound.midi.Soundbank.getInstruments()

Instrument sample code for javax.sound.midi.Instrument definition code for javax.sound.midi.Instrument [] getInstruments()
Obtains a list of instruments contained in this sound bank.

Returns:
an array of the Instruments in this SoundBank If the sound bank contains no instruments, returns an array of length 0.
See Also:
Synthesizer.getLoadedInstruments() sample code for javax.sound.midi.Synthesizer.getLoadedInstruments() definition code for javax.sound.midi.Synthesizer.getLoadedInstruments() , getInstrument(Patch) sample code for javax.sound.midi.Soundbank.getInstrument(javax.sound.midi.Patch) definition code for javax.sound.midi.Soundbank.getInstrument(javax.sound.midi.Patch)

getInstrument sample code for javax.sound.midi.Soundbank.getInstrument(javax.sound.midi.Patch) definition code for javax.sound.midi.Soundbank.getInstrument(javax.sound.midi.Patch)

Instrument sample code for javax.sound.midi.Instrument definition code for javax.sound.midi.Instrument  getInstrument(Patch sample code for javax.sound.midi.Patch definition code for javax.sound.midi.Patch  patch)
Obtains an Instrument from the given Patch.

Parameters:
patch - a Patch object specifying the bank index and program change number
Returns:
the requested instrument, or null if the sound bank doesn't contain that instrument
See Also:
getInstruments() sample code for javax.sound.midi.Soundbank.getInstruments() definition code for javax.sound.midi.Soundbank.getInstruments() , Synthesizer.loadInstruments(Soundbank, Patch[]) sample code for javax.sound.midi.Synthesizer.loadInstruments(javax.sound.midi.Soundbank, javax.sound.midi.Patch[]) definition code for javax.sound.midi.Synthesizer.loadInstruments(javax.sound.midi.Soundbank, javax.sound.midi.Patch[])