Package org.jfugue.theory
Class Chord
java.lang.Object
org.jfugue.theory.Chord
- All Implemented Interfaces:
PatternProducer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static void
boolean
static Chord
static Chord
static Chord
static String[]
static String
getChordType
(Intervals intervals) static String
getHumanReadableName
(String chordName) Returns a human readable chord name if one exists, otherwise returns the same chord name that was passed instatic Intervals
getIntervals
(String name) int
static int
getInversionFromChordString
(String chordString) Returns a count of the number of carets at the end of the chord string.Note[]
getNotes()
Returns a patterngetRoot()
boolean
isMajor()
boolean
isMinor()
static boolean
isValidChord
(String candidateChordMusicString) Returns true if the passed string contains a note, a known chord, and optionally an octave or duration.static void
putHumanReadable
(String chordName, String humanReadableName) static void
removeChord
(String name) setBassNote
(String newBass) setBassNote
(Note newBass) Although setBassNote takes a Note, it doesn't just set a local value to the incoming note.setInversion
(int nth) setOctave
(int octave) Returns a string consisting of the notes in the chord.toString()
-
Field Details
-
chordMap
-
humanReadableMap
-
MAJOR_INTERVALS
-
MINOR_INTERVALS
-
DIMINISHED_INTERVALS
-
MAJOR_SEVENTH_INTERVALS
-
MINOR_SEVENTH_INTERVALS
-
DIMINISHED_SEVENTH_INTERVALS
-
MAJOR_SEVENTH_SIXTH_INTERVALS
-
MINOR_SEVENTH_SIXTH_INTERVALS
-
-
Constructor Details
-
Chord
-
Chord
-
Chord
-
Chord
-
-
Method Details
-
getChordNames
-
addChord
-
addChord
-
getIntervals
-
removeChord
-
getChordType
-
putHumanReadable
-
getHumanReadableName
Returns a human readable chord name if one exists, otherwise returns the same chord name that was passed in -
isValidChord
Returns true if the passed string contains a note, a known chord, and optionally an octave or duration. -
fromNotes
-
fromNotes
-
fromNotes
-
getRoot
-
getIntervals
-
getInversion
public int getInversion() -
setInversion
-
setBassNote
- See Also:
-
setBassNote
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
-
setOctave
-
getNotes
-
getChordType
-
getInversionFromChordString
Returns a count of the number of carets at the end of the chord string. Given Cmaj^^, this will return 2. -
getPattern
Description copied from interface:PatternProducer
Returns a pattern- Specified by:
getPattern
in interfacePatternProducer
-
getPatternWithNotes
-
getPatternWithNotesExceptRoot
-
getPatternWithNotesExceptBass
-
isMajor
public boolean isMajor() -
isMinor
public boolean isMinor() -
equals
-
toString
-
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
-
toDebugString
-