Forums > MaxMSP

Non-looping count~

Nov 03 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.

Nov 03 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:

-- Pasted Max Patch, click to expand. --


Nov 03 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.

Nov 05 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?

Nov 05 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.

-- Pasted Max Patch, click to expand. --


Nov 07 2013 | 8:33 am

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

Apr 19 2016 | 3:04 am

otherwise you could also make it stop by using [maximum~ 123456] or multiply its output by the output of [>~ 123456]


Apr 19 2016 | 3:49 am

just for fun, here’s a gen~ example:

— Pasted Max Patch, click to expand. —
Viewing 8 posts - 1 through 8 (of 8 total)

Forums > MaxMSP