Forums > MaxMSP

Is there a more elegant way to do this?…

May 28, 2012 | 2:14 pm

Hi,

I’m trying to get only the 4th tick of a counter object. I can do it using the sel object, but I have a feeling there is a better way. I was messing around with expr $i1/4 and although it gives me the right number, it gives a bang on every tick of the counter. I also tried expr $i1/4. ( float version) and that didn’t seem to work either. I thought I would throw this out there because it seems like there has to be a more efficient way to do this.

thanks, Nick

– Pasted Max Patch, click to expand. –

May 28, 2012 | 2:36 pm

See how this is

Benny

– Pasted Max Patch, click to expand. –

May 28, 2012 | 4:15 pm

Module math is often a good way to go for this sort of thing. I’m not at a computer right now so I can’t post an example but [%] followed by [sel 0]


May 28, 2012 | 4:17 pm

what also works is expr int($f1/4.) followed by a [change].

when using modulo, it all fits into one [if] object.


May 29, 2012 | 12:48 am

hello,
there’s this too, which is less subtle than %

– Pasted Max Patch, click to expand. –

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