Forums > MaxMSP

Swapping Pattrstorage Data

January 28, 2013 | 1:52 am

Hey. I will briefly explain my patch before asking my question. I’m working on a patch that allows me to have finer control of one of my Vsts. Right now I have three independent parameters in which I can increment and decrement. I can switch though toggling each one individually, never loosing my place. As of now, the way I am doing this recalling of data is not through the Pattrstorage object (found inside p_glad), but rather, with a sprintf object. I also have a Pattrstorage object to store their values any time a parameter is adjusted. It is with this Pattrstorage that I have been trying to make a bang or button that allows me to swap between what I have in Osc1Wave and Osc2Wave. I have tried a few objects, but so far, I have been unsuccessful.

What would be the best object to enable me to do this swapping? And would it be better to set up to communicate with Pattrstorage, or just through the two Pattr objects, Pattr Osc1Wave and Pattr Osc2Wave?

– Pasted Max Patch, click to expand. –

February 1, 2013 | 2:27 am

Any ideas for this one?


February 1, 2013 | 4:31 am

A little tricky, but i think i got it!

– Pasted Max Patch, click to expand. –

February 4, 2013 | 8:44 am

Thanks Lume, your patch worked perfectly!

So let me see if I can figure this out…

The bang on the left (outputting to the two getOsc’s) is triggered first. It then gets the value from the pattr objects above. Is this done by taking the getOsc message into the pattr hub? Is that where it gets the value? Then zl slicer removes the name so that the swapie’s name can be put in its place. This new string is sent to a message where the second bang triggers it back into the pattrhub, and the values swap.

pure awesomeness.

So I’m going to be planning on doing this same kind of thing with 2 more oscillators and then about 6 parameters. For these groups i’d eventually like to be able to do this swapping and also implement a cycling function (each parameter’s value is bumped to the next one).

Are there any objects / similar patches and tutorials to my patch / javascript implementations you could suggest for me to check out?


February 5, 2013 | 4:51 am

That’s how it works yeah. =]

It does sound like an undertaking to me, if you wanna do what you wanna do with standard Max objects.
I’d take this as an oppurtunity to learn about Javascript arrays.

http://www.w3schools.com/jsref/jsref_obj_array.asp


February 5, 2013 | 11:27 pm

Cool, I shall look into this


February 6, 2013 | 1:15 am

Another thing!
You should also have a look at the zl objects. They do lots of really neat
processes on lists like rotation. Very useful.

You instantiate them with [zl.mode], where mode is the type of zl object you want to use.


Viewing 7 posts - 1 through 7 (of 7 total)