Skip to content

I want to be able to define chords using standard chord notation #2

@ntoll

Description

@ntoll

Names like "Dmaj7", "F13", "Csus4" etc are used by musicians to define a harmonic block, aka a chord. I should be able to use such terms as a harmonic DSL that returns a data structure defining the constituent notes. Such a data structure could then be given to, say, a generator function to produce actual pitches or melodic fragments that work for the named chord. Other meta-data (such as the chord's inversion) could be passed in on init.

Sample code, as a starter for 10:

>>> my_chord = music.chord("Dmaj7", inversion=root)
>>> my_chord
<Chord: Dmaj7 root>
>>> chord.notes
["d", "f#", "a", "c#"]
>>> chord.inversion
"root"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions