Storing [maxtrixctl] state in [pattr]?

May 22, 2009 at 7:03am

Storing [maxtrixctl] state in [pattr]?

Since I have limited experience with both these objects (uh, and *all* objects, for that matter), forgive me if I’m missing the obvious. I want the user to be able to click on/off [matrixctl] states over time, then be able to store the current config with [pattrstorage] and recall it. Since sending a bang to [matrixctl] seems to be the way to get it to output its complete state, this is what I came up with- Seems like a lot of work and some tenuous timing?

Thanks,
Brian

– Pasted Max Patch, click to expand. –
#44033
May 22, 2009 at 7:53am

hi brian,

the easy way is to give your [matrixctrl] object a scripting name, and then to use the [autopattr] object to make your pattrstorage “seeing” it.

the hard way is to write a patch that format the dump of the matrix into a list so that you can send it into a [pattr].

i personally gave up with the hard way…

cheers

g

#158163
May 22, 2009 at 1:21pm

Brian H. wrote on Fri, 22 May 2009 02:03Since I have limited experience with both these objects (uh, and *all* objects, for that matter), forgive me if I’m missing the obvious. I want the user to be able to click on/off [matrixctl] states over time, then be able to store the current config with [pattrstorage] and recall it. Since sending a bang to [matrixctl] seems to be the way to get it to output its complete state, this is what I came up with- Seems like a lot of work and some tenuous timing?

Here’s a quick patch I put together to show some ways to use preset, pattr, and autopattr for your situation. Like everything, there are multiple ways to go about it. In your case, with 0/1 states and no interpolation needed, a simple preset will work, but you can use pattr as well. No need to bang out values to store, the only time you’d need to do this is if you want to manipulate the values in a way that’s not easy to do with the matrixctrl itself (like rotate row or column values, invert all states, etc., which you could do by unpacking the cells into toggles or zl lists, then massaging them as needed.)

I hadn’t really looked into pattrforward before, but poked around the help file after looking at your patch. That object will also be very handy in the future…

– Pasted Max Patch, click to expand. –
#158164
May 25, 2009 at 10:19pm

Thanks, these are both good solutions– I thought there was an easier way than what I assembled (although I was rather proud of it!). I know about [preset] but haven’t really looked into it yet, but I will, now that I see it can applicable here.

Scripting Name with [autopattr] worked just fine in this case, but I really *barely* understand the system (the way I’m using it) so it didn’t come to mind immediately. It works and updates the state info of [matrictrl] quite elegantly.

Thanks again,
Brian

#158165

You must be logged in to reply to this topic.