|
||||||||||
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 ParserListener
voice
- the event that has been parsedVoice
public void tempoEvent(Tempo tempo)
tempoEvent
in interface ParserListener
tempo
- the event that has been parsedTempo
public void instrumentEvent(Instrument instrument)
instrumentEvent
in interface ParserListener
instrument
- the event that has been parsedInstrument
public void layerEvent(Layer layer)
layerEvent
in interface ParserListener
layer
- the event that has been parsedLayer
public void timeEvent(Time time)
timeEvent
in interface ParserListener
time
- the event that has been parsedTime
public void keySignatureEvent(KeySignature keySig)
keySignatureEvent
in interface ParserListener
KeySignature
public void measureEvent(Measure measure)
measureEvent
in interface ParserListener
measure
- the event that has been parsedMeasure
public void controllerEvent(Controller controller)
controllerEvent
in interface ParserListener
controller
- the event that has been parsedpublic void channelPressureEvent(ChannelPressure channelPressure)
channelPressureEvent
in interface ParserListener
channelPressure
- the event that has been parsedChannelPressure
public void polyphonicPressureEvent(PolyphonicPressure polyphonicPressure)
polyphonicPressureEvent
in interface ParserListener
polyphonicPressure
- the event that has been parsedPolyphonicPressure
public void pitchBendEvent(PitchBend pitchBend)
pitchBendEvent
in interface ParserListener
pitchBend
- the event that has been parsedPitchBend
public void noteEvent(Note note)
noteEvent
in interface ParserListener
note
- the event that has been parsedNote
public void sequentialNoteEvent(Note note)
sequentialNoteEvent
in interface ParserListener
note
- the event that has been parsedNote
public void parallelNoteEvent(Note note)
parallelNoteEvent
in interface ParserListener
note
- the event that has been parsedNote
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |