Class ChordProgression

java.lang.Object
org.jfugue.theory.ChordProgression
All Implemented Interfaces:
PatternProducer

public class ChordProgression extends Object implements PatternProducer
  • Constructor Details

    • ChordProgression

      public ChordProgression(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(String[] progressionElements)
      Creates a chord progression given an array of Progression Strings, like { "I", "vi", "ii", "V" } - case is important!
  • Method Details

    • fromChords

      public static ChordProgression fromChords(String knownChords)
    • fromChords

      public static ChordProgression fromChords(Chord... chords)
    • setKey

      public ChordProgression setKey(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 interface PatternProducer
    • getChords

      public Chord[] getChords()
      Returns a list of chords represented by this chord progression.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toStringArray

      public String[] toStringArray()
    • eachChordAs

      public ChordProgression 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. 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(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(String distribute)