Package org.jfugue.theory
Class ChordProgression
- java.lang.Object
-
- org.jfugue.theory.ChordProgression
-
- All Implemented Interfaces:
PatternProducer
public class ChordProgression extends java.lang.Object implements PatternProducer
-
-
Constructor Summary
Constructors Constructor Description ChordProgression(java.lang.String progression)
Creates a chord progression given a Progression String, like "I vi ii V" - case is important! Chords can be separated with spaces ("I vi ii V") or dashes ("I-vi-ii-V").ChordProgression(java.lang.String[] progressionElements)
Creates a chord progression given an array of Progression Strings, like { "I", "vi", "ii", "V" } - case is important!
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ChordProgression
allChordsAs(java.lang.String sequence)
Requires passing a string that has dollar signs followed by an index, in which case each dollar+index will be replaced by the indexed chord of the chord progression.ChordProgression
distribute(java.lang.String distribute)
ChordProgression
eachChordAs(java.lang.String sequence)
Requires passing a string that has dollar signs followed by an index, in which case each dollar+index will be replaced by the indexed note of the chord for each chord in the progression.static ChordProgression
fromChords(java.lang.String knownChords)
static ChordProgression
fromChords(Chord... chords)
Chord[]
getChords()
Returns a list of chords represented by this chord progression.Pattern
getPattern()
Returns a patternChordProgression
setKey(java.lang.String key)
The key usually identifies the tonic note and/or chord [Wikipedia]ChordProgression
setKey(Key key)
java.lang.String
toString()
java.lang.String[]
toStringArray()
-
-
-
Constructor Detail
-
ChordProgression
public ChordProgression(java.lang.String progression)
Creates a chord progression given a Progression String, like "I vi ii V" - case is important! Chords can be separated with spaces ("I vi ii V") or dashes ("I-vi-ii-V").
-
ChordProgression
public ChordProgression(java.lang.String[] progressionElements)
Creates a chord progression given an array of Progression Strings, like { "I", "vi", "ii", "V" } - case is important!
-
-
Method Detail
-
fromChords
public static ChordProgression fromChords(java.lang.String knownChords)
-
fromChords
public static ChordProgression fromChords(Chord... chords)
-
setKey
public ChordProgression setKey(java.lang.String key)
The key usually identifies the tonic note and/or chord [Wikipedia]
-
setKey
public ChordProgression setKey(Key key)
-
getPattern
public Pattern getPattern()
Description copied from interface:PatternProducer
Returns a pattern- Specified by:
getPattern
in interfacePatternProducer
-
getChords
public Chord[] getChords()
Returns a list of chords represented by this chord progression.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toStringArray
public java.lang.String[] toStringArray()
-
eachChordAs
public ChordProgression eachChordAs(java.lang.String sequence)
Requires passing a string that has dollar signs followed by an index, in which case each dollar+index will be replaced by the indexed note of the chord for each chord in the progression. For example, given a ChordProgression of "I IV V" and a string of "$0q $1h $2w", will return "Cq E4h G4w Fq A4h C5w Gq B4h D5w". Using the underscore character instead of an index will result in the chord itself added to the string. The final result will be returned from the getPattern() method.
-
allChordsAs
public ChordProgression allChordsAs(java.lang.String sequence)
Requires passing a string that has dollar signs followed by an index, in which case each dollar+index will be replaced by the indexed chord of the chord progression. For example, given a ChordProgression of "I IV V" and a string of "$0q $1h $2w", will return "C4MAJq F4MAJh G4MAJw". Using the underscore character instead of an index will result in the pattern of the ChordProgression itself added to the string. The final result will be returned from the getPattern() method.
-
distribute
public ChordProgression distribute(java.lang.String distribute)
-
-