Forums > MaxMSP

control ramps using line

Oct 25 2012 | 4:14 pm


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 ?


Oct 25 2012 | 6:10 pm

Here’s a way using the coll object.

-- Pasted Max Patch, click to expand. --

Oct 25 2012 | 6:47 pm

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

Oct 25 2012 | 6:59 pm

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…

Oct 25 2012 | 7:22 pm


another approach:

— Pasted Max Patch, click to expand. —


Oct 25 2012 | 8:40 pm

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 ?


Oct 25 2012 | 9:56 pm

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. --

Oct 26 2012 | 9:46 am

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 ?


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

Forums > MaxMSP