Class Chord

    • Field Detail

      • chordMap

        public static java.util.Map<java.lang.String,​Intervals> chordMap
      • humanReadableMap

        public static java.util.Map<java.lang.String,​java.lang.String> humanReadableMap
      • MAJOR_INTERVALS

        public static final Intervals MAJOR_INTERVALS
      • MINOR_INTERVALS

        public static final Intervals MINOR_INTERVALS
      • DIMINISHED_INTERVALS

        public static final Intervals DIMINISHED_INTERVALS
      • MAJOR_SEVENTH_INTERVALS

        public static final Intervals MAJOR_SEVENTH_INTERVALS
      • MINOR_SEVENTH_INTERVALS

        public static final Intervals MINOR_SEVENTH_INTERVALS
      • DIMINISHED_SEVENTH_INTERVALS

        public static final Intervals DIMINISHED_SEVENTH_INTERVALS
      • MAJOR_SEVENTH_SIXTH_INTERVALS

        public static final Intervals MAJOR_SEVENTH_SIXTH_INTERVALS
      • MINOR_SEVENTH_SIXTH_INTERVALS

        public static final Intervals MINOR_SEVENTH_SIXTH_INTERVALS
    • Constructor Detail

      • Chord

        public Chord​(java.lang.String s)
      • Chord

        public Chord​(Chord chord)
      • Chord

        public Chord​(Key key)
    • Method Detail

      • getChordNames

        public static java.lang.String[] getChordNames()
      • addChord

        public static void addChord​(java.lang.String name,
                                    java.lang.String intervalPattern)
      • addChord

        public static void addChord​(java.lang.String name,
                                    Intervals intervalPattern)
      • getIntervals

        public static Intervals getIntervals​(java.lang.String name)
      • removeChord

        public static void removeChord​(java.lang.String name)
      • getChordType

        public static java.lang.String getChordType​(Intervals intervals)
      • putHumanReadable

        public static void putHumanReadable​(java.lang.String chordName,
                                            java.lang.String humanReadableName)
      • getHumanReadableName

        public static java.lang.String getHumanReadableName​(java.lang.String chordName)
        Returns a human readable chord name if one exists, otherwise returns the same chord name that was passed in
      • isValidChord

        public static boolean isValidChord​(java.lang.String candidateChordMusicString)
        Returns true if the passed string contains a note, a known chord, and optionally an octave or duration.
      • fromNotes

        public static Chord fromNotes​(java.lang.String noteString)
      • fromNotes

        public static Chord fromNotes​(java.lang.String[] noteStrings)
      • fromNotes

        public static Chord fromNotes​(Note[] notes)
      • getRoot

        public Note getRoot()
      • getIntervals

        public Intervals getIntervals()
      • getInversion

        public int getInversion()
      • setInversion

        public Chord setInversion​(int nth)
      • setBassNote

        public Chord setBassNote​(java.lang.String newBass)
        See Also:
        for details.
      • setBassNote

        public Chord setBassNote​(Note newBass)
        Although setBassNote takes a Note, it doesn't just set a local value to the incoming note. Instead, it uses the incoming note to compute the inversion for this chord, and sets the inversion. getBassNote() reconstructs the bass note using the inversion. If the rootNote is null, this method returns without taking any action.
      • getBassNote

        public Note getBassNote()
      • setOctave

        public Chord setOctave​(int octave)
      • getNotes

        public Note[] getNotes()
      • getChordType

        public java.lang.String getChordType()
      • getInversionFromChordString

        public static int getInversionFromChordString​(java.lang.String chordString)
        Returns a count of the number of carets at the end of the chord string. Given Cmaj^^, this will return 2.
      • getPatternWithNotes

        public Pattern getPatternWithNotes()
      • getPatternWithNotesExceptRoot

        public Pattern getPatternWithNotesExceptRoot()
      • getPatternWithNotesExceptBass

        public Pattern getPatternWithNotesExceptBass()
      • isMajor

        public boolean isMajor()
      • isMinor

        public boolean isMinor()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toNoteString

        public java.lang.String toNoteString()
        Returns a string consisting of the notes in the chord. For example, new Chord("Cmaj").toNoteString() returns "(C+E+G)" TODO: Update with Java 8 String Joiner
      • toHumanReadableString

        public java.lang.String toHumanReadableString()
      • toDebugString

        public java.lang.String toDebugString()