Audio 2 Midi

mfreakz's picture

Hi, Now, with the new KinemeAudio Plugins, making an audio to midi convertion patch seems do-able... It could be great to trig any midi note with the frequency structure output !

  • Could it be do-able to whistle in a microphone and hear notes from a midi instrument ?

  • I'm trying to analyse and sort the "strongest" frequency value in the all provided range, with an iterator patch, but i'm not comfortable with that kind off patch... Any ideas ?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

dust's picture
Re: Audio 2 Midi

here is a simple audio 2 midi javascript patch.

PreviewAttachmentSize
audio2midi.qtz3.04 KB

cybero's picture
Re: Audio 2 Midi

Somedays, the day just laughs in your face.

Although the example uploaded works in isolation and without midi turned on, as soon as I turn midi device on and open your example QC has a crash, the report for which has already been submitted.

Now I am going to look afresh at my own setup, but, in fact, although I am only just beginning to learn Midi my other .qtz midi projects work AOK, thus far and they linch pin with GarageBand.

I am running AudioTools beta.

That could be a contributory factor, once I've had my afternoon stroll and obligatory coffee and cake, I'll give your example a spin on my Production/Public releases only setup and see if that makes a bit of difference. [probably will].

Just tried some of the examples that had been working and now they are crashing QC too - just checked my Audio Midi setup and that looks like it needs to be configured afresh.

Will update later , but looks like this is mostly my midi setup's problem.

cwright's picture
Re: Audio 2 Midi

There have been some crashing bugs with the latest MIDITools patches -- I don't have the necessary equipment to track the problem down, unfortunately, but smokris probably does.

Sorry about that :/

cybero's picture
Re: Audio 2 Midi

dust, having gone to the lengths of trying this on my non Audio Tools beta setup [production], and given that the composition has been worked, sans active midi interface with Audio Tools beta, I wonder if you've actually managed to utilise this within the beta plugin environment it requires whilst your midi setup is active, I only ask, because it certainly dummies up well when the midi is off, but just precipitates a breakdown otherwise.

I wonder what, if any, are the key hardware and / or software differences, as I can well believe that someone else might be more fortunate hard/soft configuration wise and it can often happen that what works on one rig is snafu for one or another thing lacking in another setup's hard/soft mix.

williamcotton's picture
Re: Audio 2 Midi

AFAIK, Quartz Composer doesn't have a pitch tracking patch (yet). If you're desparate or just want to fool around, PureData has a FFT driven pitch tracker... you could communicate with QC using OSC or MIDI. And of course, Max/MSP is an option as well, but it comes with quite a price tag...

Chris, if you're listening... how great would a pitch tracking addition to the Audio I/O be? :)

cwright's picture
Re: Audio 2 Midi

AudioTools 0.8 has pretty high-resolution frequency output (though it's currently wrong -- working on fixing that in a future release -- it only reports the bottom half of the frequency range, so up to about 11khz).

If you can think up a usable interface for pitch tracking, I'm all ears. Sadly, the majority of "cool patch ideas" lately don't lend themselves to QC's noodle paradigm very well (skeletal animation, inverse kinematics, a few other things we're investigating), so that's the hang up. What good is a patch if no one's able to actually use it? :)

dust's picture
Re: Audio 2 Midi

yes there is a max external i like called "fiddle" that will do more pitch tracking if that is what you need. i guess if you are having troubles with the kineme midi try using osculator which is what i use to virtualize a midi card from QC.

the simple logic script is really just triggering a midi note in this example, but this can be modified to trigger the full spectrum not the peak which i am using for just the trigger. once you can here a midi not playing then parse out the spectrum and use them to trigger different notes and or velocity.

dust's picture
Re: Audio 2 Midi

i catch kinemes global midi in OSCulator and then route virtualize the midi for daw or developer application AU lab is what i usually use when testing core audio units but garage band does the same thing you just don't have a selection for midi devices but you can load audio units or core apple audio units as well. to run them in AU lab they are located in /Library/Audio/Plugins/Components. i can upload my OSCualtor file if you have that program.

gtoledo3's picture
Re: Audio 2 Midi

I've thought about that one a bit, UI wise...

The basic would be a simple monophonic pitch detection provider patch. For sake of argument, middle C would deliver a 0. A half step up would deliver a 1, a half step down would deliver a minus 1, and so on. So, a D above middle C would deliver a 2, while a C# would deliver a 1. A Bb note would be -2, etc.

To jazz it up, the reference note could be chosen. So, a user could select A as the reference note, causing a Bb to now be a 1.

If you can do that, then you can potentially define amount of speed change over time duration x. That can possibly allow for interesting fluctuations in a composition, or patch time, based speeding up or slowing down the motor on an analog sound playback device if the device has media that's printed with a test tone. So, it's not just a proposition of whistlin' dixie.