audio to midi for metering – how to translate the audio signal?
i just came up with the idea to use the volume of the track to create a midi driven meter. for the last couple of hours i tried to translate a audio signal into a midi signal without any usefull success.
at the end i would like to have a midi signal with a range between 0 and 127 like the CC events. this should give me the possibility to connect to a meter or a slider to have a visualisation.
it would be great if somebody could show me how to translate the signals.
----------begin_max5_patcher---------- 1006.3ocyW0zaaiCD8r8uhI91B3XHRIYKkaoYaQKPQaQQ2CK1Vrf1hwl6JQZ HQEmzht+1WxgRNxIwpV1NF4hD4HxQy6w4K9i98FLUcKuX.bA7WPud+neudnH qfdUy6MHic6rTVAtrAyTYYbodvP22z7a0n7qbxu3qxuJ+xBNjxuVCYbMOGDE .KcE6tBXlRxmo4IfVAZyhz4LYQJyJoPLWxRGhhyEyWzXyObWrxDgpZCir+ur 6LxUkyW.qXE3pp0Kt9joVYLIvxVlJzkI7pMCqD5E.CtgkVxgob8JNWBd1kR. UNbNwLLAHiLpwHSXz6cNynXFK0pbi041rQlGbNPnSrCmy0Pgx.fEB4bHU7u1 0BWcEvuwvQEnVQU5fFHznE5fLBoW8GeAdG7lKe26e8ue1YmAW7aHw91ag27w OCW9g+Dd6qe+mf5igTgQOpRIdVPnURuVI0RVFGOftLWXP7qToI0aRVlIjobM dvRtWnpTWK0qglJDeG0DwaTsXQBpZ0z+47w0ZcISOyB6+N2fLmmUH0tEfL19 zO.eQBBF4Aeytme1uu8wvczCLUbCeDxT+WGPRsTmH8cK4NayntBiY9spOWjJ R34yTopb22MVdXPrGc3lilDE3SLnvhgZfmyKLmtLsPIa.93f6wtW0i06oAAF zBARBoH0gOCQ8Qi2S563wbWmpXMntsf+fvcC+9MLoTdB9qodamSlzfRHzFbR spkFbZBNcQDS1ClRxWYLrGkoaYZ4bCWrlB6RTF8IYXZ6QYOh3cYuFLb8nmhO os3O4NSBBmf9S9H4Esm9SsvRB4KcRhzFIEi7hK9sJoUzKsftlAPdcLBJH54N B5kZp5lgIs4BP7GeDy6VTvlyeTfBYzwKFgzwXjm1OpUFIFyV3Gg9NgqqqeTo DuWZTBMtEJgR8cYHH1WQzChR1R1TW+ldir8hZ6wzaeHnwOiDzj1HnHWTj6k4 Y3gTtoLaZizIYpD9CqNzUGFS8ArW20X9XU3Y64po9sEiMwkXNzEiM94n7bxT shsWUmIGEun1pIGuCbimqpbvSxMnVw6D8fq1hJzJeSBqPUlOq1xpcmg6KWjv KzBI1XayEYrSy8DqWzBQRBW17RSYhjkJSQzJiXKGe6rM4uwuaK1zlF9uzlnz .azn+DzIiFGtd1gZs6BCZ6XoSVqy9B7PqMHBaPayYD7YXP83SALrsPb.vv4D u4LpqYC+H6BsSNPbP1AXDzMTD5rMWwOpqEoMm46NEBctXAmDP3uOfnJoBg3t IzFyn3cjbhriOBX3WFDeRyqrKrJsar5IvhrEINglzNk70mzsCt5juQDLRx2e 8rCk.i2kyT+CfAMS9Y++GT70NoA -----------end_max5_patcher-----------
I spotted a bug in your scale device; it uses "min input, max input" optionally followed by "min output, max output" but you have those two values reversed. So 127 0 instead of 0 127.
But I also don’t quite get the problem. If you have a value range of -1. to 1. (floats) you could easily use a live.meter and then configure its display range. That should do the trick afaik.
Nice thought. Does that fix the design? Not for sure you’ve the audio range you’re wanting, you could want a control to adjust that inside MAX. Then, the output of your SCALE could then connect to a MIDIFORMAT object; the .maxhelp for that shows how to create the controller messages and send them to MIDI very clearly.
the value range between -1. to 1. would be also ok, but i cant get a proper displayed metering. i can send you a patch where i tried this but it does´nt works. thats the reason why i´m think that my mistake is the translation of the audio signal from the plugin object into something (i´m not shure if its an amplitude?) between -1. to 1. or a CC event rang from 0 to 127.
i changed the values but it doesn´t fix the problem. if i change the values the meter show full peak all the time, even if no music is playing.
sorry but i didn´t get your comment. sorry i´m not really experienced in m4l so please be gentle with me. :D what do you mean with this : "Not for sure you’ve the audio range you’re wanting, you could want a control to adjust that inside MAX. " ? and what do you mean with .maxhelp ? is this the help if i do a right click on the object or do you mean the help pages and tutorials from the menu? anyway i will have a look for both. :)
Yes of course. It’s difficult to know from over here, and knowing alot of differnt things could be happening in Ableton too, what is a problem in the Ableton environment, and what is a problem in the MAX environment. What I’d suggest is adding a simple test tone source inside MAX, with a toggle to select it instead of the Ableton source, for example, a phasor~ at frequency 440Hz and ampolitude 0.5, going into a gate~ with a toggle control to select it or Ableton audio as an input. That helps find the problem. Then, when it displays what you want inside MAX, you do get to the point of adding a MIDI controller output as well as metering.
Right, 2nd synth evening this week (due to the heat I’m shortening my sessions ;-)) and I just tested your patch above. I don’t quite understand the problem anymore because everything works as it should.
If you fix the scale object and then check your message boxes you’ll see that its working as it should; it generates a value between 0 and 127.
Your problem with the meters is simply that you fed it a range from 0 to 127 while the meters react to a range of 0. – 1. So obviously putting 127 into it is getting them over the top so to speak. You can easily test this yourself. Disconnect the left live.meter, add a message box and connect it. Put 0.5 into the message box and click it; you’ll see the meter react. Now put 50 into that message box, click it and you’ll see the meter go into the red.
Then, when you get to adding the MIDI cdontroller output, you’ll probably want a way to set up the external thing you’re controlling with MIDI without changing the audio track source, For that, adding say, a slider to control the phasor~ output gain helps you see the results.
Currently you’re converting ‘db to a’ and then adjusting the range linearly. You could also adjust the level response non-linearly, for example, by scaling the input before the dbtoa module, instead of after it. Sometimes dB level is a better control source, and sometimes gain is a better control sourcd.
Also, you could find the MIDI controller values change too quickly or too slowly, but that’s something to fix *after* you have at least some MIDI controller output :)
Err….Was that too much all at once?
no no :)… but i found a way to fix the design of my patch. should be workin like a charm in a bit. i will come back later and show you the results. my way seems to be another way than yours ernest but it looks like it heads in the right direction.
anyway, thx for your last comment cause it give me some new input that i could add to my design.
sooo, like i wrote last night i found a really nice workaround for my patch design. i think the main problem was that i never thought that it could be so easy. :) if i use the send/receive object to transmit the data there is no significant latency because of its more like an event signal not an audio signal. of course thats my assumption. ;)
there is one thing i have to say, at the end a friend of mine help me last night with the design cause i couldn´t find a way do get it done. after a couple of other designs we discovered that its just to easy like that. so its not only my credit. ;)
here is the design:
----------begin_max5_patcher---------- 634.3oc2V1riaBCDG+L7Tf74zHaLXG2asuFUqVwFbRbkiIBHaS6psO6EOFZH a9.HYoMsWPLCF64+uwyX+huG5orcxBTvGC9Rfm2K9ddfKqCuZaOz5jcy0IEv vPqkkx7ehl39jY6ZkQKKguQ16Laa4I7pkofqPbsO2vJ+9FoKDPKzYIknfGp+ tJEVyrm95GHMKoxTE.Omng4tYh1jTNekxr7wb47R2bEJlMMdRfv9fDNEW8LJ ZJN3A6e7puu8wj6bQGNXQyX+yK5H7PUMSvAAyeOjsQ9spnnIDJk6fEAkGnkO K0jGyUKWUdRpzDgKxLklj0fRQeJWknC9blNEcQncDf1yF67Un9gzggoMKy7L cVtavUNi33Xwjp2DDJOLt8aDKINlyTA57HMtheU+JCdxo.RmMRDUKW7eAPE8 .nzP.qraBn+spLE7AWYxhG8JyhtqLIWyFI7HW9M6B6VnyhsrhCDiGMFkeEcV 9cORMQOnFEnFiOFTaid6xJ0d5huvqAXgmqNrPszTUgM42u0U+q1Wb3RshhH. YBgt5wzwBSJy8Nkn3NoTzkfDrTHsx71qPCSm0+gjqHaa97l.u99cA62lmJKJ UljRUlo0Xr8IZMnUpzToock1ZU5lrpFx0wPHGNhgvftFTtKYefEaFXHbGwe9 TeekAoGxPLPYPwPzQhckz0YfCrBEsjg03Fkg8BQcpC6sSGhNhiAxKb8jhwGY 3ZwiofHtYMH5iFrmieEZvEuLJ+HCRjqiKARYQ2dlvBYRGpv1iq0f5TEuGwDt OwD9NKlFXxFaShtSRCigcmGX.WcstIC6OSllLLELy0Wi1NnouUA08WXG0R2+ U+eAe8i2XC -----------end_max5_patcher-----------
sorry, but i dont think that my first design worked like what i expected. even if i scale the metering to another range there is still something wrong. another thing is that i told you before, the shown signal volume in the meter raise if the actual audio signal turn lower. i changed the values like you told me in your first comment but this changed nothing. after a some test on the design i found another way but it is a way more sophisticated like the final design. if you are interested you can have a look on this patch.
----------begin_max5_patcher---------- 1757.3oc6as0aaaCE94jeEDF4gMfDCdUhZXuzh8x.5S60ggBYKZGtJKYHIm1 rh1e6ihTxQN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gMfPeW3m7G Vew9tniW96Pa.4B3tDkZ4O3xtvY5UUCTyOCmp1qu6HlIdv.SoAN+3Ac+bf59 4fEXj7f8GY7th435ACgszqB98hqifcMqgAL4JpqOuGY3DaX4l4zKcbZpAe61 +GfHCb2E -----------end_max5_patcher-----------
sorry for all who are looking for a real audio to midi solution but it was just my first thought for a workaround. this patch design is just to send and receive a peak value without/with the smallest amount of latency to drive a meter as exact as possible. in a couple of days when its finished you can find the whole metering patch ver. 1.0 and a description on http://maxforlive.com/ . i just want to work a little bit on the gui to let it look nice and clear and of course i add the direct link to this topic when its done. may someone is interested in this whole thing, specially when you use ableton for DJing.