Forums > MaxMSP

Alternative way of querying coll


pm
May 20, 2010 | 3:33 pm

I was wondering if it is possible to query data from a coll using symbol other than the index.

For example, I have data stored in a coll :

1, alpha beta gamma
2, omega theta zeta

I want to be able to get "beta gamma" when I ask "alpha" and "theta zeta" when I ask "omega", and still has the Integer index. I presume there is a way of doing this with Javascript…

Anybody has a clue?

Thanks a lot for your help guys!


May 20, 2010 | 3:37 pm

hi

you can try something like this. but i think it needs to be adapted…

– Pasted Max Patch, click to expand. –

cheers

g



pm
May 20, 2010 | 3:43 pm

Yeah it works, the principle is there, but I feel that the dump operation would a bit costly on the CPU usage, since my coll is very very large…
Maybe something with javascript or lua…
Still thanks g!



pm
May 20, 2010 | 3:45 pm

And also, since there is many symbols in each index, I presume it would be problematic of getting any of them using iter and match.


May 20, 2010 | 3:48 pm

yes, not very efficient, and you’ll have a problem too if the same symbol is present at different indexes…

g



pm
May 20, 2010 | 3:53 pm

In fact, I think if I was be sure I could do what I want with coll using Javascript, I would spend some time trying to learn it…
Anybody can confirm this is the way to go?
Merci quand même Guillaume!


May 20, 2010 | 11:37 pm

why don’t you just use the initial data element as an index, instead of ints?
T

– Pasted Max Patch, click to expand. –


pm
May 21, 2010 | 12:14 pm

Because I using the coll content with a jit.cellblock and I need the sorting to be steady and logic. That is why is use a Int as an index. I also use "insert" and renumbering to be sure everything is in the same order, which makes it difficult to change it to symbol indexed coll.

Each line of data is like a cue, containing lines of actions that are parsed when I trigger it. Actually, I’m triggering them sequentially, one at a time, but I really need to be able to trigger them with a symbol.

Please help!

Thanks.


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