Trying to create a VU meter that sends midi CC (audio>midi)

Questions and discussion about building and using Max for Live devices
exaltron
Posts: 193
Joined: Tue Mar 16, 2004 6:37 pm
Location: Upper Manhattan, NY
Contact:

Re: Trying to create a VU meter that sends midi CC (audio>midi)

Post by exaltron » Fri Aug 31, 2012 4:47 am

synnack wrote:Here's how I did something similar. You'd just replace the send object with midi CC stuff. Also see qlim for rate limiting.


<pre><code>
----------begin_max5_patcher----------
842.3oc4Xt0aaBCE.9YxuBKdbJKx1.gvdqScSZRQqRSSZOTUMQ.mTWAlLrSW
2pZ9sOiMDfFHgjR65kWfXyw1G+4yMmaGXXNK4FB2D7Av4.CiaGXXn5JqCi71
Flw92DD4yUhYxH+NY1UlC0eRPtQn5lCld1O9zWOE+4omcx2K977Dlf4GSThb
RJ0OB7wjnvhOyVESYQDgZlQkclrRTzKrxLwo+UMSH3nhtWlR3DlvWPSX+LkD
HzaEjsTB.xBqdAQpWSFAAWTLNeQvkT1hJiwA5lIlyXmVGTkEqpFSCU6OIVdu
sYVW2MXP1igcDowDN2eAYKlNOk7K.FJUC4iQGCSwMxTztYpVRweVRzfwzrCX
yRyKWM3GWgZUnC18XvSD8ZxnXhfjt9.LbPssahnbQ4NhGQCIoAIQIo5umwgJ
OPsb9Wk.JCFOkzk1N6jY1JCSa73VGz9M0vnWivzypDlVZtf2CLm.qBylFTGf
I70HLwvC1xT6M+vrLQdGCLaIwx74ymsFXoBABrFkEnp+xtXcfQB4zEL+HygM
7qtDizRQUusyrTAdN8H6d2ZoUx+u7FcfLHakIJFpLRk4qcZmLVGCYBRhiklq
aglusGr.9hvOhFTcb0bEsx7BsrydZW2WrGJpoANA0kxfzub2xBZd5hYpodyr
TM5lSehtourPmE7gPtwuoM5Pk4ONTvY+F1jCqP1jiha39jamRtlFP.WSREz.
IqhnwTQ6rr+tW1kzvPRs5CZ.SZGS2b+yCDTd8ImNYUHMAHR.SkUz8ryVCsyv
a4k8pbUmnKsvqqPzsGK1XYzpExcx59qdC7Cs5rcU4g8jJoEbr1UIY3dlRT1K
FH4tIAvtQTs6hpDPdaF18+mkTqPV+04FOYUZPg9omM4JsYYBIbAks4BGmWTM
nzCaiLkwaJ13wzvkITlHWE7fYkV5hTEXZ6UznbQnb+YQD0NB13wcWUdmNn7X
zdz99ScpyolUGmmLswoCZi75iGzQqCZb1wo0D0oZVKXdqGoSW79NcgOY7D69
r53sKNt3Zx7XqMvNnMvmMZyAFTyQY3qs6yCp8HY1eOexl0d6ijk57E9KWJqS
kmOkJMQlQ8JcgUiGpZRY5lpYzLUVcag7tCxls6F7OfMmypN
-----------end_max5_patcher-----------
</code></pre>
Awesome, thanks! I think I will be able to use this. It seems like I can't use Midi Map to assign the CC info coming through from my receive device. I can see the data coming through but when I go into Midi Map, none of the assignable faders are seeing any data to learn from. So what I'm looking to do now is add a receive object into the maxuino device I'm trying to control. Will let you know how that goes.
Image

exaltron
Posts: 193
Joined: Tue Mar 16, 2004 6:37 pm
Location: Upper Manhattan, NY
Contact:

Re: Trying to create a VU meter that sends midi CC (audio>midi)

Post by exaltron » Tue Sep 04, 2012 4:09 am

Well I made some headway- got the basic concept of the VU meter working but it's pretty kludgy and it's killing my RAM. I'm using this device to listen to three bands of audio:

Image

Then I use three separate devices hacked from a Device LFO to format the received data into midi CC data that can be sent to the maxuino device:

Image

So obviously there's got to be a better way. What I would like to do is alter the maxuino device to receive midi data directly to the PWM faders (See "Digital Pins"), but every time I try to make any change to the device it seems to completely blow it up. I don't know if this is because it's a frozen device that creates a whole new set of files when I unfreeze it, but there's something very strange about the way it acts when anything is altered and resaved.

On the other hand, I know that the maxuino is using OSC routing throughout, so it seems like there must be a simple way to insert a message just before the faders, but I can't even begin to fathom how this OSC routing works at the moment. It is definitely not as straightforward as the Send and Receive objects. I thought that if I just created an object "OSC-route /9 /pwm" in my VU device, it would send that data to the 9th fader here:

Image


But it doesn't seem to work that way.

Can anyone give me any pointers as to how to approach this? I know I am way out of my depth and I should just give up and start with something simpler but it's just not in my constitution ;)

Here is the maxuino device if anyone wants to download and have a look at it.
Image

trevox
Posts: 659
Joined: Wed Mar 23, 2011 12:58 am

Re: Trying to create a VU meter that sends midi CC (audio>midi)

Post by trevox » Tue Sep 04, 2012 10:28 am

Send/receive is okay for sending single messages that are not overly reliant on accuracy, but they are not very stable at communicating streams of data between M4L patches in my opinion - I would presume that is why you are getting overloads.

udpsend/udpreceive doesn't work that much differently than the normal send/receive. All the osc-route object does is parse the osc data coming in where you have several streams of data coming in on the same port. So In your patch, you should have a udpsend object, not an osc-route one as osc-route is only used at the receiving end. However, in order to route this data, you do need to send a list in the format "/xxx <message>" into the udpsend object. Then in your other patch, you place a udpreceive object accepting the same port number and use the osc-route object to parse the "/xxx" data only. Hope that makes sense!

There are embedded patchers in your screenshots so I don't know exactly how the maxuino device is routing the osc data. Just to clarify, you are looking to modulate the pwm value in the maxuino device on channel 9 using the data coming from the vu meter? Not at my music laptop now, but can have a look later....

trevox
Posts: 659
Joined: Wed Mar 23, 2011 12:58 am

Re: Trying to create a VU meter that sends midi CC (audio>midi)

Post by trevox » Tue Sep 04, 2012 10:30 pm

I had a look and because the maxuino device is using the serial port, there doesn't seem to be any way to communicate with it as there's no port number I can find.

However, this device is based on a kind of multi LFO I had created ages ago where I wanted to assign the same LFO to several parameters. Delete all but one of the mappers if you only want one.

http://dl.dropbox.com/u/30280761/maxuin ... meter.amxd

To use, drop the device onto your audio track and click on one of the "Map" buttons. Next, click on the track the maxuino device is on and click on any parameter. That's it! Note that once you click on the map, the next parameter you click on gets mapped and you have to re-click on the map button to change the assignment.

I think the invert is on by default, so click on the "Inv" button - there's also min and max values so you can scale it. Note that this works with any parameter in Live and I would suggest downsampling a bit to save on CPU.

exaltron
Posts: 193
Joined: Tue Mar 16, 2004 6:37 pm
Location: Upper Manhattan, NY
Contact:

Re: Trying to create a VU meter that sends midi CC (audio>midi)

Post by exaltron » Wed Sep 05, 2012 2:21 am

trevox wrote:I had a look and because the maxuino device is using the serial port, there doesn't seem to be any way to communicate with it as there's no port number I can find.

However, this device is based on a kind of multi LFO I had created ages ago where I wanted to assign the same LFO to several parameters. Delete all but one of the mappers if you only want one.

http://dl.dropbox.com/u/30280761/maxuin ... meter.amxd

To use, drop the device onto your audio track and click on one of the "Map" buttons. Next, click on the track the maxuino device is on and click on any parameter. That's it! Note that once you click on the map, the next parameter you click on gets mapped and you have to re-click on the map button to change the assignment.

I think the invert is on by default, so click on the "Inv" button - there's also min and max values so you can scale it. Note that this works with any parameter in Live and I would suggest downsampling a bit to save on CPU.
Very cool! trying it out now. I see that the map button and patch have a line through so I'm guessing I may be missing those files which would explain why the map function is not working. I will double check that and let you know how it goes :)
Image

exaltron
Posts: 193
Joined: Tue Mar 16, 2004 6:37 pm
Location: Upper Manhattan, NY
Contact:

Re: Trying to create a VU meter that sends midi CC (audio>midi)

Post by exaltron » Wed Sep 05, 2012 2:28 am

exaltron wrote:
trevox wrote:I had a look and because the maxuino device is using the serial port, there doesn't seem to be any way to communicate with it as there's no port number I can find.

However, this device is based on a kind of multi LFO I had created ages ago where I wanted to assign the same LFO to several parameters. Delete all but one of the mappers if you only want one.

http://dl.dropbox.com/u/30280761/maxuin ... meter.amxd

To use, drop the device onto your audio track and click on one of the "Map" buttons. Next, click on the track the maxuino device is on and click on any parameter. That's it! Note that once you click on the map, the next parameter you click on gets mapped and you have to re-click on the map button to change the assignment.

I think the invert is on by default, so click on the "Inv" button - there's also min and max values so you can scale it. Note that this works with any parameter in Live and I would suggest downsampling a bit to save on CPU.
Very cool! trying it out now. I see that the map button and patch have a line through so I'm guessing I may be missing those files which would explain why the map function is not working. I will double check that and let you know how it goes :)
Hmmm, nope that seems to be embedded. What about the javascript files? I don't see those anywhere.
Image

exaltron
Posts: 193
Joined: Tue Mar 16, 2004 6:37 pm
Location: Upper Manhattan, NY
Contact:

Re: Trying to create a VU meter that sends midi CC (audio>midi)

Post by exaltron » Wed Sep 05, 2012 5:36 am

exaltron wrote:
exaltron wrote:
Very cool! trying it out now. I see that the map button and patch have a line through so I'm guessing I may be missing those files which would explain why the map function is not working. I will double check that and let you know how it goes :)
Hmmm, nope that seems to be embedded. What about the javascript files? I don't see those anywhere.
OK, I think I got something figured out, I was finally able to get into the maxuino patch and figured out how to get a Receive object into the OSC chain and get the faders moving. Since I'm sending PWM to soldered pins I don't need the capability to keep mapping and remapping, and it seems like this is something that needs to be done every time a set is opened, so easier just to build it right into the device.

Now to work on handling the VU data. Seems like there is way too much regardless of how things are being sent..
Image

exaltron
Posts: 193
Joined: Tue Mar 16, 2004 6:37 pm
Location: Upper Manhattan, NY
Contact:

Re: Trying to create a VU meter that sends midi CC (audio>midi)

Post by exaltron » Wed Sep 05, 2012 5:39 am

trevox wrote:Send/receive is okay for sending single messages that are not overly reliant on accuracy, but they are not very stable at communicating streams of data between M4L patches in my opinion - I would presume that is why you are getting overloads.

udpsend/udpreceive doesn't work that much differently than the normal send/receive. All the osc-route object does is parse the osc data coming in where you have several streams of data coming in on the same port. So In your patch, you should have a udpsend object, not an osc-route one as osc-route is only used at the receiving end. However, in order to route this data, you do need to send a list in the format "/xxx <message>" into the udpsend object. Then in your other patch, you place a udpreceive object accepting the same port number and use the osc-route object to parse the "/xxx" data only. Hope that makes sense!

There are embedded patchers in your screenshots so I don't know exactly how the maxuino device is routing the osc data. Just to clarify, you are looking to modulate the pwm value in the maxuino device on channel 9 using the data coming from the vu meter? Not at my music laptop now, but can have a look later....
Ah, I read this again and maybe it is the send/receive that is killing my CPU. I will give that method you describe above a try tomorrow. Thanks!
Image

trevox
Posts: 659
Joined: Wed Mar 23, 2011 12:58 am

Re: Trying to create a VU meter that sends midi CC (audio>midi)

Post by trevox » Wed Sep 05, 2012 11:40 am

exaltron wrote:Very cool! trying it out now. I see that the map button and patch have a line through so I'm guessing I may be missing those files which would explain why the map function is not working. I will double check that and let you know how it goes :)
Hmmmm....as far as I remember, all objects used in the patch are standard objects, so don't understand why any files would not be available to you. Can you post a screenshot as this mapping should work fine! Actually, if you go to edit the device, the max window should tell you if any objects are not available....

trevox
Posts: 659
Joined: Wed Mar 23, 2011 12:58 am

Re: Trying to create a VU meter that sends midi CC (audio>midi)

Post by trevox » Wed Sep 05, 2012 11:43 am

exaltron wrote:Hmmm, nope that seems to be embedded. What about the javascript files? I don't see those anywhere.
You don't need the java script files. Basically the device I posted will communicate directly with parameters on the maxuino device, and then that maxuino device should work as normal (apart from being automated by the vu meter)

Post Reply