I am implementing a pitch detection system where I detect pitch in single notes (guitar).

I recently found this library, that detects chords in an audio signal.

When there are chords in the signal, this has proved great. The accuracy is great and it is also quite fast. However, it also detects chords when a monophonic melody is playing. That's why I want to implement an algorithm to distinguish between moments when there is melody playing or chords playing.

The chord detection algorithm returns something like this:

[(  0. ,   1.2, u'N') (  1.2,   3.4, u'E:maj') (  3.4,   5.5, u'F:maj')
 (  5.5,   7.6, u'F#:maj') (  7.6,   9.7, u'G:maj')
 (  9.7,  11.7, u'G#:maj') ( 11.7,  13.8, u'A:maj')
 ( 13.8,  16. , u'A#:maj') ( 16. ,  18.1, u'B:min')
 ( 18.1,  20.4, u'C:maj') ( 20.4,  22.5, u'C#:maj')
 ( 22.5,  24.7, u'D:maj') ( 24.7,  26.6, u'D#:maj')
 ( 26.6,  28.4, u'E:maj') ( 28.4,  39.7, u'N') ( 39.7,  41.1, u'D#:maj')
 ( 41.1,  46.1, u'N') ( 46.1,  48. , u'A:maj') ( 48. ,  52.3, u'E:maj')
 ( 52.3,  52.7, u'N')]

Where each element of the list represents the start time, end time and chord. "N" stands for no chord.

I tried looking at mean and variance difference in the chromagram and spectrogram but nothing was very different as to make a rule out of it.

I also tried to take the 3-4 strongest peaks in every frame. If those peaks are close to integer multiples of the lowest one, then they are harmonics so there is probably one note. The problem is that in low notes (for example the low E string) there is a lot of inharmonicity anyway, so if I take the three peaks for a single E2 note played, one of them will probably not be a multiple.

Is there a good way to do this? Papers I read focused on labelling the chords but not finding if they were played.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.