Package org.jfugue.theory
Class ChordProgression
java.lang.Object
org.jfugue.theory.ChordProgression
- All Implemented Interfaces:
PatternProducer
-
Constructor Summary
ConstructorsConstructorDescriptionChordProgression
(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
(String[] progressionElements) Creates a chord progression given an array of Progression Strings, like { "I", "vi", "ii", "V" } - case is important! -
Method Summary
Modifier and TypeMethodDescriptionallChordsAs
(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.distribute
(String distribute) eachChordAs
(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
(String knownChords) static ChordProgression
fromChords
(Chord... chords) Chord[]
Returns a list of chords represented by this chord progression.Returns a patternThe key usually identifies the tonic note and/or chord [Wikipedia]toString()
String[]
-
Constructor Details
-
ChordProgression
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
Creates a chord progression given an array of Progression Strings, like { "I", "vi", "ii", "V" } - case is important!
-
-
Method Details
-
fromChords
-
fromChords
-
setKey
The key usually identifies the tonic note and/or chord [Wikipedia] -
setKey
-
getPattern
Description copied from interface:PatternProducer
Returns a pattern- Specified by:
getPattern
in interfacePatternProducer
-
getChords
Returns a list of chords represented by this chord progression. -
toString
-
toStringArray
-
eachChordAs
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
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
-