I've been trying to use the Python module Music21 to try and get the key from a set of chords, but no matter what I put in it always seems to return c minor
. Any ideas what I'm doing wrong?
I've tried a variety of input strings, the print statement spits out all the right chord names but the resulting key is always c minor!
I'm using Python 3.7.4 on Windows with VSCode.
string = 'D, Em, F#m, G, A, Bm'
s = stream.Stream()
for c in string.split(','):
print(harmony.ChordSymbol(c).pitchedCommonName)
s.append(harmony.ChordSymbol(c))
key = s.analyze('key')
print(key)
D-major triad E-minor triad F#-minor triad G-major triad A-major triad B-minor triad c minor
– Colan