Is there a more elegant way to do this?…

May 28, 2012 at 2:14pm

Is there a more elegant way to do this?…

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. –
#63515
May 28, 2012 at 2:36pm

See how this is

Benny

– Pasted Max Patch, click to expand. –
#228959
May 28, 2012 at 4:15pm

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]

#228960
May 28, 2012 at 4:17pm

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

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

#228961
May 29, 2012 at 12:48am

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

– Pasted Max Patch, click to expand. –
#228962

You must be logged in to reply to this topic.