JuliaMusic / MusicTheory.jl

Music theory in Julia
MIT License
46 stars 1 forks source link

more chord support #19

Open stevengj opened 5 months ago

stevengj commented 5 months ago

It seems a lot of things could be added to the chord support.

It might be nice to have a function like make_chord(root, major/minor/diminished/augmented, extensions..., inversion=...) where extensions could be scale degree like 7, 9, …, with some keyword arguments to indicate voicings like inversions, though to have complete freedom over voicing you might still have to specify it as just a set of notes in some cases. Would also be nice to be able to specify standard chord symbols in some natural way, e.g. C9/G or Em*add9.

Would also be nice to be able to be able to take a set of notes and a given root note and identify a conventional name for the chord, although sometimes this is not unique, and the naming can differ based on the genre of music (e.g. classical vs. jazz/popular vs. more esoteric branches of music theory). e.g. if you give the set {G,A,C,E} and a root note A, then it should identify it as Am7/G, whereas if you give the same set and a root note C it should identify it as C6/G (in jazz/pop notation).

stevengj commented 5 months ago

See e.g. lilypond's chord-naming facilities.

stevengj commented 5 months ago

There is also the tension between an abstract notion of a chord as a collection of intervals (e.g. "dominant seventh chord"), independent of particular set of notes, and versus its realization with a particular root (e.g. "G7"), versus the even more specific notion of a particular voicing.

And of course there are other systems of naming chords, e.g. the "ii7" chord, that are relative to the choice of tonic.

It's a bit hard to pin down what functionality you want here, since it depends a lot on what you want to use it for.

NeroBlackstone commented 2 months ago

It would be awesome if this could be achieved!

I think discussing the implementation of so many features in the same issue might cause confusion.I suggest opening separate issues to discuss individual features step by step.

I think the first step is to perfect the calculation of intervals so that we can subsequently construct any chord structure we want.(I haven't tried this package yet, so I don't know if the interval calculation function is fully complete.)