Why Do I Get Stack Overflow When I Have A Condition That Is Guaranteed to Solve Itself?

Jul 15, 2008 at 6:58pm

Why Do I Get Stack Overflow When I Have A Condition That Is Guaranteed to Solve Itself?

I am trying to build a midi note range limiter, but get a senseless stack overflow message. Here is what my patcher logic looks like:

– Pasted Max Patch, click to expand. –

now, if you remove the patchcord running from the [+12] object back to the [ < ] object, it runs fine. See, eventually the patch will solve itself, because if you add 12 enough times, you’ll eventually get a value higher than what’s given as the bottom note value. Why then will Max not allow this?

#38901
Jul 15, 2008 at 8:10pm

There’s no way for a patch to “know”
that it will solve itself.

Perhaps another look at the paragraph
“The Trouble With Loops” in Max Tutorial
5 might help to refresh your memory as to
why loops are bad things.

#136184
Jul 15, 2008 at 8:14pm

You might also benefit from the split object.

#136185
Jul 16, 2008 at 9:24pm

or zmap?

Gregory Taylor wrote:
> You might also benefit from the split object.
> –
> knowledge is not enough/science is not enough/Love is dreaming this equation
>
>
>


http://pure.test.at

http://www.heartchamberorchestra.org

#136186
Jul 17, 2008 at 9:03am

Note that Max has a finite amount of memory to work with.

If your patch has a feedback loop, Max (or any program) has basically two options: (1) interrupt processing before the stack overwrites some other area of memory or (2) crash.

By and large, the former of the two options is considered preferable.

There are a zillion other ways to implement what you’re trying to do without eating up ridiculous amounts of memory.

#136187

You must be logged in to reply to this topic.