-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for combinations, e.g. Amaj7sus2 #114
Comments
I checked out Also, is (b5) on its own a valid chord, e.g. F(b5)? |
Also, it would be nice to have an extra field in the chord object |
From https://en.wikibooks.org/wiki/Music_Theory/Complete_List_of_Chord_Patterns#Alterations
The table itself only contains examples. BTW I would not trust a wikipedia article to be complete, especially if its title says so. ;) The required notes I was talking about would omit the steps that are parenthesized in the article. |
Hey, I found this issue because I'm developing a MIDI chord detection program. I also try to use this chord data from the wiki article. What I've done to allow these optional notes is to encode it as bitmasks and use bitwise operations. Maybe it's interesting for you: const chordData = {
// 1 3 (5) 7
name: 'maj7',
mask: 0b111111101111,
bits: 0b100010000001,
};
// create integer from string bit representation, in this case 1 3 7
const chordBits = parseInt('100010000001', 2);
// compare to data
if ((chordBits & chordData.mask) === chordData.bits) {
// matched
} Nevertheless, I will probably no longer pursue this approach and switch to an algorithmic approach, because it would be very hard to implement inversion and slash chords in this way. The best library for inspiration that I've found is this: https://github.com/t-bre/MIDIAnalyser/blob/master/MIDIAnalyser_2-0-0/MIDIAnalyser/ChordAnalyser/ChordAnalyser.swift It gets the intervals from the chord and find the tonality and all extensions by that. It also processes all inversions and it seems it works with slashed chords, too. But I don't know how good the namings are in the end or if these chords all make sense. |
Currently it seems there's not support for advanced chords like Amaj7sus2, C6add2, etc.
The text was updated successfully, but these errors were encountered: