Audio to MIDI with vocal melody

İsmail Berberoğlu's icon

Hey everyone,

I want to make a patch that takes a raw vocal recording, detects its main frequency and converts it to MIDI note. I did some experiments with the fzero~ object, but I can't get exactly the result I want. Since the frequency values are very unstable, it can't give a proper MIDI note, I guess it's because it's especially vocal because it works better on instruments such as guitar and flute. Also, if a note is held for a long time in the vocal, I don't know how to perceive this as MIDI note length.

As a result, in general, how can I convert a vocal recording to MIDI and do it properly, taking the velocity value from the amplitude value, taking the MIDI length correctly from the vocal, and quantizing the pitch values at the same time?

That's what I've done so far:

Max Patch
Copy patch and select New From Clipboard in Max.

Thanks!

Jean-Francois Charles's icon

You can also try [retune~ @pitchdetection 1].

You can try to use some scheme to see is the pitch is stable "for long enough" then give the MIDI note. And/or smoothing out the signal (slide, slide~ or other lowpass filter).