UpDown Counter needs to count first and last number twice…?

May 3, 2010 at 4:17pm

UpDown Counter needs to count first and last number twice…?

greetings.

iam using a counter to drive a step sequencer.

i want to add “palindrome” (play forward,play backward and so on) playback to it.

the problem is to keep it in sync.

i made a (counter 1 16) and set it to mode3 (count up then down)
the problem is.. it counts … 14 15 16 15…
but to stay in sync i need it to count … 14 15 16 16 15 14…
so the first and the last number have to be counted twice.

is this possible with just one counter?

#50153
May 3, 2010 at 5:05pm

It’s not pretty:

– Pasted Max Patch, click to expand. –
#180064
May 4, 2010 at 3:10am

oh yeah, when i made my first counter with both a palindrome and
backwards/fprward mode i almost kicked the computer out of the window.

that was somewhen between the fifth and sixth attempt.

making it just run somehow is easy, but to make the “reset” work, change
the direction by user input, or changing the mode it is quite complicated
with only one counter object.
 

#180066
May 4, 2010 at 8:40pm

hey guys.

i thank you very much.
i got really mad while i was trying to figure it out myself.

#180067
May 5, 2010 at 7:46am

Two more goofy solutions:

– Pasted Max Patch, click to expand. –
#180069
May 24, 2010 at 7:33pm

Hey all, brilliant. I can’t believe how much time I spent trying to make counter do what it seems like it should just DO out of the box. Thanks!

Look, I didn’t even have to post a question.

#180070
May 25, 2010 at 5:58am

Hello maxers,

another pretty way ….

– Pasted Max Patch, click to expand. –

… from the modulo team !

#180071
May 25, 2010 at 8:22am

Wow. Here’s my new teaching example for the adage “There’s more than one way to do anything in Max.”

While palindromes for your drum machine are things that you would definitely want, this is a *counter* object, and you don’t duplicate upper or lower numbers when increment or decrement counters as the more general case, I think.

As long as you’re at it, why not add inlets and outlets as required and save the one of these you really love in your patches folder with a nice name (palindrum?)? That way you can just type “palindrum” into an object box and never worry about it again!

#180072
May 25, 2010 at 9:34am

Agreed, GT, I’m amazed at how many ways there are to do this. Here’s a non-drum-machine application for this functionality. I’m using counter to fade two panels’ alpha channels, for a game-based patch. (The lit-up panel shows whose turn it is). With counter, the panels would fade in one direction (let’s say it’s fading out) and then “snap” back on at the end. So the final state always ended up being opposite of what I wanted. Perhaps there’s an easier way around this, but:

– Pasted Max Patch, click to expand. –
#180073
May 25, 2010 at 9:37am

P.S. Vanille’s way is awesome though. I aspire to that level of elegance. (As you can see, I have a lot of perspiring to do)

#180074
May 26, 2010 at 2:05pm

And here’s another – not mine, I hastened to add, but I’ve been using it for so long, I’ve forgotten where it came from. Essential for arpeggiators too…

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

You must be logged in to reply to this topic.