control ramps using line

Oct 25, 2012 at 4:14pm

control ramps using line

Hello,

I am trying to use line to transition between two values (0 and 254) in 3 different ways:
1. ramp up (0-254)
2. ramp down(254-0)
3. ramp up then down (0-254-0)

My inputs are two ints: the first to tell the type of ramp (0 = up,1 = down,2 = up then down) and the time to for the transition.

I kind of got it working, but I’m still a n00b and this feels a bit hacky/not very elegant

– Pasted Max Patch, click to expand. –

What would be the elegant way of achieving this ?

Thanks,
George

#64919
Oct 25, 2012 at 6:10pm

Here’s a way using the coll object.

– Pasted Max Patch, click to expand. –
#234058
Oct 25, 2012 at 6:47pm

Woow, this is pretty neat, thank you!
Quite a few neat tricks to pick up, including the , in the coll.

#234059
Oct 25, 2012 at 6:59pm

The comma in Coll is pretty handy to know but I’ve noticed a bug in Max 6 compared to Max 5 regarding “,”
In Max 5, I can add , in Coll via the textedit window but in Max 6, I can’t. Hmmm strange…

#234060
Oct 25, 2012 at 7:22pm

Hi,

another approach:

– Pasted Max Patch, click to expand. –

Cheers,
Ádám

#234061
Oct 25, 2012 at 8:40pm

Interesting approach Ádám.

Guys, I’ve got another question related to this.
Is it possible to send multiple lists simultaneously and transition numbers in parallel ?
I’ve slightly modified Fora’s inputs and now pressing each message at a time works as expected, but pressing all
means the messages override each other, and since Max evaluates right to left, the leftmost message is being remains updated:

– Pasted Max Patch, click to expand. –

If so, now can this be approached ?

Cheers,
George

#234062
Oct 25, 2012 at 9:56pm

Hi George,

if you wanted to execute all three messages in a sequence then the patch I knocked up could be tweaked to do that. But banging all three messages at once will only confuse the patch as it requires a system to deal with the influx of messages.

One way around this is to create a simple sequencer using a counter object that’s triggered via the right outlet of the line object (which outputs a bang when finished processing a message)

Here’s an example using Ádám’s patch..

– Pasted Max Patch, click to expand. –
#234063
Oct 26, 2012 at 9:46am

Thanks again Fora,

This might actually work if the interval isn’t too large.

I was hoping to have an individual ramp for each pair of inputs,
running multiple ramps at the same time. I was looking through the documentation
and I’m thinking about encapsulating your solution and using JavaScript to create
multiple instances which can run in parallel, then remove them when complete .

Does this sound reasonable or is there a better way to handle this ?

Thanks,
George

#234064

You must be logged in to reply to this topic.