|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jfugue.PatternTransformer
public abstract class PatternTransformer
This class is used to transform a pattern. Extend this class to create your own PatternTransformer, which listens to parser events and can modify the events that are fired off by the parser. Some sample PatternTransformer subclasses are packaged with JFugue; refer to those to see examples of transformers in action. This feature is covered in detail in The Complete Guide to JFugue.
DiatonicIntervalPatternTransformer,
DurationPatternTransformer,
IntervalPatternTransformer,
ReversePatternTransformer| Field Summary | |
|---|---|
protected Pattern |
returnPattern
Contains the pattern to return at the end of the transformation. |
| Constructor Summary | |
|---|---|
PatternTransformer()
|
|
| Method Summary | |
|---|---|
void |
channelPressureEvent(ChannelPressure channelPressure)
Extend this method to make your transformer modify the channel pressure messages. |
void |
controllerEvent(Controller controller)
Extend this method to make your transformer modify the controller messages. |
java.lang.String |
getDescription()
Indicates what this PatternTransformer does. |
java.lang.Object |
getParameter(java.lang.String name)
Returns a variable setting. |
java.lang.String |
getParameters()
Returns a list of parameters needed by your Transformer. |
void |
instrumentEvent(Instrument instrument)
Extend this method to make your transformer modify the instrument. |
void |
keySignatureEvent(KeySignature keySig)
Extend this method to make your transformer modify the time. |
void |
layerEvent(Layer layer)
Extend this method to make your transformer modify the layer. |
void |
measureEvent(Measure measure)
Extend this method to make your transformer modify the measure. |
void |
noteEvent(Note note)
Extend this method to make your transformer modify the note. |
void |
parallelNoteEvent(Note note)
Extend this method to make your transformer modify the note. |
void |
pitchBendEvent(PitchBend pitchBend)
Extend this method to make your transformer modify the pitch bend messages. |
void |
polyphonicPressureEvent(PolyphonicPressure polyphonicPressure)
Extend this method to make your transformer modify the polyphonic pressure messages. |
void |
putParameter(java.lang.String name,
java.lang.Object value)
Places a value for a variable. |
void |
sequentialNoteEvent(Note note)
Extend this method to make your transformer modify the note. |
void |
tempoEvent(Tempo tempo)
Extend this method to make your transformer modify the tempo. |
void |
timeEvent(Time time)
Extend this method to make your transformer modify the time. |
Pattern |
transform(Pattern p)
Transforms the pattern, according to the event method that you have presumably extended. |
void |
voiceEvent(Voice voice)
Extend this method to make your transformer modify the voice. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Pattern returnPattern
| Constructor Detail |
|---|
public PatternTransformer()
| Method Detail |
|---|
public java.lang.String getParameters()
It is very important to keep these strings standardized! This will allow future programs to understand what is required of each Transformer. Therefore, make your Transformer return strings like this. Notice the use of quotes and slashes.
'variable name'/type/description/default
If you need to return multiple Strings, end each String with a \n, the newline character.
Also, be sure to add your strings to the JavaDoc for the getParameters() method as well, so users can learn what your code needs from its documentation.
public java.lang.String getDescription()
public void putParameter(java.lang.String name,
java.lang.Object value)
public java.lang.Object getParameter(java.lang.String name)
public Pattern transform(Pattern p)
public void voiceEvent(Voice voice)
voiceEvent in interface ParserListenervoice - the event that has been parsedVoicepublic void tempoEvent(Tempo tempo)
tempoEvent in interface ParserListenertempo - the event that has been parsedTempopublic void instrumentEvent(Instrument instrument)
instrumentEvent in interface ParserListenerinstrument - the event that has been parsedInstrumentpublic void layerEvent(Layer layer)
layerEvent in interface ParserListenerlayer - the event that has been parsedLayerpublic void timeEvent(Time time)
timeEvent in interface ParserListenertime - the event that has been parsedTimepublic void keySignatureEvent(KeySignature keySig)
keySignatureEvent in interface ParserListenerKeySignaturepublic void measureEvent(Measure measure)
measureEvent in interface ParserListenermeasure - the event that has been parsedMeasurepublic void controllerEvent(Controller controller)
controllerEvent in interface ParserListenercontroller - the event that has been parsedpublic void channelPressureEvent(ChannelPressure channelPressure)
channelPressureEvent in interface ParserListenerchannelPressure - the event that has been parsedChannelPressurepublic void polyphonicPressureEvent(PolyphonicPressure polyphonicPressure)
polyphonicPressureEvent in interface ParserListenerpolyphonicPressure - the event that has been parsedPolyphonicPressurepublic void pitchBendEvent(PitchBend pitchBend)
pitchBendEvent in interface ParserListenerpitchBend - the event that has been parsedPitchBendpublic void noteEvent(Note note)
noteEvent in interface ParserListenernote - the event that has been parsedNotepublic void sequentialNoteEvent(Note note)
sequentialNoteEvent in interface ParserListenernote - the event that has been parsedNotepublic void parallelNoteEvent(Note note)
parallelNoteEvent in interface ParserListenernote - the event that has been parsedNote
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||