Counter palindrome mode

May 9, 2011 at 12:03pm

Counter palindrome mode

In mode 2, counter counts up, then down. Is there a way to reverse this so that it counts down and then up?


May 9, 2011 at 12:52pm

Here’s two ways to do it:

– Pasted Max Patch, click to expand. –
May 9, 2011 at 1:09pm

Thanks. Both methods are far more elegant then the hack I’ve been working on. The difficulty with both is that I want to be able to change the counter value using the set message (eg set 5) and for it to proceed counting down and then up.

May 9, 2011 at 1:34pm

ah, that proved to be even more elegant than the other solutions:

– Pasted Max Patch, click to expand. –

Everytime you set the maximum, it also sets the current value, so it automatically goes down first (because there is no more further ‘up’ to go).

May 9, 2011 at 1:58pm

Apologies and thanks for your patience- I’m not explaining this very well. I need the count range to be preserved. I think I’ve got my version working as intended, but it’s a cumbersome piece of code!

– Pasted Max Patch, click to expand. –
May 9, 2011 at 2:19pm

Ah, now I get it. Hope this does the trick:

– Pasted Max Patch, click to expand. –

(you need to “reset” the updown counting, so that it always goes down, regardless of what direction it was going before you set the number)

May 9, 2011 at 6:15pm

a “good” palindrome is difficult.

you can either use plain math (% 16), (!- 16), or you can use 2 independent counters.
for me the latter seems for be simpler when you want to switch counting modes
during play, and also for a “reset” function.

May 9, 2011 at 7:03pm

roll your own palindrome:

– Pasted Max Patch, click to expand. –
May 10, 2011 at 8:23am

Panaiotis’s autocount object has ‘updown’ and ‘downup’ counting modes, as well as various others. You can find it here:
Below is an ‘autocountoid’ abstraction that I made when autocount was not UB, and which also has an ‘uppdownn’ mode, ie. repeating the max and min before changing direction, which is useful for arpeggiators etc.
Iirc, the arguments are count mode, initial value, min, max, step and ms between ticks,

– Pasted Max Patch, click to expand. –

You must be logged in to reply to this topic.