[count] object always stutts

Nov 14, 2010 at 8:26pm

[count] object always stutts

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. –
#53313
Nov 14, 2010 at 11:18pm

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 :)

#191787
Nov 15, 2010 at 9:10am

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. –
#191788
Nov 15, 2010 at 10:06am

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.

#191789
Nov 15, 2010 at 10:14am

or this might do instead:

– Pasted Max Patch, click to expand. –
#191790
Nov 15, 2010 at 11:46am

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

#191791
Nov 15, 2010 at 12:14pm

glad to be of help :)

#191792

You must be logged in to reply to this topic.