Forums > MaxMSP

Indexing coll with floats and Integers


pm
May 17, 2010 | 1:40 pm

I’m looking for a way to store data in coll, and I usually do it with Integers. Since I’m using it to store some cues (1,2,3,4, etc.), I’d like to be able to insert a 1.1 cue. But for indexing data in coll, float are recognized as symbols, so it doesn’t allow the same ordering.
Anybody has an hint?
Maybe storing Integers as symbolized float… That seems tricky, so is there a better way?


May 18, 2010 | 5:08 pm

A typical technique is to multiply (and round) all your float values by some convenient constant (say, 100.0) and use the resulting integers as coll indices.

The only drawback is that you have to decide in advance what your maximum granularity is going to be.


May 18, 2010 | 5:35 pm

Another solution is to not use the que numbers as indexes, but regard them as names or identifiers that you store with each cue.



pm
May 20, 2010 | 3:47 pm

Thanks Peter,
I think it’s the easiest way to do what I want.


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