## Increase values? – noob question!

Jul 24, 2006 at 10:48pm

# Increase values? – noob question!

I’m trying to make a patch can slide from values between 2 dials which control volume. It does this by the values of the 2nd dial from the value of the first then dividing it by the metronome speed. This value should then be added to the current volume value 1 millisecond at a time until it reaches the value of dial 2. (really hard to explain)

my question: How can I add 1 number to another until it reaches the correct value? all the ways I tried ended up with a stack error.

#26911
Jul 24, 2006 at 10:53pm

not sure what you mean ? but i think [bline] might hold the answer ?

#80974
Jul 25, 2006 at 8:57am

To avoid stack overflow in general, read up on the ‘set’ message that
is available for practically every object you’re using.

something like

metro -> gate -> int -> + (or accum) -> dial

The gate’s left inlet will be controlled by a test for whether the
dial has reached the desired value. Something like a < object with
the current value in the left inlet and the desired value in the
right inlet. (Alternately, you could skip the gate and just have the
test turn the metro on and off as needed.)

This is covered in the Max Tutorials 15 & 17. Have you understood
what’s going on there?

(*) In general, if you can describe a problem precisely enough so
that other people can understand it, you’re half way there to solving
it yourself.

– Peter

On 25-Jul-2006, at 0:48, David Butler wrote:

>
> I’m trying to make a patch can slide from values between 2 dials
> which control volume. It does this by the values of the 2nd dial
> from the value of the first then dividing it by the metronome
> speed. This value should then be added to the current volume value
> 1 millisecond at a time until it reaches the value of dial 2.
> (really hard to explain)
>
> my question: How can I add 1 number to another until it reaches the
> correct value? all the ways I tried ended up with a stack error.
>
>

————– http://www.bek.no/~pcastine/Litter/ ————-
Peter Castine +–> Litter Power & Litter Bundle for Jitter
Universal Binaries on the way
iCE: Sequencing, Recording &
Interface Building for |home | chez nous|
Max/MSP Extremely cool |bei uns | i nostri|
http://www.dspaudio.com/ http://www.castine.de

#80975
Jul 25, 2006 at 11:02am

David Butler wrote:
> my question: How can I add 1 number to another until it reaches the
> correct value? all the ways I tried ended up with a stack error.

This sounds like you didn’t think about the time. If you tell the
computer to increase within a loop, it would try to do so within no
time. The time is the key. I guess you didn’t tell how slow you want
this to happen.

look into the following objects: line, delay, pipe…
And of course all those tutorials.
For your specific question, I made an abHaxion resembling the Pd object
called “until”. You can find it at the share pages of c74. Look into it
to find out how to stop a loop…

Stefan

Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#80976
Jul 25, 2006 at 2:54pm

> my question: How can I add 1 number to another until it reaches the correct value? all the ways I tried ended up with a stack error.
>