Pattr - multiple object scripting names
Hi - I have a huge, rambling patch (must get using bpatcher one day...its spaghetti unlocked) and am having to understand Pattr for the first time because message boxes in my patch aren't being saved by the preset object.
My question is: do I really have to give every single object a different name? There are, literally, hundreds. If so, what's the quickest way to name, say, a row of 64 switches - in, presumably, unique names?
I know it's time to move on from the preset object, but it's always been great until I needed to store message box settings too....
Thanks,
Lee
I guess my problem is I'm using the message object to display, store and edit data. I've tried pattr now, and I can give the message objects scripting names - but they don't seem to be stored in pattr presets anyway - unless I'm using it wrong still. Here's an example below of the data I'd like to be able to store.
Do I, then, have to replace all these message boxes with number boxes and int objects? It's a shame, because the message object is kind of a useful way to display and edit values (and there are loads of them neatly packed into a very crowded sequencer patch.....my fault for never using presentation mode/bpatchers)
Concerning naming, there's a trick that you can do where you provide a name for the first object with the format yournamehere[0]. When you duplicate this object, it will automatically name the duplicates in sequence.
It looks like message box is invisible to pattrstorage--I'm guessing this is because normally it's only editable in unlocked mode. Ha, just tried to connect the bindto outlet of a pattr object (the middle outlet) and it disappears and gives an error message about message being unsupported.
Number/flonum will probably easier, but you could use textedit as well if you find yourself wanting something where you can click to send messages, though you'll want to strip off the "text" that gets put in front of the output. I would probably use it with the following: textedit @clickmode 1 @lines 1 @keymode 1 and I would wrap the whole thing in a bpatcher which is using a saved abstraction. The major plus of doing this is that if you want to change your gui, you just change the abstraction, and everything updates without having to patch anything. The important thing is to be sure you throw an autopattr in the bpatcher patch as well. In Max 7, you can also transform a subpatcher into a bpatcher by clicking on the yellow triangle menu on the object and choosing the transform option.
@clickmode 1 -- output the word you clicked on out the third outlet (so if you wanted it to behave a bit like message box where you could click on it, this is sort of that type of thing)
@lines 1 -- one line only
@keymode 1 -- output on pressing "return"
An abstraction for bpatcher might look like this:
I'm just using embedded bpatchers in this example, but you'd probably want to point them towards the abstraction. (they will lose connections when you do this unfortunately, so you want to do this at the beginning of the process)
Brillaint - thanks Peter. Didn't know that scripting trick, very useful! Pattr from here on in - just read about the interpolation stuff in it too, very powerful object.