Forums > MaxMSP

[count] object always stutts

November 14, 2010 | 8:26 pm

Hello

I have a problem with [count] driven by a signal. I want to reset this object decently in some kind of loop use. If I am right, the only way to do this is to send a 0 signal to it. I’m pretty sure to send only one sample at 0, the others are at 1 – I used the capture object to check. But when I do that, the object first stops (+ resets) and then starts to count again resulting two successive 0 in counting.

Is there a way to do it cleaner ? I mean with only one 0 ?

Thanks for any help
A patch is attached that shows the thing

– Pasted Max Patch, click to expand. –

November 14, 2010 | 11:18 pm

sorry, no example patch cos i don’t have max on this machine, but…

use [+=~] instead of [count~]. send a constant [sig~ 1.] to one input of a [bitxor~], and a [click~] to the other. also connect the [click~] to the right inlet of [+=~]. connect the output of [bitxor~] to the left inlet of [+=~]. voila! one click-resettable zero-indexed sample counter.

hope this helps :)


November 15, 2010 | 9:10 am

Thanks a lot Chris…

It works very well, the [+=~] don’t do the 0 twice on reset.

I have to check in my original patch now if I can use it like this since I use the ‘maximum’ argument of count

Here’s the patch as you explained it :

– Pasted Max Patch, click to expand. –

November 15, 2010 | 10:06 am

that’s it, you got it!

regarding the count limit, that’s a bit tricky…

you could always modulo the output of [+=~] with [%~], but eventually you will run out of precision i think. but if you are re-triggering every now and then it shouldn’t be a problem.


November 15, 2010 | 10:14 am

or this might do instead:

– Pasted Max Patch, click to expand. –

November 15, 2010 | 11:46 am

Oh ! That’s great, Chris…
Thanks again
Have a nice day… or night.


November 15, 2010 | 12:14 pm

glad to be of help :)


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