help with changing presets and lighting launchpad.

Questions and discussion about building and using Max for Live devices
Post Reply
ned rush
Posts: 401
Joined: Wed Sep 23, 2009 1:45 pm
Contact:

help with changing presets and lighting launchpad.

Post by ned rush » Thu Oct 13, 2011 6:28 pm

i made a patch so i can use user 2 to change different presets on pattr. its goes from 1 to 64 and should work ok once the launchpad is selected.

i would like to light the launchpad to correspond with which ever preset is selected any only when is user 2. i've tried following all kinds of tutorials and other patches but cant figure out what to do. i dont want to have to turn a light on and off with one button, i want to light to turn of automatically when a new preset is chosen, and light that preset in accordance to the grid.

hope this makes sense. would really appreciate and help anyone could give becasue i am crap and all this api stuff.


thanks
ned
:)

<pre><code>
----------begin_max5_patcher----------
8099.3oc6c20aaqjd.G+5jOEF9x1rDy6uTTTft8hdS2hBzKKVDnjnMG25XmZ
qb1y1E628xWjTTbDoen4Khx5+5MmjvLhZ3CGNb37alg+029lq+v8+15Gu9p+
gq9ut5Mu4u9127l5MUsg2r8u+lq+xpe6i2t5w5jc8cq+y2+g+6qeWy+zl0+1
l5M+2uaK+o6uayi27+stZqZUgZ6lu6ae49us410ap2K5sasYSa9KeccSV35a
tqb28GOXWc2puT+uc8+7C2r51q982e6m18M80Ua93ubyce98Or9iaZ97diq7
a7pnMW8aVSg+cWoSEp86xa9T8Nq7H324MW+871M2sKqYp11e6sus5+7Nowju
8kOr9gdEALcEAd2UW+gU284wHRDrU+luJazZjPqCGMTneIghiW73u6pzxn.R
S7H3zOeADsQOdkPZ4plqzKhvhKjZBKVIgE+LbgiMbptvIZpCEgX0u47E4Txj
zk+wViGS9UO2dyuttnLu9K8pvhssHUUXp9WCHLYR9p3iIVWMiW2Y8KV6TGg9
Ct+shUe8lh+00a9WJOVd39a+OJCW+9+x+d0AU2AsOd+s2+PyAkpv67pb5ck+
ozt+fOaz9X4Q2AGbBupbLBvMWRpCttivtQ6Zxur9wGW840+TH92+sMat+t2+
GVs4ga9swoVqAEeB0WmZz00bESMQo1BOwotl7MW8gqtcbZAPcMXC7xSqZa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fb.xAHGfb.xAHGfb.xAHGfb3Rib
n4O82d6aa9Ku6suo769t0O1HLr0h35utp7V7UauZy6EJt9w6+1CebcSROns+
p58SsUw5G2bycq1by82cPpr+Xh9ka9zmVW+uu8Et80e4lO806KypayE+Pd7c
8OS4ZNj6NOkm07jURbpNiOe4o5m86YyS5Y9jmQRjpNqqmuLknP0SRzzmobRN
+Yzy74Osnb0bWpxKIWM2mAq6immOV4m2bk0Jn9SsSMuWBZEUZuNuOiwpXTTt
JMymASRNCZcy7YPYwJ2IHV874p3LmqxRxUwYtlAmnbkWMy4JQsiINy0W4TKx
bkVbtZNOCJ+NNyct54ay9L29JmSTrxbBxUOerZlu6rSTq9by7cbbxdVv4tt8
nnxU9Yt9JQsYvM2cvfn1W4l41L3EcGG2L2VTuVRrxOy2GzK59ft7R7oI7y7c
b7xd1449IuDUZ26OAwpmszdHcBxUlmMV4VhmACy80fhJsGGRc6k+k+1a++A9
0FqG
-----------end_max5_patcher-----------
</code></pre>

amounra93
Posts: 431
Joined: Sat Jan 24, 2009 8:16 pm
Location: Arcata, CA
Contact:

Re: help with changing presets and lighting launchpad.

Post by amounra93 » Thu Oct 13, 2011 6:45 pm

Hey Ned,

Sorry, I don't have time to look at the patch right now (actually, I just tried and apparently copy compressed doesn't work in Chrome), but pattrstorage sends a 'recall n' message when you recall one of its presets. I use this to light buttons in Monomodular patches using storage methods. In addition, you can get a list of current stored locations by sending the pattrstorage a 'slotlist' message. I use this to light available vs. stored banks on the grid. All this is in the help file for pattrstorage.

a
http://www.aumhaa.com for Monomod and other m4l goodies.

ned rush
Posts: 401
Joined: Wed Sep 23, 2009 1:45 pm
Contact:

Re: help with changing presets and lighting launchpad.

Post by ned rush » Thu Oct 13, 2011 7:36 pm

i think i see what you're syaing but also feel i didnt explain myself right.

its not so much a problem with recalling presets, i've worked out something where the grid in user 2 will give me the desired number to change the preset object, its more about how i can light the launchpad to correspond with the number that been chosen by the grid. really in the grand scene of things i want to light single buttons on the launchpad according to which one has been pressed, then turn them off when i choose a new button, which then lights etc...

amounra93
Posts: 431
Joined: Sat Jan 24, 2009 8:16 pm
Location: Arcata, CA
Contact:

Re: help with changing presets and lighting launchpad.

Post by amounra93 » Thu Oct 13, 2011 11:00 pm

Oh, gotcha. I think the easiest way is to use a matrixctrl to keep track of things....it will automatically turn off all buttons but the one currently sent to it if you use it in exclusive mode. (Look at the info for it, and under 'behaviour' you can choose the 'One Non-Zero Cell per Matrix'). I do that kinda stuff in js, but before my js days that was how I did things. Is that what you are after?

a
http://www.aumhaa.com for Monomod and other m4l goodies.

ned rush
Posts: 401
Joined: Wed Sep 23, 2009 1:45 pm
Contact:

Re: help with changing presets and lighting launchpad.

Post by ned rush » Fri Oct 14, 2011 11:26 am

so i'm guessing using this method i could also use $1 messages with prepending call statements to light the buttons? then maybe second messages to disable the currently lit one? this is were i start to struggle...

amounra93
Posts: 431
Joined: Sat Jan 24, 2009 8:16 pm
Location: Arcata, CA
Contact:

Re: help with changing presets and lighting launchpad.

Post by amounra93 » Sat Oct 15, 2011 6:12 am

Sorry, I don't have my launchpad right now (loaned it to a friend to play with) so its tough for me to come up with code that will work in a simple way. But yes, basically you can use a [zl rot 1] object between the output of your button_matrix observer and the input of the matrixctrl. The output of the matrixctrl has to be fed back into a live.object that is linked to the button_matrix (same id as that you are receiving from). The order of values isn't the same for sending values, though. You would use the message 'call send_value 0 0 1' to turn button x = 0 y = 0 on with the value of 1 (which might or might not actually light it...you'll have to experiment with the actual values, since the launchpad responds to different values by lighting up with different colors and intensities).

As far as formatting goes, you should be able to hook the output of the matrixctrl directly to a [prepend call send_value] object, and be done with it. No need to worry about turning off buttons if you place the matrixctrl in exclusive mode, as it will do it for you. If you ever need to update the entire grid (because of changing modes or whatever), you just bang the input of the matrixctrl, and it will send out its entire contents.

a
http://www.aumhaa.com for Monomod and other m4l goodies.

Post Reply