org.tritonus.saol.engine
Class AbstractInstrument

java.lang.Object
  extended by org.tritonus.saol.engine.AbstractInstrument
All Implemented Interfaces:
Output

public abstract class AbstractInstrument
extends java.lang.Object
implements Output


Method Summary
 void clear()
          Initiate the output port of the instrument.
 void doAPass(RTSystem rtSystem)
           
 void doIPass(RTSystem rtSystem)
           
 void doKPass(RTSystem rtSystem)
           
 int getEndTime()
           
 int getStartTime()
           
 int getWidth()
          Gives the width of the output port.
 void output(float fSample)
          Add the sample value of one instrument.
 void output(float[] afSamples)
          Add sample values of one instrument.
 void setOutput(Output output)
           
 void setStartAndEndTime(int nStartTime, int nEndTime)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setOutput

public void setOutput(Output output)

setStartAndEndTime

public void setStartAndEndTime(int nStartTime,
                               int nEndTime)

getStartTime

public int getStartTime()

getEndTime

public int getEndTime()

doIPass

public void doIPass(RTSystem rtSystem)

doKPass

public void doKPass(RTSystem rtSystem)

doAPass

public void doAPass(RTSystem rtSystem)

getWidth

public int getWidth()
Gives the width of the output port.

Specified by:
getWidth in interface Output

clear

public void clear()
Initiate the output port of the instrument. Sets the values of all samples to 0.0. This method must be called in an a-cycle before this instrument's a-cycle code is executed.

Specified by:
clear in interface Output

output

public void output(float fSample)
Add the sample value of one instrument. This method can be called by instrument's a-cycle code to output the sample value the instrument has calculated for this a-cycle.

Specified by:
output in interface Output

output

public void output(float[] afSamples)
Add sample values of one instrument. This method can be called by instrument's a-cycle code to output the sample value the instrument has calculated for this a-cycle. The current hacky version allows only for mono samples.

Specified by:
output in interface Output