Swapping Pattrstorage Data
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?
Any ideas for this one?
A little tricky, but i think i got it!
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?
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
Cool, I shall look into this
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.