com.sun.media.sound
Class ModelInstrument

java.lang.Object
  extended by javax.sound.midi.SoundbankResource
      extended by javax.sound.midi.Instrument
          extended by com.sun.media.sound.ModelInstrument
Direct Known Subclasses:
DLSInstrument, ModelMappedInstrument, SF2Instrument, SimpleInstrument

public abstract class ModelInstrument
extends javax.sound.midi.Instrument

The model instrument class.

The main methods to override are:
getPerformer, getDirector, getChannelMixer.

Performers are used to define what voices which will playback when using the instrument.
ChannelMixer is used to add channel-wide processing on voices output or to define non-voice oriented instruments.
Director is used to change how the synthesizer chooses what performers to play on midi events.

Author:
Karl Helgason

Constructor Summary
protected ModelInstrument(javax.sound.midi.Soundbank soundbank, javax.sound.midi.Patch patch, java.lang.String name, java.lang.Class<?> dataClass)
           
 
Method Summary
 ModelChannelMixer getChannelMixer(javax.sound.midi.MidiChannel channel, javax.sound.sampled.AudioFormat format)
           
 boolean[] getChannels()
           
 ModelDirector getDirector(ModelPerformer[] performers, javax.sound.midi.MidiChannel channel, ModelDirectedPlayer player)
           
 java.lang.String[] getKeys()
           
 javax.sound.midi.Patch getPatchAlias()
           
 ModelPerformer[] getPerformers()
           
 
Methods inherited from class javax.sound.midi.Instrument
getPatch
 
Methods inherited from class javax.sound.midi.SoundbankResource
getData, getDataClass, getName, getSoundbank
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelInstrument

protected ModelInstrument(javax.sound.midi.Soundbank soundbank,
                          javax.sound.midi.Patch patch,
                          java.lang.String name,
                          java.lang.Class<?> dataClass)
Method Detail

getDirector

public ModelDirector getDirector(ModelPerformer[] performers,
                                 javax.sound.midi.MidiChannel channel,
                                 ModelDirectedPlayer player)

getPerformers

public ModelPerformer[] getPerformers()

getChannelMixer

public ModelChannelMixer getChannelMixer(javax.sound.midi.MidiChannel channel,
                                         javax.sound.sampled.AudioFormat format)

getPatchAlias

public javax.sound.midi.Patch getPatchAlias()

getKeys

public java.lang.String[] getKeys()

getChannels

public boolean[] getChannels()