Forums > MaxMSP

histo for strings?

November 21, 2006 | 6:38 pm

Is there an object or extrenal somewhere out there that can keep a running tally of how many times messages have been received? I have searched around but can’t find anything about this specifically.

Thanks!



jml
November 22, 2006 | 1:26 am

generally, i’d suggest:
[symbol] -> [coll] -> [histo]

it’d be nice to see an example patch that illustrates what you’re after better…

hth,
jl


November 22, 2006 | 3:52 am

Not really much in the way of an example patch needed to say what I was going for…

I was getting lists in the format "i s s" (ie. "1 2C On") and I was looking for a way to keep a running tally of how often each combination came up. I thought maybe if I could turn it into a string there would be some sort of match/histo hybrid.

I ended up going for a more hardcoded approach – using a combination of route and atoi to get unique ID #s for the various lists and feeding them into a series of histo objects. Not the most elegant solution, but it works because I have a pretty controlled # of messages I can receive.

I was trying to stay away from coll because I’ve read that its one of the slower objects for querying data, and timing is relatively crucial for my application. Of course… who knows if my abstraction is really any faster.

/dan



jml
November 22, 2006 | 6:09 am

> I was getting lists in the format "i s s" (ie. "1 2C On")

from what?
you’ll need to be more specific. is the data arriving synchronously? can you use [sprintf]?

you could always use [checklist] by jasch.
it’s 3rd party:

http://www.jasch.ch/dl/default.htm

my idea was simply to have a list of all your possible strings in [coll] (as the indexes) and then to query coll for the numbered index out of it’s middle-left outlet.

> I was trying to stay away from coll because I’ve read that its one of the slower objects for querying data,

this is simply not true.
there are some really really slow ones :)

jl


November 22, 2006 | 6:17 am

Ah, I see now… the coll index thing seems like a pretty clean solution. I guess the stories I’ve heard about its slowness are probably in cases where there is MUCH more data involved.

What I was really looking for (and, it seems, doesn’t exist) is an object that would keep track of these lists *without* it being pre-meditated. In either case we’ve discussed in this thread, adding a new possible combination would require that I go into the code and "teach" that combination to the patch myself…. whereas, with histo, I don’t necessarily have to tell it ahead of time to expect a 6. It just starts tallying once it gets the first one…

The checklist object seems on the right track… but it’s not doing any of the tallying that I needed.

And, to clarify… the list is arriving synchronously from a pack object.


November 22, 2006 | 8:00 am

Dan wrote:
> Is there an object or extrenal somewhere out there that can keep a
> running tally of how many times messages have been received? I have
> searched around but can’t find anything about this specifically.

b -> counter


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


November 23, 2006 | 5:42 pm

Ah sorry…. I should clarify:

I meant how many times various *specific* messages have been received. ie… if i get the message "go Dan go" an object that will keep a tally and say "you’ve received the message ‘go Dan go’ 12 times since I was last cleared"

b -> counter would certainly work if i was only trying to keep a tally of messages overall…. but I need more granularity than that.

as I mentioned earlier… I found a workaround for my particular situation but it seems to be an interesting topic for general discussion.


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