continuous subtraction

Thinksamuel's icon

Probabbly a rtfm-question but i don't know. I have a number box with a value. From that value I want to subtract every 1000 milliseconds 1.
so you go from 10 9 8 7 ... until 1
The metro sends a bang avery 1000 ms and triggers the calculation but only one calculation is done,everytime 10- 1 = 9
So i connect the result number box to the first number box (where 10) but then i get a stack overload, how do I make the function work.
Thanks

LoneMonad aka don malone's icon

please post the problem part of the patch

Thinksamuel's icon

here you go: I am pretty sure it is a stupid mistake i make but I don't know which one :s

Max Patch
Copy patch and select New From Clipboard in Max.

ebmoluoc's icon

Hi,
Try something like this:

Max Patch
Copy patch and select New From Clipboard in Max.

On Dec 16, 2007 10:06 AM, Samuel Van Ransbeeck wrote:
>
> Probabbly a rtfm-question but i don't know. I have a number box with a value. From that value I want to subtract every 1000 milliseconds 1.
> so you go from 10 9 8 7 ... until 1
> The metro sends a bang avery 1000 ms and triggers the calculation but only one calculation is done,everytime 10- 1 = 9
> So i connect the result number box to the first number box (where 10) but then i get a stack overload, how do I make the function work.
> Thanks
>

LoneMonad aka don malone's icon

try this

Max Patch
Copy patch and select New From Clipboard in Max.

Thinksamuel's icon

thanks, it works.

Chris Muir's icon

At 8:24 AM -0700 12/16/07, Samuel Van Ransbeeck wrote:
>here you go: I am pretty sure it is a stupid mistake i make but I don't know which one :s

The set message is your friend:

Max Patch
Copy patch and select New From Clipboard in Max.

--
Chris Muir | "There are many futures and only one status quo.
cbm@well.com | This is why conservatives mostly agree,
http://www.xfade.com | and radicals always argue." - Brian Eno

notyouraveragejoe's icon

Also "int" is very handy in these situations if you want to put a number
somewhere but not send it til later.

On 16/12/2007, Chris Muir wrote:
>
> At 8:24 AM -0700 12/16/07, Samuel Van Ransbeeck wrote:
> >here you go: I am pretty sure it is a stupid mistake i make but I don't
> know which one :s
>
> The set message is your friend:
>
> #P toggle 11 78 15 0;
> #P window setfont "Andale Mono" 9.;
> #P window linecount 1;
> #P newex 11 100 60 465436681 metro 1000;
> #P button 11 121 15 0;
> #P newex 90 133 65 465436681 prepend set;
> #P newex 90 162 27 465436681 - 1;
> #P window setfont "Andale Mono" 12.;
> #P number 90 188 35 12 1 0 1 7102 0 0 0 221 221 221 222 222 222 0 0 0;
> #P fasten 0 0 2 0 95 219 166 219 166 119 95 119;
> #P connect 2 0 1 0;
> #P connect 1 0 0 0;
> #P fasten 3 0 1 0 16 154 95 154;
> #P connect 4 0 3 0;
> #P connect 5 0 4 0;
> #P window clipboard copycount 6;
>
> --
> Chris Muir | "There are many futures and only one status quo.
> cbm@well.com | This is why conservatives mostly agree,
> http://www.xfade.com | and radicals always argue." - Brian Eno
>