org.jfugue.demo
Class DurationPatternTransformer
java.lang.Object
|
+--org.jfugue.PatternTransformer
|
+--org.jfugue.demo.DurationPatternTransformer
- All Implemented Interfaces:
- ParserListener
- public class DurationPatternTransformer
- extends PatternTransformer
The DurationPatternTransformer multiplies the duration of all notes in the given
Music String by a factor passed as a variable.
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 Music String.
For general information on how Pattern Transformers work, refer to the JFugue
documentation.
- Version:
- 2.0
- Author:
- David Koelle
Field Summary |
static java.lang.String |
FACTOR
Pass this String to putVariable, along with the factor by which you wish to alter the duration. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FACTOR
public static final java.lang.String FACTOR
- Pass this String to putVariable, along with the factor by which you wish to alter the duration.
DurationPatternTransformer
public DurationPatternTransformer()
- 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.
getVariables
public java.lang.String getVariables()
- Returns a string declaring what variables DurationPatternTransformer can use to
perform the transformation.
DurationPatternTransformer requires the following:
'factor' - Double - Factor by which to multiply the existing duration of
a note. Greater than 1.0 produces longer notes, less than 1.0 produces shorter notes. Default is 1.0
- Overrides:
getVariables
in class PatternTransformer
getDescription
public java.lang.String getDescription()
- Description copied from class:
PatternTransformer
- Indicates what this PatternTransformer does.
- Overrides:
getDescription
in class PatternTransformer
- Following copied from class:
org.jfugue.PatternTransformer
- Returns:
- A String giving a quick description of this transformer
noteEvent
public void noteEvent(Note note)
- Transforms the given note
- Overrides:
noteEvent
in class PatternTransformer
- Following copied from interface:
org.jfugue.ParserListener
- Parameters:
note
- the event that has been parsed
sequentialNoteEvent
public void sequentialNoteEvent(Note note)
- Transforms the given note
- Overrides:
sequentialNoteEvent
in class PatternTransformer
- Following copied from interface:
org.jfugue.ParserListener
- Parameters:
note
- the event that has been parsed
parallelNoteEvent
public void parallelNoteEvent(Note note)
- Transforms the given note
- Overrides:
parallelNoteEvent
in class PatternTransformer
- Following copied from interface:
org.jfugue.ParserListener
- Parameters:
note
- the event that has been parsed