org.jfugue.extras
Class DurationPatternTransformer

java.lang.Object
  extended by org.jfugue.PatternTransformer
      extended by org.jfugue.extras.DurationPatternTransformer
All Implemented Interfaces:
java.util.EventListener, ParserListener

public class DurationPatternTransformer
extends PatternTransformer

The DurationPatternTransformer multiplies the duration of all notes in the given Pattern by a factor passed as a parameter.

This transformer can be used to increase or decrease the duration of notes. To increase the duration, use a variable greater than 1.0. To decrease the duration, use a value less than 1.0. The default value for this transformer is 1.0, which will result in no change to your Pattern.

For general information on how Pattern Transformers work, refer to the JFugue documentation.

Version:
2.0
Author:
David Koelle

Constructor Summary
DurationPatternTransformer(double factor)
          Instantiates a new DurationPatternTransformer object.
 
Method Summary
 void noteEvent(Note note)
          Transforms the given note
 void parallelNoteEvent(Note note)
          Transforms the given note
 void sequentialNoteEvent(Note note)
          Transforms the given note
 
Methods inherited from class org.jfugue.PatternTransformer
channelPressureEvent, controllerEvent, instrumentEvent, keySignatureEvent, layerEvent, measureEvent, pitchBendEvent, polyphonicPressureEvent, tempoEvent, timeEvent, transform, voiceEvent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DurationPatternTransformer

public DurationPatternTransformer(double factor)
Instantiates a new DurationPatternTransformer object. The default value by which to multiply the duration is 1.0, which will result in no change to the given Music String.

Method Detail

noteEvent

public void noteEvent(Note note)
Transforms the given note

Specified by:
noteEvent in interface ParserListener
Overrides:
noteEvent in class PatternTransformer
Parameters:
note - the event that has been parsed
See Also:
Note

sequentialNoteEvent

public void sequentialNoteEvent(Note note)
Transforms the given note

Specified by:
sequentialNoteEvent in interface ParserListener
Overrides:
sequentialNoteEvent in class PatternTransformer
Parameters:
note - the event that has been parsed
See Also:
Note

parallelNoteEvent

public void parallelNoteEvent(Note note)
Transforms the given note

Specified by:
parallelNoteEvent in interface ParserListener
Overrides:
parallelNoteEvent in class PatternTransformer
Parameters:
note - the event that has been parsed
See Also:
Note