KeyError: 'A♯'
Thanks for making this! Really cool. I want to try it out, I ran this command on a 30 second file:
python3 multipitch.py erubescente.wav
And am getting this error:
/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/librosa/core/spectrum.py:224: UserWarning: n_fft=2048 is too small for input signal of length=511
n_fft, y.shape[-1]
1 - ESACF (Tolonen, Karjalainen)
Traceback (most recent call last):
File "multipitch.py", line 61, in <module>
chromagram = compute_obj.compute_pitches(args.displayplots)
File "/Volumes/Transcend/chord extraction/chord-detection/chord_detection/tolonen_karjalainen/esacf.py", line 68, in compute_pitches
chromagram[note] += x_esacf[peak_indices[i]]
File "/Volumes/Transcend/chord extraction/chord-detection/chord_detection/chromagram.py", line 21, in __getitem__
return self.c[i]
KeyError: 'A♯'
Any ideas?
Sorry, I missed the notification for this issue. Let me look into it.
@youssefavx is there any way you can share the 30s audio clip so I can test it?
If I had to guess, I'm not sure what symbol "♯" is, but I use "#", the regular hash mark: https://github.com/sevagh/chord-detection/blob/master/chord_detection/chromagram.py#L8
I don't know which part of your code or operating system is replacing the regular # with a stylish ♯ but the second one is not one of the keys of the dict, so a KeyError is expected:
_note_names = ["C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"]
Actually, this is an error on my part. It's related to a new librosa version. I'm patching it as we speak (commit to follow).