Seeking Help with Polyphonic Audio to MIDI Conversion in Max

David Denisov's icon

Hello MaxMSP Community,

I am working on a project in Max where I need to convert audio input into MIDI output, similar to the functionality shown in this video:

In the video, the patch appears to be capable of detecting and outputting multiple pitches simultaneously, which is exactly what I am aiming to achieve.

From my understanding and previous experience, objects like sigmund~ and fiddle~ are designed for monophonic pitch detection. However, the example in the video suggests a capability for polyphonic pitch detection.

Could anyone advise on how to approach building or modifying a patch that can handle polyphonic audio to MIDI conversion? Are there specific objects or external libraries in Max that are suited for this purpose? Any tips on managing the data to ensure accurate pitch detection and output would also be greatly appreciated.

Thank you in advance for your help!

Source Audio's icon

that is no detection at all.

that noisy terrible screaming voice false triggers a bunch of frequencies

which then trigger a bunch of notes.

Roman Thilenius's icon

there is technically optimized pitch tracking and there is interesting arts, and there is no rule which says that you could do both in one patch.

David Denisov's icon

Gratitude to you both for your insightful responses!

Initially, I assumed that the 'audiotomidi' patch within the video dealt with analyzing the audio input through Fast Fourier Transform (FFT), subsequently selecting and playing back specific peak frequencies as corresponding MIDI notes.

However, if pitch detection is not its primary function in this case, how does the audio trigger the midi notes, which audibly associated with the audio input in the patch?

Thank you again!

Roman Thilenius's icon

there is probably some sort of ->pitch following or spectral analysis involved here, but obviously extrapolated.
and that second characteristic you are looking for is ->transient (attack) detection.

however, this stuff sounds so interestig because the code is imperfect.

just build something. it´s legit.

Eric's icon

David, the object in that video was released as a standalone patch 10 years ago but it no longer works. I played with it long ago and it was pretty good, although not AFAIK polyphonic. If you look inside the app package, you can see it uses fiddle~.

I've been trying to do polyphonic output with the analyzer~ object, it's kind of working, but not great. The old analyzer has been removed due to license issues but you can download it here. The new analyzer2 doesn't work for me at all (on an Intel Mac) but I haven't had time to figure out why.

I'd love to know what you've found.

if you want me to send you Talking Piano, LMK I'd be happy to - maybe you can recreate it by looking at its internal collection, shown here: