reorganising data in a COLL object

Dec 11, 2011 at 4:24pm

reorganising data in a COLL object

Hi everyone,

i need the coll object to restore data in the following way.

After having stored for example

60, 10 1 200;
61, 10 2 300;
62, 10 1 300;
63, 10 2 300;

i need coll to change the index and to reorganize all lists grouping all elements for the common new index.

first element used as index:

10, 60 1 200 61 2 300 62 1 300 63 2 300;

second element used as index:

1, 60, 10 200 62 10 300;
2, 61, 10 300 63 10 300;

third element used as index:

200, 60 10 1;
300, 61 10 2 62 10 1 63 10 2;

the order of the single elements in the list doesn’t really matter…

Any suggestions?

Thank you very much!

Dec 11, 2011 at 8:36pm

sounds like you need to use a database-style structure

have a look at this page for possibilities in max:

if you search sqlite in the forums you might get a few more leads….

also if you’re using max6 you might be able to work with the dict range of objects to do what you want…

Dec 12, 2011 at 9:27am

thanks a lot for your help.

I’m new to max and I’m not able to get into SQL.

Do you think it is possible to make this kind of analysis just in max?

Thanks a lot!

Dec 12, 2011 at 10:51am

Do you think it is possible to make this kind of analysis just in max?
yes it is possible without extensions such as sqlite
if you’ve got max 6 then study the dict suite of objects
if you don’t want to do this then here’s a few suggestions:
-look at how you can sort your coll data (sort message)
-look at how you can iteratively process the coll data using uzi, using the length message to query the size of the coll and initialize the uzi
- a coll can reference another coll
–a coll can have more than one instance of itself
-repackage the data using the list operations found in the zl suite of objects (slice, join etc)
- do your patching in small chunks, one aspect at a time, making sure you get one thing right before moving on to the next

Dec 13, 2011 at 4:29pm

Something like this works pretty well too:

– Pasted Max Patch, click to expand. –

You must be logged in to reply to this topic.