Chord API Reference
Complete API documentation for the Chord
class.
Class Definition
Constructors
Chord(Note, ChordType)
Creates a new chord with the specified root note and chord type.
Parameters:
root
: The root note of the chordtype
: The chord type (Major, Minor7, Dominant13, etc.)
Example:
Chord(Note, ChordQuality) [Legacy]
Creates a new chord with basic quality (for backward compatibility).
Parameters:
root
: The root note of the chordquality
: The basic chord quality (Major, Minor, Diminished, Augmented)
Note: This constructor maps to basic triad types. Use the ChordType constructor for extended chords.
Example:
Properties
Root
Gets the root note of the chord.
Type
Gets the chord type (40+ types available).
Quality
Gets the basic quality (Major, Minor, Diminished, Augmented). Derived from Type.
Instance Methods
GetNotes()
Gets all notes in the chord.
Returns: The chord tones in ascending order
Example:
GetSymbol()
Gets the chord symbol notation.
Returns: Standard chord symbol (e.g., "C", "Dm7", "G13", "F#maj7")
Examples:
Major → "C"
Minor → "Cm"
Major7 → "Cmaj7"
Dominant7 → "C7"
Minor7Flat5 → "Cm7b5"
Diminished7 → "C°7"
Transpose(Interval, Direction?)
Transposes the chord by the specified interval.
Parameters:
interval
: The interval to transpose bydirection
: The direction (Up or Down), default is Up
Returns: A new Chord instance with transposed root
Example:
TransposeBySemitones(int)
Transposes the chord by a number of semitones.
Parameters:
semitones
: Number of semitones (positive = up, negative = down)
Returns: A new Chord instance
GetEnharmonicEquivalent()
Gets the enharmonic equivalent of this chord.
Returns: The enharmonic equivalent, or null if root has no enharmonic
Example:
AddExtension(int, IntervalQuality) [Legacy]
Adds an extension to the chord (for backward compatibility).
Note: This method is maintained for backward compatibility. Prefer using specific ChordType values.
ToString()
Returns a string representation of the chord.
Format: Same as GetSymbol()
Equals(Chord?)
Determines if this chord equals another chord.
Note: Compares root note and chord type.
GetHashCode()
Returns the hash code for the chord.
Static Methods
GetIntervalsForChordType(ChordType)
Gets the intervals that define a chord type.
Parameters:
type
: The chord type
Returns: List of intervals from the root
Example:
Operators
Equality Operators
Compare chords by root and type.
ChordType Enumeration
The library supports 40+ chord types:
Triads
Major
Minor
Diminished
Augmented
Seventh Chords
Major7
Minor7
Dominant7
MinorMajor7
HalfDiminished7 (Minor7Flat5)
Diminished7
Augmented7
AugmentedMajor7
Extended Chords
Major9, Minor9, Dominant9
Major11, Minor11, Dominant11
Major13, Minor13, Dominant13
Altered Chords
Dominant7Flat5
Dominant7Sharp5
Dominant7Flat9
Dominant7Sharp9
Dominant7Sharp11
Dominant7Flat13
Suspended Chords
Sus2
Sus4
Dominant7Sus2
Dominant7Sus4
Add Chords
Add9, MinorAdd9
Add11, MinorAdd11
Add13, MinorAdd13
Other Types
Power (root + fifth)
Major6, Minor6
Dominant6
MinorMajor9
Common Patterns
Creating Common Chords
Working with Progressions
Chord Analysis
Building Custom Chord Collections
Special Chord Types
Power Chords
Sixth Chords
Altered Dominants
Performance Notes
Chord note generation uses cached interval lookups
Symbol generation is optimized with switch expressions
GetNotes() yields notes lazily when possible
Transposition creates new instances (immutable)
Thread Safety
The Chord
class is immutable and thread-safe. Multiple threads can safely:
Read all properties
Call all methods
Share Chord instances
No synchronization is needed.
Validation
Root note must not be null
ChordType must be a valid enum value
Invalid combinations are prevented at compile time through the type system