Forums > MaxMSP

Increase values? – noob question!

July 24, 2006 | 10:48 pm

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.


July 24, 2006 | 10:53 pm

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


July 25, 2006 | 8:57 am

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

To your problem. Your description is vague-ish.(*) I think you want
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


July 25, 2006 | 11:02 am

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


July 25, 2006 | 2:54 pm

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

if the [!+ ] object does not help you here, maybe
[110.ATC] does after you changed a few things inside
it to your liking.


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