Closed nieldlr closed 4 years ago
Hi,
glad you like it! :-)
I think there's no obvious or easy way to do it. I guess some approach is to generate the major scale for every key you want to test (this is the first decision to make: are flats and sharps allowed as key root?). Then with the @tonaljs/pcset utilities, find if a collection of notes matches the set.
Something like this (but iterating for all desired keys to check):
const cMajor = Scale.get('C major').notes;
const isCMajorKey = PcSet.isSubsetOf(cMajor);
isCMajorKey(['C', 'D', 'E') // => true
isCMajorKey(['C', 'D', 'Eb') // => false
Hope it helps
I think that helps yes! Got a bit sidetracked at the moment, but will try this in the future. Thanks @danigb!
Hi,
totally in love with this library! Thanks so much.
I'm not sure if I'm missing this, but I'd like to have the possibility provide a set of notes and tell me what possible keys work with these notes? Is that possible at the moment? Sorry if this is an obvious one!