Help Improving Audio-to-MIDI Conversion and MIDI Recording in Max/MSP

David Denisov's icon

Hello everyone,

I'm new to MAX, I am currently working on a project in Max/MSP where I need to convert audio signals to MIDI, record the MIDI data, and ensure accurate pitch detection and MIDI note sequencing. I'm using the [sigmund~] object for pitch detection and the [seq] object to handle MIDI recording. My current setup is designed to send MIDI 'note-on' messages when [sigmund~] outputs a pitch value greater than 0, and 'note-off' messages when the output is -1500. However, I'm experiencing instability with pitch detection and timing issues in the sequence of note-on, pitch, and note-off messages.

Here's a brief overview of my patch:

Pitch Detection: Using [sigmund~] to detect pitch. Facing issues with instability in the pitch values detected.

MIDI Handling: Using [pipe] to manage the timing sequence of 'note-on', pitch number, and 'note-off' messages. I'm not sure if this is the best approach.

I would appreciate any advice on the following:

Improving Pitch Detection: Are there alternative objects or methods I can use instead of [sigmund~] for more stable and accurate pitch detection?

Optimizing MIDI Sequencing: Is there a more efficient way to manage the timing and sequencing of MIDI messages than using [pipe]?

Any tips, examples, or insights you could share would be greatly appreciated!

Thank you!

Source Audio's icon

I can't give any advice about pitch detection for unknown kind of

audio input.

What is it ? If not pure monophonic , you can more or less forget it.

There are quite few pitch detecting externals, like fzero, sigmund-fiddle,

vb.pitch, yin / psola based ircam stuff, flucoma ... and so on

test your material through all of them to get best results for

your specific audio material.

For midi itself - don't use pipe.

collect pitch - velocity pairs and output as one list

when onset or pitch deviation gets detected.

A lot of filtering on both input and output of pitch detector is needed

to get it working ± reliable.

Vincent Goudard's icon

Audio to MIDI conversion is a complex task.... Unless you really want to dive in this +50yo research area to come up with your own algorithm, but just need the conversion to be done, maybe a better option would be to use dedicated software.

Ableton Live has a handy "convert melody/harmony to MIDI track" feature that does a decent job.

Otherwise Melodyne has been a reference for this kind of job too.

If your end-goal is not the MIDI itself but some kind of score following, there are other options too like IRCAM's antescofo https://antescofo-doc.ircam.fr/UserGuide/intro/