how to get coll object data into my pattr system--need advice...

selalou10@yahoo.com's icon

Hello!

I have a matrix and a coll object working together effectively giving the matrix 16 'preset' slots. So i can store 16 different matrix states within the single coll object. THis is working perfectly.

I want to be able to store the data from the coll object (the 16 'presets') in my pattrstorage. I can think of some really long winded ways of doing this, involving a pattr for each of the 16 'presets' in the coll, dumping the col contents out into the pattrs, then creating a system to reload the pattrs in the event that i load a pattrstorage xml file. But i want to believe there is a better way.

Can anybody help me out?

THanks!~

Wetterberg's icon

seth skrev:
> Hello!
>
> I have a matrix and a coll object working together effectively giving the matrix 16 'preset' slots. So i can store 16 different matrix states within the single coll object. THis is working perfectly.
>
> I want to be able to store the data from the coll object (the 16 'presets') in my pattrstorage. I can think of some really long winded ways of doing this, involving a pattr for each of the 16 'presets' in the coll, dumping the col contents out into the pattrs, then creating a system to reload the pattrs in the event that i load a pattrstorage xml file. But i want to believe there is a better way.
>
> Can anybody help me out?
>
Get preset 1 from the coll - store the matrix settings to pattrstorage,
slot 1. Then store preset 2 to pattrstorage, slot 2, etc.

What am I missing?

Andreas.

Chris Muir's icon

At 11:08 AM -0600 9/21/07, seth wrote:
>I have a matrix and a coll object working together effectively giving the matrix 16 'preset' slots. So i can store 16 different matrix states within the single coll object. THis is working perfectly.

When you say matrix do you mean matrix~ or matrixctrl?

If the latter, just name it so that it is seen by autopattr, and recall your coll-based presets one at a time, and store them w/ pattrstorage as you go.

-C

--
Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." - Brian Eno

selalou10@yahoo.com's icon

Hi guys. Thanks a lot for your replies. I don't think i explained in enough detail, sorry bout that.

I am only using a single preset slot in my pattrstorage object, and i need to keep it that way.

So I thought i would be able to dump the entire contents of my coll object (which is storing 16 different states of the matrixctl object) into some thing that my pattrstorage could maintain. Then when loading a saved pattrstorage xml file, i could just dump that information from the pattrstorage back into my coll.

I've been having a hard time working with the dumped output from the coll object.

any ideas?

THanks again

Dan Nigrin's icon

You could try to save the coll data to disk, then save its path to
the pattrstorage somehow, for later recall.

Tricks like this are used when building Pluggo's, to save a path to a
pp parameter...See the very last part of this article:

Dan

At 1:53 PM -0600 9/21/07, seth wrote:
>Hi guys. Thanks a lot for your replies. I don't think i explained
>in enough detail, sorry bout that.
>
>I am only using a single preset slot in my pattrstorage object, and
>i need to keep it that way.
>
>So I thought i would be able to dump the entire contents of my coll
>object (which is storing 16 different states of the matrixctl
>object) into some thing that my pattrstorage could maintain. Then
>when loading a saved pattrstorage xml file, i could just dump that
>information from the pattrstorage back into my coll.
>
>
>I've been having a hard time working with the dumped output from the
>coll object.
>
>any ideas?
>
>THanks again
>

--
Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com
http://www.jackosx.com

selalou10@yahoo.com's icon

Dan-

Thanks for your advice. I have been thinking about that. But I plan on distributing this project as a standalone, and I think that a single 'saved-set' file is the only way to go.

I think i am going to do this the long way..... oh well.

Thanks a lot for all the feedback guys!

Dan Nigrin's icon

>Thanks for your advice. I have been thinking about that. But I
>plan on distributing this project as a standalone, and I think that
>a single 'saved-set' file is the only way to go.

I agree that it's a bit messier, but you can certainly still just
distribute a text file that goes along with your standalone... In OS
X, you can even bury it within your standalone's app bundle (not sure
if you're Mac or PC).

Dan
--
Dan Nigrin
Defective Records
202 Hack / PC-1600 User / VSTi Host / OMS Convert / Jack OS X / Major
Malfunction
http://www.defectiverecords.com
http://www.jackosx.com

Wetterberg's icon

seth skrev:
> Hi guys. Thanks a lot for your replies. I don't think i explained in enough detail, sorry bout that.
>
> I am only using a single preset slot in my pattrstorage object, and i need to keep it that way.
Can you elaborate a bit on *why* exactly you need it this way?

You can also do [recall s f] where the "s" is the name of the matrix,
and the float is the preset slot - in other words you can recall *just*
the settings for the matrix, if I am not mistaken - even though
pattrstorage is still bound to all the objects ( via autopattr, etc)

Andreas.

Chris Muir's icon

At 1:53 PM -0600 9/21/07, seth wrote:
>So I thought i would be able to dump the entire contents of my coll object (which is storing 16 different states of the matrixctl object) into some thing that my pattrstorage could maintain. Then when loading a saved pattrstorage xml file, i could just dump that information from the pattrstorage back into my coll.

Well, it might be something of a PITA, but I think this sort of approach would work:

First dump contents of coll into a text object. (There would have to be some list & data munging to accomplish this.)

Save preset with pattrstorage

The attachment contains a crude example

-C

--
Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." - Brian Eno

Chris Muir's icon

Forgot the messages from the email list don't make it to the Forum version.

Here's the attachment.

-C

Exit Only's icon

I havent downloaded the attachment....but I tried using text to solve this issue as well, and text did not register with pattrstorage.

Am i missing something?

Chris Muir's icon

At 8:52 PM -0600 9/21/07, Nick Inhofe wrote:
>I havent downloaded the attachment....but I tried using text to solve this issue as well, and text did not register with pattrstorage.

Works for me. Max 4.6.3 on OS X.

All you have to do is name the text object, and have an autopattr & pattrstorage/

>Am i missing something?

Try the example I posted, and see if that works for you.

-C

--
Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." - Brian Eno

Chris Muir's icon

I fixed a little little initialization problem and better commented
my example patch. I uploaded it to my Max examples page as CollPattr.
http://www.xfade.com/max/examples

-C

--
Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." - Brian Eno

Exit Only's icon

ah! yeah I guess checking the example would have made a world of difference.. I was trying a solution with the 'text' object, while yours uses the 'textedit'.

I dont know why the latter is compatible, but the former is not... oh well!

Chris Muir's icon

At 10:39 PM -0600 9/21/07, Nick Inhofe wrote:
>ah! yeah I guess checking the example would have made a world of difference.. I was trying a solution with the 'text' object, while yours uses the 'textedit'.

D'Oh! Sorry to lead you down the wrong path.

>I dont know why the latter is compatible, but the former is not... oh well!

pattr only works with user interface objects, and text isn't one.

-C

--
Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." - Brian Eno

Jeremy's icon

Am 22.09.2007 um 07:38 schrieb Chris Muir:

>> I dont know why the latter is compatible, but the former is not...
>> oh well!
>
> pattr only works with user interface objects, and text isn't one.

That's not strictly true - pattr only works with pattr-compatible
objects, the majority of which happen to be UI objects. JS is a non-
UI object which offers pattr-compability. Developers wishing to add
pattr/pattrstorage compatibility to their objects can do so quite
easily, as outlined in the pattr SDK (part of the MaxMSP SDK download).

Neither coll nor text is pattr-compatible, however.

jb

jln's icon

Hi,

Do you need to edit your coll by hand ? If not, you could use a pattr object instead of textEdit.

Beside this, for potential reuse, I slightly modified Chris's example using to/fromsymbol to store coll's content so you shouldn't need to bother with coll's length. Oh, and it's also easier to read in storagewindow, if that matters. :-)

Best,
Julien.

selalou10@yahoo.com's icon

This forum is the best. Thanks for all the help, folks!!!

Chris, I am looking at your patch now, and i think it will help me greatly.

I can't wait until this project is done... Its gonna be sweet!

I'll be back with a post in a about two weeks or so, with the final project.

Yeeeeeehaw!

seejayjames's icon

Jeremy, just out of curiosity, how is the js "pattr-compatible"? Does it allow the pattr storage of attributes or other values? I'm not sure I follow.

I read your post and my brain is perplexed, but also very interested... this could be quite useful.

Thanks!

--CJ

Stefan Tiedje's icon

jln schrieb:
> Beside this, for potential reuse, I slightly modified Chris's example
> using to/fromsymbol to store coll's content so you shouldn't need to
> bother with coll's length. Oh, and it's also easier to read in
> storagewindow, if that matters. :-)

And to simplify it further, instead of a complex gate construction for
splitting normal quering and preset storing, just use a second coll with
the same name to do the dump...

Nice patch by the way, thanks to Chris and Julien...

Stefan

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

Chris Muir's icon

At 11:42 PM +0200 9/25/07, Stefan Tiedje wrote:
>And to simplify it further, instead of a complex gate construction for splitting normal quering and preset storing, just use a second coll with the same name to do the dump...

You know, I considered that, but decided that although it was probably the right way to do it, it was adding a level of conceptual murkiness, so I went with the brute force approach. You're probably right, though, I should have done it with two colls.

-C

--
Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." - Brian Eno