This class frovides a framework for real time audio playback.
It renders a Part using the provided instrument(s).
If there are more than one instrument it is assumed they are
simply multiple instances of the one instrument. These are used
to play notes that overlap in the score or as a result of effects
such as delays or reverb.
There is an assumption that all instruments have the same sample rate
number of channels.
Returns the instrument associated with this RTLine
Instrument the instrument associated with this RTLine
public int getNumLines()
Return the number of lines (note polyphony for this RTLine
public void setTempo(double tempo)
sets the tempo of this RTLine
public void setBufferSize(int buf)
Specify the buffer size for each instrument.
Called by RTMixer.
public int getSampleRate()
Return the current samplerate, based on the sample rate of the instruments.
All instrument sample rates in real time audio must be the same.
public int getChannels()
Return the current number of channels, based on the channels of the instruments.
All instruments in real time audio must have the same number of channels.
public void externalAction(java.lang.Object obj,
External action is called by RTMixer whenever an external event is sent
to trigger a real time audio event. The event will commonly be
triggered by a GUI widget such as a button or slider.
obj - and undetermined Object which will need to be cast locally to
whatever type is expected.
actionNumber - is an serial index value for the source of the
public void controlChange(float buffer,
controlChange is called by RTLine's instrument everytime it completes
filling its current buffer. The regularity at which controlChange is
called is what determines the control rate. The control rate is used
therefore to set the buffer sizes of the instrument sample buffers.
buffer - a buffer of samples passed from an instrument
returned - the number of samples in the buffer
finished - this boolean indicates whether the instrument has
finished processing its current note.
public void instNote(Instrument inst,
This method is called from Instrument and in return calls that
instrument's renderNote method. When this method returns, the instruments
iterateChain method is called and the note is processed. This method
is responsible for either fetching a "playable" note from the getNextNote()
method or else for inserting a rest of an appropriate amount of time.