|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softsynth.jmsl.Interpreter com.softsynth.jmsl.SustainingInterpreter
public class SustainingInterpreter
SustainingInterpreter
An interpreter that interprets shape data, sustains that for some duration,
then shuts it down.
Here is an example of defining interpret(), which turns ON an event, and interpretOff()
which turns it OFF
public double interpret(double playTime, double timeStretch, double dar[], Instrument ins) { // Turn note on (change this line for your needs) JMSL.out.println(this.getName() + " ON: " + dar[1] + " at time=" + playTime); // Schedule call to interpretOff. scheduleInterpretOff(playTime + (dar[3] * timeStretch), timeStretch, dar, ins ); // Standard time interpretation. return playTime + (dar[0] * timeStretch); } // The noteoff you posted to SustainerFactory will call the method below when it is finished sustaining. public double interpretOff(double playTime, double timeStretch, double dar[], Instrument ins) { JMSL.out.println(" " + this.getName() + " OFF: " + dar[1] + " at time=" + playTime); return playTime; }
Interpreter
,
NoteInterpreter
,
NoteOnOffInterpreter
,
Instrument
Constructor Summary | |
---|---|
SustainingInterpreter()
|
Method Summary | |
---|---|
double |
interpret(double playTime,
double timeStretch,
double[] dar,
Instrument ins)
Override this with your own custom "note on" method. Print a note number, and post its off time to the EventScheduler. |
double |
interpretOff(double playTime,
double timeStretch,
double[] dar,
Instrument ins)
Override this with your own "note off" method. |
static void |
main(java.lang.String[] args)
Play a shape with a printing interpreter |
void |
scheduleInterpretOff(double offTime,
double timeStretch,
double[] dar,
Instrument ins)
Schedule a call to the interpretOff method for this object. |
Methods inherited from class com.softsynth.jmsl.Interpreter |
---|
getName |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SustainingInterpreter()
Method Detail |
---|
public void scheduleInterpretOff(double offTime, double timeStretch, double[] dar, Instrument ins)
public double interpret(double playTime, double timeStretch, double[] dar, Instrument ins)
interpret
in class Interpreter
public double interpretOff(double playTime, double timeStretch, double[] dar, Instrument ins)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |