public class Pattern extends java.lang.Object implements PatternProducer, TokenProducer
Modifier and Type | Field and Description |
---|---|
protected java.lang.StringBuilder |
patternSB |
Constructor and Description |
---|
Pattern() |
Pattern(PatternProducer... producers) |
Pattern(java.lang.String... strings) |
Pattern(java.lang.String string) |
Modifier and Type | Method and Description |
---|---|
Pattern |
add(PatternProducer... producers) |
Pattern |
add(PatternProducer producer,
int repetitions) |
Pattern |
add(java.lang.String string) |
Pattern |
add(java.lang.String string,
int repetitions) |
Pattern |
addToEachNoteToken(java.lang.String decoratorString)
Expects a parameter of "note decorators" - i.e., things that are added to
the end of a note, such as duration or attack/decay settings; splits the given
parameter on spaces and applies each decorator to each note as it is encountered
in the current pattern.
|
Pattern |
atomize()
Turns the given pattern into a pattern of Voice-Instrument-Note atoms
|
Pattern |
clear() |
Pattern |
getPattern()
Returns a pattern
|
java.util.List<Token> |
getTokens() |
static Pattern |
load(java.io.File file) |
Pattern |
measure(ParserListener listener)
Parse this pattern and have the given ParserListener listen to it.
|
Pattern |
prepend(PatternProducer... producers)
Prepends each producer in the order it is passed in,
so if you pass in "F F", "G G", and "E E", and the current
pattern is "A A", you will get "F F G G E E A A".
|
Pattern |
prepend(java.lang.String string)
Inserts the given string to the beginning of this pattern.
|
Pattern |
repeat(int n) |
Pattern |
save(java.io.File file) |
Pattern |
save(java.io.File file,
java.lang.String... comments) |
Pattern |
setInstrument(int instrument)
Provides a way to explicitly set the instrument on a Pattern directly
through the pattern rather than by adding text to the contents
of the Pattern.
|
Pattern |
setInstrument(java.lang.String instrument)
Provides a way to explicitly set the instrument on a Pattern directly
through the pattern rather than by adding text to the contents
of the Pattern.
|
Pattern |
setLayer(int layer)
Provides a way to explicitly set the layer on a Pattern directly
through the pattern rather than by adding text to the contents
of the Pattern.
|
Pattern |
setTempo(int explicitTempo)
Provides a way to explicitly set the tempo on a Pattern directly
through the pattern rather than by adding text to the contents
of the Pattern.
|
Pattern |
setTempo(java.lang.String tempo)
Provides a way to explicitly set the tempo on a Pattern directly
through the pattern rather than by adding text to the contents
of the Pattern.
|
Pattern |
setVoice(int voice)
Provides a way to explicitly set the voice on a Pattern directly
through the pattern rather than by adding text to the contents
of the Pattern.
|
java.lang.String |
toString() |
Pattern |
transform(ParserListener listener)
Parse this pattern and have the given ParserListener listen to it.
|
public Pattern()
public Pattern(java.lang.String string)
public Pattern(java.lang.String... strings)
public Pattern(PatternProducer... producers)
public Pattern add(PatternProducer... producers)
public Pattern add(java.lang.String string)
public Pattern add(PatternProducer producer, int repetitions)
public Pattern add(java.lang.String string, int repetitions)
public Pattern prepend(PatternProducer... producers)
public Pattern prepend(java.lang.String string)
public Pattern clear()
public Pattern repeat(int n)
public Pattern atomize()
public Pattern getPattern()
PatternProducer
getPattern
in interface PatternProducer
public java.util.List<Token> getTokens()
getTokens
in interface TokenProducer
public java.lang.String toString()
toString
in class java.lang.Object
public Pattern setTempo(int explicitTempo)
public Pattern setTempo(java.lang.String tempo)
public Pattern setVoice(int voice)
public Pattern setLayer(int layer)
public Pattern setInstrument(int instrument)
public Pattern setInstrument(java.lang.String instrument)
public Pattern addToEachNoteToken(java.lang.String decoratorString)
public Pattern save(java.io.File file) throws java.io.IOException
java.io.IOException
public Pattern save(java.io.File file, java.lang.String... comments) throws java.io.IOException
java.io.IOException
public static Pattern load(java.io.File file) throws java.io.IOException
java.io.IOException
public Pattern transform(ParserListener listener)
public Pattern measure(ParserListener listener)