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:
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?
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.
You might also benefit from the split object.
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
>
>
>
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.