audio to midi realtime patch - possible & feasible with m4l?

Questions and discussion about building and using Max for Live devices
luzil
Posts: 83
Joined: Thu Jul 16, 2009 3:19 am

audio to midi realtime patch - possible & feasible with m4l?

Post by luzil » Sat Dec 18, 2010 4:35 pm

Im thinking about a plugin converting realtime audio (e.g. from a mic) to realtime midi data. Im beginner and until now not really impressed by m4l realtime performance, some patches i tested dont run very smoothly and i dont see many realtime audio fx with m4l at all. Seems its not the best tool for this even if u use externals. Whats ur thougts on this?

Another question is where is a audio to midi patch placed in Live as u cannot insert a midi patch on an audio trace where the mic signals comes in? Probably im overlooking here something but i want this possible hurdle confirmed solvable before i start developing this type of patch. Also u cant route midi from an audio trace to a midi trace with e.g. a synth.

Probably i have to build something like Live vocoder device, which has in it an option to refer audio from another trace when u want to make a "singing synth". Do i have access over the LiveAPI to midi/audio communication with other traces in Live. Maybe thats the solution, but i didnt dig too far into LiveAPI now. Came in to my mind while writing this. So any hints welcome.

I hope there a solutions as i want really to get this running :D


thx

Pasha
Posts: 3238
Joined: Tue Dec 27, 2005 12:45 pm
Location: Lost Island
Contact:

Re: audio to midi realtime patch - possible & feasible with m4l?

Post by Pasha » Sun Dec 19, 2010 5:54 pm

luzil wrote:Im thinking about a plugin converting realtime audio (e.g. from a mic) to realtime midi data. Im beginner and until now not really impressed by m4l realtime performance, some patches i tested dont run very smoothly and i dont see many realtime audio fx with m4l at all. Seems its not the best tool for this even if u use externals. Whats ur thougts on this?

Another question is where is a audio to midi patch placed in Live as u cannot insert a midi patch on an audio trace where the mic signals comes in? Probably im overlooking here something but i want this possible hurdle confirmed solvable before i start developing this type of patch. Also u cant route midi from an audio trace to a midi trace with e.g. a synth.

Probably i have to build something like Live vocoder device, which has in it an option to refer audio from another trace when u want to make a "singing synth". Do i have access over the LiveAPI to midi/audio communication with other traces in Live. Maybe thats the solution, but i didnt dig too far into LiveAPI now. Came in to my mind while writing this. So any hints welcome.

I hope there a solutions as i want really to get this running :D


thx
I was doing something similar. Same problems. To bridge Audio track with MIDI track you can use send / receive objects. I was successful in building an Audio to MIDI converter using an external MSP patch named sigmund.
However I'm not satisfied with tracking and latency. I really think MSP is slow on audio realtime performance because I got the same impression that you had. Even the pitch delay you can find in the examples is slow, actually slower than the Octaver in GR4. It performs a double Fourier transform (L+R) so I guess that takes time. I can't say for other things. I have built an imitation of old BOSS SG-1 pedal to have guitar attacks removed, volume pedal like. It works after some hours of dedicated work and it seems it has no latency. I guess it's because it applies a volume envelope so nothing hard calculation wise. Pls take my words with a grain of salt because I'm a M4L noobie.

- My 2 Cents
- Pasha
Apple Desktop / Laptop
Live 9 Suite,Zebra 2.6,Guitar, Bass, VG99, JV1010 and some controllers
______________________________________
Music : http://alonetone.com/pasha

luzil
Posts: 83
Joined: Thu Jul 16, 2009 3:19 am

Re: audio to midi realtime patch - possible & feasible with m4l?

Post by luzil » Sun Dec 19, 2010 9:54 pm

Pasha wrote: I was doing something similar. Same problems. To bridge Audio track with MIDI track you can use send / receive objects. I was successful in building an Audio to MIDI converter using an external MSP patch named sigmund.
However I'm not satisfied with tracking and latency. I really think MSP is slow on audio realtime performance because I got the same impression that you had. Even the pitch delay you can find in the examples is slow, actually slower than the Octaver in GR4. It performs a double Fourier transform (L+R) so I guess that takes time. I can't say for other things. I have built an imitation of old BOSS SG-1 pedal to have guitar attacks removed, volume pedal like. It works after some hours of dedicated work and it seems it has no latency. I guess it's because it applies a volume envelope so nothing hard calculation wise. Pls take my words with a grain of salt because I'm a M4L noobie.
Thx for ur advice. There is a m4l patch doin audio to midi

http://www.maxforlive.com/library/device.php?id=97

uses the external fiddle~ to analyze the audio, only available currently for MAC, im on WIN.

Im glad its basically possible. I knew that max is not perfect for realtime audio performance before purchasing. But I thought u should come close to smooth running of realtime patches if u write externals in C/Java. I mean other modular audio software like Synthedit or NI Reaktor show alot of realtime audio fx with accepatle/good latency. Or is here really a performance difference to MAX? Principally i cant think of it, as architecture is pretty equal

For the special case of audio to midi where a input signal is ROUGHLY converted into a few MIDI output signal values i think/thought this cant be a big hurdle. U dont need overexact and full FFT transformation of the audiosignal compared to fx like reverb/filter. So probably the solution is to write a less exact fft external doing the transformation from audio to midi rather than slow max fft objects? Maybe u get better realtime performance with ur patch rather using the fiddle, analyzer or pitch external of the database. Normally u can choose the windowsize of a fft transformation resulting in differnt fast and exact tranformation. The fft~ object doesnt offer a option here. So for audio to midi defining the window size urself in an fft external should be the best option for realtime use?

Any thoughts & tips on this welcome

bulo
Posts: 434
Joined: Sat Sep 09, 2006 7:57 pm
Location: France
Contact:

Re: audio to midi realtime patch - possible & feasible with m4l?

Post by bulo » Mon Dec 20, 2010 12:49 am

Hello.
I've made an audio to midi patch here:
http://www.maxforlive.com/library/device.php?id=256
It's also using mac externals, but maybe there's a windows verion of the sigmund~ external?
You place it an an audio track, and the synth is load into this patch (using the audiounit~ (mac only) external, and the vst~ one (max/msp object).
Thanks to Leighhunt, you can now use midi in audio track patches easily with his externals:
http://forum.ableton.com/viewtopic.php? ... lit=midiin

I'm tired, and don't want to talk too much; but anyway my patch is not terrific at all, I've never took more time to improve it. The latency can be acceptable, the tracking is ok and it's monophonic. It's not great and I personnaly don't use it very much for the moment, but I'm sure it can be improve a lot with some time and expertise.


Pasha: I'd be glad to test your SG-1 simulation. I've rapidly tried to make one, but didn't sucess.
My tongue spits english like a frog and my head is currently searching for a comprehensive language.
And I shit here

Pasha
Posts: 3238
Joined: Tue Dec 27, 2005 12:45 pm
Location: Lost Island
Contact:

Re: audio to midi realtime patch - possible & feasible with m4l?

Post by Pasha » Mon Dec 20, 2010 6:43 am

^^^
Here is the SG-1 (work in progress).
Still do not know how to link a live dial to the ramp time in the line
object. For now is static at 4000 ms.
I have to solve what happens when the gate is not closed and you
strike a chord. (little audio clicks).
I have got a strategy but do not know how to implement it.

- Best
- Pasha

<pre><code>
----------begin_max5_patcher----------
1599.3oc6Z0ziaaCD8r8uBBidpvYA+RRV4PARAJBBPQOjlaKBVHaQayVYICI
4MaZvt+1KEIkr7ZJs5CZmsE4h7RIQty73Lu4M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.6,Guitar, Bass, VG99, JV1010 and some controllers
______________________________________
Music : http://alonetone.com/pasha

Pasha
Posts: 3238
Joined: Tue Dec 27, 2005 12:45 pm
Location: Lost Island
Contact:

Re: audio to midi realtime patch - possible & feasible with m4l?

Post by Pasha » Mon Dec 20, 2010 6:48 am

Regarding Audio to MIDI, here's my patch (which sure experts can turn into a better one)
It's made of two patches : one should be put in the MIDI Track the other in the Audio Track.
I'm a noobie so do not expect perfection out of this...

For the MIDI Track:

<pre><code>
----------begin_max5_patcher----------
984.3oc2Xt0SaCCEG+41OEd8oMoNjujq6MlXHgzFvC7FBMkl5BdjFWk3Brg3
697kjRJ0sMoMoLMgjqric3b90y4+439b+dCFwehlO.7Ev0fd8dteud5kTKzq
XduASidJNIJWusAozG4i90fglGInOIzKmQiorGnfyu3pucwomV9b1X8Skm3y
nfxESmOkklPE5WHrXwI7TQZzTpd+GmwhR.ekmLtxY3yEkGBUrpYIwumQMtvf
Afap79xY+Q+.D7nx+MyhDw2wRu8mRCVXNDgfjOFfCUigdpQTvQPvMpS7R+9p
gg0jNw7oSoohUvywyGy3fTtfB3SlT93YYzb4tiDLdZU2pJ07sRMztPM3VPSE
qoBdvDMXPHMkPtvWAz5YpafiZatgqblVDpmSeDbtBoxMPyArTPC.av6MWcca
NVQHhdaDXav0QyEBIepOyb1HypYJ5nnzaeMMccAcHbE5fgkiaBNdX8YBbe6Q
1AzHimxitktRHGzlvlqUrfe+E1b0IgXjVSifOxURTuCUvh6gKXoHSBV+XEjm
FMHOTKDrbedBaLMqArgrwHlkYCdcrgojDMerUBo8Vm.cb.QGN3R1LgvAFgI7
pGpEkvuLJkE+AvGuTZ24.AGjK3yz0Iy+TSpR58tqlaBjvMQL2WeDWu2EsbD9
.mehafTdwtLwd6Y14VZX8GmcxYmb7UGaSX24ezNVQgl1.zbMzcuBbVCdlmNK
J9d.z7mM3PZuTNmZHwMztfWSflFTlzM+vt.ZSRlmemMVgZuNDZT4f5SGbfIW
yUqfQb5B7nj0klsM.AsBHRWneaw28MMHY5SxwuStrxIzGXwTvCzLAKV5.Iro
LanHrgoU6DDtiMdLcoJCVvhofju4CTPmPEk5qpr+2kRwVfwNc4WvYhnDV7lA
ixBh4I7rRekLTM3nFkCnJ0mVhgnELbR1si19gs0Vtofu4Wcv2njG1EbcRFe5
5Hq2+kjsHVUeMvf8BrqQBaJaLytDF9v0A5pNtoydj4Ry6o.1F7bVpMs61ywQ
ap11NTTq3BOFpXu+Z8acPBK8s+Jn5WmZ8kQUNedVboYU1GD.sv3FSyErzEMd
e8qM.TYSuJ+VZ7R5NiK8xBi.Kuvl7x5XGhovDdwr07UZirVXcrVXCrVXUqEG
52pV61XKYmPKBpiJ7f9KlcHPKYmHagwhCgslw5Tm3fFZssA.wawlbaH.cL.r
PSTVssb19Zr0fe3CK9vcPp89ZS0ASpl+Oz1DpN1D5fYSNcvWcdxFLU5vPTUU
YHZ+C8Cpg05zLik3nk1BzUP7LW1X4IZunvmB1emvsqSVjSdo+eAJyMrC
-----------end_max5_patcher-----------
</code></pre>

For the Audio Track:

MaxFreq is an internal Sigmund Parameter which cuts higher and unwanted
frequencies. Is a low pass filter.

<pre><code>
----------begin_max5_patcher----------
1938.3oc6a01aaaCD9yI+JHL5mFRCDIEkkF1FRF5KH.so.cA6KEEExVz1bUl
zSl1IcEs+1GEIkibBksjsrRZPQ.jCoHou6gGu6gGo+5wG0af3F57dfeE7AvQ
G80iO5HcU4Ubjs7Q8lFeyvz345l0iSuVL3e5ch4UR5MRc0CmDyGSKplknqT0
vmigEUxWLkwSoR83.sUNRvk73oTc6OOiEmB9SQZRo9HVHK5D1VqoJ4WlQMRd
udm.5w3xhO.erznOm8e5lA8N0yV8rX4vIL93OkQGJMCADgUuFPf94e3Gj+DF
dpG3i4c4aGeb9iS1OLZNkm.t7cW8x28pW4Bo7ZOjxqw..BSz..JuUfP+8B.F
JlNklOebGD3pIYz4SJI0yTkUMLVxD7xJaIXAg6NXojzTFZfQZnQCIDuaQlMX
NQP4MC026dc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zAa39ivAFgMvPmjbaoNHNA9QWbhNVhNzfjpv2
N9+AsSJab
-----------end_max5_patcher-----------
</code></pre>

Enjoy!

- Best
- Pasha
Apple Desktop / Laptop
Live 9 Suite,Zebra 2.6,Guitar, Bass, VG99, JV1010 and some controllers
______________________________________
Music : http://alonetone.com/pasha

luzil
Posts: 83
Joined: Thu Jul 16, 2009 3:19 am

Re: audio to midi realtime patch - possible & feasible with m4l?

Post by luzil » Mon Dec 20, 2010 1:05 pm

big thx for ur code examples pasha! Will study them. Also found ur post on the cycling m4l forum. There some other interesting posts optimizing tracking and latency with externals and FFT window size. As im not on mac i first have to write a win C or Java External similar to fiddle. Then i can go on with the m4l device. A little bit strange that after all this years of MAX there is no similar version of analyzer fiddle pitch externals for windows available. Pretty basic externals from my view. Seems really the most MAX owner are on MAC?!

Also one Problem with ur plugin i conclude from my readings in cycling forums might be, that u use 2 devices to achieve the audio to midi. So the calculation for both m4l devices run in different cpu threads, one has to wait for the ohter, and that cuases probably the latency. Dont know exactly if it is possible with the weird routing from midi data from audio track to midi track in LIVE if there are ways possible just to use one m4l patch doin all the audio to midi.

Many questions - exciting holidays - Merry Xmas :D

Pasha
Posts: 3238
Joined: Tue Dec 27, 2005 12:45 pm
Location: Lost Island
Contact:

Re: audio to midi realtime patch - possible & feasible with m4l?

Post by Pasha » Mon Dec 20, 2010 1:31 pm

luzil wrote:big thx for ur code examples pasha! Will study them. Also found ur post on the cycling m4l forum. There some other interesting posts optimizing tracking and latency with externals and FFT window size. As im not on mac i first have to write a win C or Java External similar to fiddle. Then i can go on with the m4l device. A little bit strange that after all this years of MAX there is no similar version of analyzer fiddle pitch externals for windows available. Pretty basic externals from my view. Seems really the most MAX owner are on MAC?!

Also one Problem with ur plugin i conclude from my readings in cycling forums might be, that u use 2 devices to achieve the audio to midi. So the calculation for both m4l devices run in different cpu threads, one has to wait for the ohter, and that cuases probably the latency. Dont know exactly if it is possible with the weird routing from midi data from audio track to midi track in LIVE if there are ways possible just to use one m4l patch doin all the audio to midi.

Many questions - exciting holidays - Merry Xmas :D
From your discussion topics I guess you're an IT professional! Threads, CPU waiting, C/Java... Welcome! I'm an IT professional too (less skilled I would say..). However the audio to MIDI Patch had to be done that way because Live does not permit a MIDI track input to come from an Audio Track. If you go to the other way route (1 single patch) you'll find that you have to build a VST or AU host into your Audio Patch. I have tested that and latency was even higher than mine. Give it a try if you have time. The main problem for me was not getting the conversion done (SIGMUND does it all for me and it's considered better than FIDDLE) but sending Note Off at the right time. This patch is version II, I have thinned a lot the communication between the patches by using pack/unpack when it was possible. This way latency went down. In the balance between tracking and latency I'd say that I miss more the tracking than the latency. However I'm no fast fourier transformation expert so I still have to decode some of sigmund parameter to a better underatanding.

Merry Xmas!
Apple Desktop / Laptop
Live 9 Suite,Zebra 2.6,Guitar, Bass, VG99, JV1010 and some controllers
______________________________________
Music : http://alonetone.com/pasha

pid
Posts: 354
Joined: Thu Nov 05, 2009 9:51 am

Re: audio to midi realtime patch - possible & feasible with m4l?

Post by pid » Mon Dec 20, 2010 2:46 pm

luzil wrote:A little bit strange that after all this years of MAX there is no similar version of analyzer fiddle pitch externals for windows available.
hmmm. fiddle~ has been available for both windows and mac for years. the slightly better improvement on fiddle~, called 'pitch~', has always been available for both platforms since about 2001 i think. see CNMAT. 'sigmund~', even better, newer, although slight differences, is officially mac only (for max, all os's for pd) - it is only at version 0.5 - but some people on the cycling forums recently managed to port it to windows, so search there.
luzil wrote:As im not on mac i first have to write a win C or Java External similar to fiddle. Then i can go on with the m4l device.
well, if you are an amazing enough programmer to just 'whip these up' as you imply, my hat off to you. it is pretty much an incredibly complex thing to achieve. what would not be as complex, although i expect a pain which is why they have not done it yet, would be for ableton to implement a track which could receive and send any type of data simultaneously. then, the only delays inherent in sigmund~ type work would be the fft size, and not this crazy huge unpredictable latency that we have at the moment.

of course ones use of these amazing externals such as fiddle~ and pitch~ and sigmund~ still best used for the right situations. in max vanilla you can do a hell of a lot with averaging and envelope following etc for a lot of coding scenarios.

good luck
3dot... wrote: in short.. we live in disappointing times..

Pasha
Posts: 3238
Joined: Tue Dec 27, 2005 12:45 pm
Location: Lost Island
Contact:

Re: audio to midi realtime patch - possible & feasible with m4l?

Post by Pasha » Tue Dec 21, 2010 10:09 am

Around this topic, is the usage of MSP leading to higher latency every time?
It seems that every time I do something with MSP the result is latency.
Even new patches in MaxforLive like this sport this behavior.
(I know FFT takes time but we're running very powerful computers these days)
My aim at M4L is mainly audio (that's the hardest..) but I'm being discouraged
by additional latency. Even a simple Octaver lags behind.
Is maybe setup related?

- Best
- Pasha
Apple Desktop / Laptop
Live 9 Suite,Zebra 2.6,Guitar, Bass, VG99, JV1010 and some controllers
______________________________________
Music : http://alonetone.com/pasha

broc
Posts: 1148
Joined: Mon Jul 26, 2004 8:37 am

Re: audio to midi realtime patch - possible & feasible with m4l?

Post by broc » Tue Dec 21, 2010 10:53 am

In my experience, each M4L device in an effect chain (audio or midi) introduces latency proportional to the audio buffer size.
So this can be minimized by choosing a small buffer size in Live's audio preferences.

Pasha
Posts: 3238
Joined: Tue Dec 27, 2005 12:45 pm
Location: Lost Island
Contact:

Re: audio to midi realtime patch - possible & feasible with m4l?

Post by Pasha » Tue Dec 21, 2010 1:14 pm

broc wrote:In my experience, each M4L device in an effect chain (audio or midi) introduces latency proportional to the audio buffer size.
So this can be minimized by choosing a small buffer size in Live's audio preferences.
Good to know, thank you. I'll try that.
Apple Desktop / Laptop
Live 9 Suite,Zebra 2.6,Guitar, Bass, VG99, JV1010 and some controllers
______________________________________
Music : http://alonetone.com/pasha

pid
Posts: 354
Joined: Thu Nov 05, 2009 9:51 am

Re: audio to midi realtime patch - possible & feasible with m4l?

Post by pid » Tue Dec 21, 2010 3:14 pm

Pasha wrote:(I know FFT takes time but we're running very powerful computers these days)
remember, fft taking time is to do with the laws of physics, not m4l/live/computer, and it is pretty hard playing god with quantum whatnots. of course your computer has to be fast enough to deal with it, but if you bought it any time after about 1992 it most probably is

broc's suggestion is the way to go. remember though, buffer size will have huge effects on the sound quality and speed of code involving audio-rate sampling and fft and the like. experimentation with the trade off of speed / other things is key.

DSP optimisation is a skill, learnt over time. with a paradigm like max/msp, which allows you such low level access, this takes time + time. m4l being quasi beta-like to date does not help either.

also remember, in max standalone we can change the overdrive / scheduler in interupt / etc at will. in m4l it is fixed to live's needed settings (which i believe is both always on).

as ever, good luck.
3dot... wrote: in short.. we live in disappointing times..

stringtapper
Posts: 6273
Joined: Sat Aug 28, 2004 6:21 pm

Re: audio to midi realtime patch - possible & feasible with m4l?

Post by stringtapper » Tue Dec 21, 2010 3:37 pm

luzil wrote:Seems really the most MAX owner are on MAC?!
Max was originally made in the early 1980s for Mac (commercially since 1990). Windows support didn't come until something like 2003.
Unsound Designer

stefan-tiedje
Posts: 219
Joined: Thu Sep 17, 2009 3:50 pm
Location: Berlin

Re: audio to midi realtime patch - possible & feasible with m4l?

Post by stefan-tiedje » Tue Dec 21, 2010 5:14 pm

Pasha wrote:For now is static at 4000 ms.
This should make it non static (quick and dirty)

<pre><code>
----------begin_max5_patcher----------
1696.3oc6ZszaaiCD9ryuBAebQR.enGV6gEnKvhfBrXOjsXuDDDnXwXysxRF
RxooaQyu8kjCksrsDsjnpQaQ5g5L5EG9wY9lugRe4hISeL6EVwTme04NmIS9
xESlnNj7.Sz1SltJ5k4IQEpKaZB+Y10oaVIupKgy+bTdZzJVamVXwSSXkp6G
u6fYaJqNJQeTdr5gj83+dEgTc+qiJmujmt3gb17RvU8C8tFcoCYlq7GOkAV7
+N2u8dxEdTIK+AVZziIr5CMLtkedMCdXSmdoyzmRxhDO7p6uH5YV7CQkk47G
2Tx18WEZnQiMxIexFV1SUGt530cgUYwBHT4Bj.gqd7Ujjktv.DdzSimJuRTy
OKd5GkOKkmhZ4AjEyZ6z7zmxT9QSC9lTNrh03YyxiY4s8biYO09IKVyXwI7U
JPpwoUQIacQ697y7BtdctoKf8x5rTVZY6O+nzzrxnRdV5CaWIZEAJ+b6C0pp
0Zj3eW27UXZ8qJvr44IujGkTKntQnZYVd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YRrpupDiG4GXPpzA6frSHKFc5WuLYlNfxtWu7IUlfGSrQtutVF9XphkWHE
1FRspkQL9Yz042V8qW6UufMvAahDRqqW2Jn8Uu5QVk5ZTA.G7gbobS4w2GrJ
x1jOuZbz0Vb14owrhRd51ZE2sq1csKZIONlkVuCnU730Yhf8hpFczoOtPUce
U4PoUKUW5pyJI4D7.l81v94rXjpZMFuUuJRaYoyJkGeZnsmdqFLoHn4QQWfU
VV5sRMqmzaOXJ0Uuk3Mqdf.HO4aO1RFHzpX6Hfxh8sbw5pCPWrRKKmHx2.e2
fcb2mI1lkQ5Rfq+Y0mj0tOYlOseK39AHXAWk46iHasFCmsS.H57Af9cvm5K.
5BzOvaqrB.csO8NrKjQGfxcH+V0hDU+dVfufv8sH9Pn.LuTVmCZULcXzp9vl
G.M+nrrkVc7iQbm8MJFoKRA5YJF0EhPfn.Wsd28sPvqLSOqfl6sddbJLOrmf
Nk.ajB7QgRb0522yR2hiNov0ydVutHkzquQ5.NqkVi8pKztxBTeqmxzQPJTG
lGt8q5WUbO786gg2S1AVv7HLbqgkSitnrfzy4wL0t4p+tTvH2sVmKeEMPeEJ
0OFtJwqigG8oPJrWvvGZD32JiyQ6RtCpcoQ2WOnGyVp8LvBkzf58ePCNKj1A
Ciy1K.nyB2ZcN3kCrhWFZRZeKcuR5Ixw8JIL95E+Os1c6+C
-----------end_max5_patcher-----------
</code></pre>
Les Ondes Mémorielles-----x---
--____-----------|----------|----
--(_|_ ----|\-----|-----()--------
-- _|_)----|-----()---------------
----------()----------TJ Shredder
http://tjshredder.wordpress.com/

Post Reply