Recording audio and converting it into MIDI within MAX/MSP

Noodles's icon

Hi everyone, Im building a patch and I want to record audio using my guitar and convert it into MIDI using Max. Is there any object for doing that?

I also don't know which object I can use to record sounds into MAX.

I've downloaded a few objects like sigmund, bonk~ and fiddle~ but Im really lost here guys.

Any help from anyone would be much appreciated.

Cheers

pboes's icon

Hey, for recording into max have a look at the MSP tutorials. There are vast possibilities of doing that. If you don´t have time for that, simply take a look at the buffer-object and its helpfile.

To convert the sound of my guitar into MIDI I use the sigmund-object, but I´m told that fiddle works great with guitar. Basically take the pitch estimate of whatever object, make sure that not all of it is converted (since the object obviously doesn´t know whether the input is an intended note of fret noises etc you will have a lot of funny estimates. One way of doing that might be to have a gate that depends on amplitude of the incoming signal or only positive estimates or whatever...), turn the estimate into an integer (you could think of using decimals to turn them into bending information to translate bending effects into MIDI as well!) and turn that into a MIDI note (i.e. apply velocity values in whatever way you like,e.g. with makenote, by turning amplitude into MIDI values through the same procedure)

Noodles's icon

Thanks a lot mate, really helpfull! Ill check it today!

:)

Pedro Santos's icon

Check also the external [analyzer~]. It gives you frequency, pitch (MIDI scale), but also attack triggers, spectral decomposition (bark scale), noisiness and loudness in a single object.

Noodles's icon

Cheers guys!

All these objects seems to work on my patch, but not on the way how I wanted, I was expecting an object able to recognise the chords coming from my guitar, but these ones seems able to detect only the fundamental note of a real time audio input and doesn't do it in a very stable way, it is just too sensible to any frequency coming in and decays too fast as well.

I can't complain, anyway.

thouldcroft's icon

Polyphonic pitch detection is tough (I'm far from any expert, so I can't really dive into any details as to why, with any sort of authority). There are some objects which attempt to perform polyphonic pitch detection, analyzer~ supposedly can report polyphonic pitches, but I wouldn't be shocked if it's not too reliable (again, it's not an easy task, though Tristan Jehan's objects are overall very reliable, as is most of the other functions of analyzer~, haven't used the polyphonic pitch detection much).

What would make the most sense to me is to pick up one of the few guitar pick ups out there with dedicated channels for each string, and which have dedicated interfaces that appear as 6 channel audio streams on your computer. Then you can just use analyzer~ on each stream, and from there you will have the pitch of each string, and then determine the chord via these pitches. However, this is easier said than done, mostly because these pick ups are not cheap; I think the cheapest runs around $300, which is why I do not currently have one.

Miller Puckette did a lecture at NYU last year in which he used one of those pick ups, and then through a new analysis/re-synthesis algorithm he had been working on, was able to drive synths and do awesome things via the guitar into Pd, and the amazing thing was how natural it all sounded. Much more natural than converting the pitch to MIDI and then having the MIDI drive the synthesizers. However, I realize this is getting slightly off topic! However, the lecture proved (among many other things) the abilities of those 6-channel pick ups.

Noodles's icon

That's really cool mate, I realise that is a really challenging task to do.

Another thing that is though for me it's because Im using a classical guitar, which have a really quick decay, Do you think that I will be able to synthesise my classical guitar properly using only one of these pick ups attached to it and to a max object like this analysis/re-synthesis algorithm you described or I will have to put my guitar into some sort of pedalboard.

This topic is getting cool