Introduction and Push noob questions

Learn about building and using Max for Live devices.
Post Reply
r_constanzo
Posts: 8
Joined: Sat Aug 05, 2017 3:16 pm
Location: Porto/Manchester
Contact:

Introduction and Push noob questions

Post by r_constanzo » Sun Aug 06, 2017 3:03 pm

Howdie all,

I've been Max patching for a while, and have more recently been getting into M4L-ing (with a pretty big device nearly done, which I'll share once it's ready).

I've recently gotten a Push2 and plan on making some stuff with it, but I've got some super nooby questions about how mapping and I/O works with the Push.

Some questions:
If you make a M4L Instrument, is there a way to override the default keyboard LED feedback?
If so, is it possible to have an instrument that also takes audio input?

Depending on the answer(s) to the above:
If you have a M4L Audio Effect, can you access the [notein] info from the main 8x8 Push grid?
Can you access aftertouch?

I whipped up a quick patch that translates the Push2 midi note input to a standard 8x8 matrixctrl format messages. (code snippet below)

If I save this in a M4L audio effect, I don't get anything, but if I click the edit button, it all works fine inside of the "Max editor".

I know that MIDI inside M4L is neutered, but I don't know the specifics of what works and doesn't work inside 'Instruments' vs 'Effects'.

So yeah, hello, and sorry for the uber noobish questions!

----------begin_max5_patcher----------
724.3oc0WssaaCCC8YmuBAiMfMfjNcII1YOrejghBmD0VEDKYHK25th9uOIp
31jTWY2bAs8AKAQKSpygTjzONHJdtplWFi9M5unnnGGDEAhbBh1rNJNOqdw5
rRXawR98p4qhG5ekgWa.wqTBYivhLyhaExatRyWX75lhYWfGhRItwISbiT5E
Xzka9DwRPKVMOh0nFYUtPtla.6ReQnpxzHkrQZo4g0bPCMereSlGJ39CPbL5
R2adZv.2vviCsRkg2G7xl5FmQBgWZq3kzJdY8GuBoId3NSGDArPkmyc5XOFH
WrTfLJTZcJJOynE0AXiII.ALClHXu6G2NcPv32AgfeMgb.fLmWVlcC+UfjhX
Hb.bwbfv5kYvz3zPt4wS9BDWKtF8MAC8GDFYtkKsKH1GJhf3qK4OuLDmPGS1
xYSwSCRJseYm8wPJGZX.IgtEjmfChX5Wfv.WxbDq6zaT+EaxrYAgL9yjS9Mf
bkreUvHTeh8jfPlkbdRp6RkCOmRnyqKznDzHzOb2u+EJ8mgngYdOOARhOKbk
bx6fE9nb7irEo6gaOw61CVImL87b29fKd+FP96nzdb216g6.wrOYH12JxBid
cit0p6gWk1YIK1TnVEwWMGlZEyACpypLpRw+3aKqHSmkyMb8UbY1bO1wsRQz
9SQqEkPmcv7ymyBMuz1tVlQnjagP.QdXQSedZGFFTgUax8+c.fvbx2k1KUU5
EMGlM8sidgvVxKMBIbN1dOI9M0pmsuFxVA01PRGFxumi1N3dXmiEOtzFcZHx
tzqRujqgXryuocowayz3ixzMgBgQ8zS.+NtOQlt1y2Jp5DAxdYZx4vy5Z5pa
PyNGd19YZZ67M43Cp5J2.b9nG6k1dETgOAgu6c8KfkHsjPOqn3NttbytAiXK
RtRAjcxPXoP5WBMhFq42IZ1+XPRl1VwzXKlTo8EkpS8c5DmqrtMYkXimyZ4m
F7e.vymGnA
-----------end_max5_patcher-----------

dataf1ow
Posts: 230
Joined: Wed Oct 08, 2008 4:28 pm

Re: Introduction and Push noob questions

Post by dataf1ow » Wed Aug 16, 2017 3:47 pm

r_constanzo wrote: Some questions:
If you make a M4L Instrument, is there a way to override the default keyboard LED feedback?
If so, is it possible to have an instrument that also takes audio input?
Yes, there is, you'll be diving head first into the deep end of the control surface API, or using User mode.
Only Audio Effects can take audio input. Instruments, take MIDI input. No way around this as far as I know.

r_constanzo wrote: Depending on the answer(s) to the above:
If you have a M4L Audio Effect, can you access the [notein] info from the main 8x8 Push grid?
Can you access aftertouch?
You cannot access MIDI input in an audio effect, but you CAN observe the button grid through the API to get control messages from the Push into any M4L device.
I believe you can also get aftertouch, but I've never had a need for it, so I can't say with 100% certainty.

P.S. Hi Rodrigo! I've seen you plenty of times on the cycling forums, and even made a M4L device based on Karma! Nice to see you around here as well.

r_constanzo
Posts: 8
Joined: Sat Aug 05, 2017 3:16 pm
Location: Porto/Manchester
Contact:

Re: Introduction and Push noob questions

Post by r_constanzo » Wed Aug 16, 2017 4:06 pm

dataf1ow wrote: You cannot access MIDI input in an audio effect, but you CAN observe the button grid through the API to get control messages from the Push into any M4L device.
I believe you can also get aftertouch, but I've never had a need for it, so I can't say with 100% certainty.

P.S. Hi Rodrigo! I've seen you plenty of times on the cycling forums, and even made a M4L device based on Karma! Nice to see you around here as well.
Ah that's good to know.

So it looks like I want to make an Audio Effect, and then use the API to get grid messages (and presumably be able to control LEDs), (without going into User mode?)

I had seen this document:
https://github.com/Ableton/push-interfa ... erface.asc

but hadn't gone through it in detail yet.

Are there any free/open devices that I should look at to get a heads up on how that stuff is implemented?


Cool beans! Saw the video for Hindsight through the c74 forum/projects I think. Looks cool! And good to hear that karma~ has been of use :)

dataf1ow
Posts: 230
Joined: Wed Oct 08, 2008 4:28 pm

Re: Introduction and Push noob questions

Post by dataf1ow » Wed Aug 16, 2017 5:49 pm

Yep, I'd stay away from User mode. The convenient thing about the Push/2 is that you can selectively 'grab' and 'release' components of the control surface, and leave all other behavior intact.

You're free to take a look at any of my devices to see how I've done it, but the older ones can be quite a mess, and I've moved to javascript for all of my LED handling/Live API stuff. If you're comfortable with JS I would go that route. Using traditional max patches to do the LED stuff can get messy, depending on what you want to do.

Here's some code that shows how to get access to the Push2 control surface in M4L. It does a bit of API navigation and spits out the path and the id of the Push2 script. It prints all the objects information to the max window. You'll want to look into the controls for all of your buttons and LEDs. Specifically the button matrix, I've got an example of sending data for LEDs observing presses, and grabbing and releasing the matrix:

<pre><code>
----------begin_max5_patcher----------
1845.3oc2b0zaaiCD8ryuBAcNaf32T83hcwdoG16KJLjsYcTqrjgDc1zVz+6
qDGoZ6T+AojISyhBDWoHG+dyLbl2LjIe6tYwKpdV0DG8tn+IZ1ruc2rYla0c
iY8WOKdS1yKKxZLOV7xpMaTk536gumV8r1b+2mu9Qcj9QUz6+y+nY3aWtaSd
YgRadun9a1n+Rgx7lFdr7UlKqV7oeCgO38VsSO7lS5u61L8xGyKWOuVsTC.G
kPjOjbeDgy5dAwRLuzdunOz8l99c208k6sjgsetKT0w+3yqNaiRqpmqJyV.3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5c0vdu+LG1o83MUsMvUtKuuGt1O4ue2+w
Kjiow
-----------end_max5_patcher-----------
</code></pre>

I wanted to show all of this in js too, but I don't have the time today to mock it up. Soon though!

r_constanzo
Posts: 8
Joined: Sat Aug 05, 2017 3:16 pm
Location: Porto/Manchester
Contact:

Re: Introduction and Push noob questions

Post by r_constanzo » Wed Aug 16, 2017 6:10 pm

Awesome, thanks so much.

I've not tested/tried it yet, but that's the exactly the kind of thing that I was looking/hoping for.

For the most part my idea at the moment is to only use the 8x8 grid to control stuff, and leave the rest of the components in the control of Live, but I'll see how things go.

I've always been a bit wary of js (at least in Max) since running into an issue of LED lag a bunch of years ago with the low priority-ness of js creating a backlog of events. That being said, all the modern monome apps are built in/around js, so if it works there, I'm sure it's much easier to do.

dataf1ow
Posts: 230
Joined: Wed Oct 08, 2008 4:28 pm

Re: Introduction and Push noob questions

Post by dataf1ow » Wed Aug 16, 2017 7:45 pm

That patch should get you started on using and controlling just the matrix.

I didn't start using js to do LED stuff until recently, but I've found it much easier to manage. Defining utility functions, and iterating through LED states/colors is way easier and cleaner in a text based environment. I have run into some serious lag issues when developing, but once the device is closed its been pretty snappy.

r_constanzo
Posts: 8
Joined: Sat Aug 05, 2017 3:16 pm
Location: Porto/Manchester
Contact:

Re: Introduction and Push noob questions

Post by r_constanzo » Wed Aug 16, 2017 11:16 pm

It all works a charm, thanks!

I'll pour through the API as the way the LEDs are mapped isn't immediately obvious, so I can understand why moving towards a better control system there would be beneficial.

dataf1ow
Posts: 230
Joined: Wed Oct 08, 2008 4:28 pm

Re: Introduction and Push noob questions

Post by dataf1ow » Thu Aug 17, 2017 5:21 pm

Sounds good - let me know if you have any questions, or just want to bounce some ideas around. I love nerding out about LED control schemes.

r_constanzo
Posts: 8
Joined: Sat Aug 05, 2017 3:16 pm
Location: Porto/Manchester
Contact:

Re: Introduction and Push noob questions

Post by r_constanzo » Thu Aug 17, 2017 5:36 pm

Actually, was playing with it a bit more and it looks like the colors are in arbitrary order.

I imagine, from you moving to js for what you're doing, that it's not as straight forward as taking a color (green for example) and just going from bright to dim to off with one value control value?

I haven't gotten too far into the LED/UI planning side of things, but I plan on doing most of the LED stuff with brightness, rather than color, although there will be color differentiation in the mix (hence the question above about brightness).

dataf1ow
Posts: 230
Joined: Wed Oct 08, 2008 4:28 pm

Re: Introduction and Push noob questions

Post by dataf1ow » Thu Aug 17, 2017 5:53 pm

I'm away from the hardware until Monday, so I won't be much help until then with practical advice, but it looks like section 2.6.2 of that document you linked to earlier provides some insight into how colors are calculated. The MIDI values 0-127 are translated via a color palette. I do not recall if there is a rhyme or reason to the organization of colors, but I am assuming there is.

r_constanzo
Posts: 8
Joined: Sat Aug 05, 2017 3:16 pm
Location: Porto/Manchester
Contact:

Re: Introduction and Push noob questions

Post by r_constanzo » Fri Aug 18, 2017 7:57 pm

The document refers to sysex a lot, which doesn't appear to be what's happening at all with the API, but will play with it further to see if I can make sense of it.

Post Reply