Forums > MaxMSP

Non-looping count~

November 3, 2013 | 6:09 am

Apologies if this has been answered a million times before, but I just can’t find anything that tells me how to get count~ to stop once hitting its maximum.

From the documentation, "It can be set to loop…" – I can’t see how it doesn’t loop?

Thanks in advance and apologies if this is a daft question, I’m just getting started.


November 3, 2013 | 7:43 am

If you just want it not to loop, don’t set a maximum. But if you want it to count from a to b, you can send its output through a gate~ and close the gate~ when you hit b. Something like this:
<code>

– Pasted Max Patch, click to expand. –

</code>


November 3, 2013 | 9:20 am

Ah, now that makes much more sense out of the "It can be set to loop" comment in the documentation! Thanks so much for the help.


November 5, 2013 | 7:27 am

Cheeky follow-up question… what’s the quickest (i.e. with least delay) way to send a bang following count~ hitting the "maximum" handled by the gate~?

I’ve been using line~ with wave~, but would prefer to use count~ with index~ and the main functional difference is that line~ bangs on finishing its ramp.

The obvious options are to use number~ or snapshot~, but I was concerned that these would introduce a meaningful delay, i.e. more than a handful of samples?


November 5, 2013 | 8:39 am

The edge~ object is probably your best bet. It will give you a bang that is accurate to within the duration of one signal vector.
<code>

– Pasted Max Patch, click to expand. –

</code>


November 7, 2013 | 8:33 am

Brilliant, not sure how I missed that one, but looks really handy.


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