(universal ?) stack overflow remover
here’s something some people might find useful (or not)
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 392.3ocyTtraCBCDEcs4qvxqoUXmDRR20uippJd3RbEXGEbTRaT92KdLNOpL AZpDpaLvEXt2yLFNDfHop87ZB9I7KXD5P.BARFAT60HRUx9rxjZ3wHps5Rtl DZu05Dc1Jgr3sM7LssLrGiBwTZr4.alaE+Z6aHxskI8iGV3phbakP1TUvA5Y QqWfZTqZlpphKAqHDizwf.yR3.iO3yMR+TSfmze1m6M6QdytiHqj9y0bqWDx oJ+WwpndmngEVejM2x2RXk4GM5Rurw7xFqS1BA9tCVzphhRdejLC1mwhbqdI 42rCqyojvLWtGPj7cMovEAMeuc9pwo3RbpS+ckTKSp.2HOuQjT1G5LX7MM9l nGeSzMlVK9BLkZ5j95HS5pijlHKf4aX64W0df3PJExe9iEfGi908rZ01MYtR 61.homnJmWqExDsPIu3gZFs3yjuRjmykW9IXkHespYz0lgNFfCNRWam+HA4d 7xz7gDo3wsMYri0WlVL9YJ5eXlnCY6D8NyTyEGC9FXA+GON -----------end_max5_patcher-----------
basically this works the same way as a "set $1" message box between two sliders, except it will cause output from both sliders rather than having one "slave" slider.
The idea behind this should not have worked theoretically : i thought "yeah a message comes in a trigger, bangs a gate to pass through it and right after that it rebangs, so the gate will be closed for the next message wich would have been a fedback otherwise." I didn’t think, logically, that the next message to come would retrigger everything, and pass, setting up a loop anyway. Luckily it just works fine, not too sure why, maybe just the time of calculation needed to trigger the thing makes it impossible to have the so feared stack overflow.
I tried it with several kind of messages, the trigger objects outputs a list, so far it works fine for any kind of message. Let me know if there is trouble somewhere.
So, i guess anyone has its own methode to circumvent that kind of max limitation, but maybe will it be helpfull to some people :)
Not sure if I understand the context in which you’re using this, but from my reading this abstraction could essentially be reduced to connecting the inlet directly to the outlet, and doing away with the trigger/gate altogether.
Correct me if I’m wrong Maxers, but my take on [trigger] is that in most circumstances it guarantees execution of its instructions (in this case the [b l b]) before it processes further input. In this case that means you would always open the gate (b), pass the list through (l), and then close the gate again (b). This basically makes the gate unnecessary and adds overhead to your patch.
I suppose the caveat in the explanation of trigger’s behavior would be if trigger was being fed by a higher priority data stream (i.e. MIDI input) that was sending new data before trigger could fully execute. There are several approaches to dealing with this – you might want to use [speedlim] to thin the input data stream, or run Max in Overdrive to bring the scheduler into the high priority thread. You can also adjust the Max-wide scheduler parameters in the Max preferences dialog accordingly.
I guess the more important point for those new to Max is that the scheduler is inherently sequential (serial), even though it appears to support many simultaneous actions (parallel). So don’t worry too much about concurrence and contention for resources until you really find that it’s happening.
These are two ways, much better to prevent stack overflows and still passing changed values. The pattr solution is probably more universal, pattr has a built-in feedback detection…
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 495.3oc2U00aaBCE8Y3WgkelUgA6.zeH6kopHC303JvDAltrU0+6ybMl0rHR ba55j5CwI2Orumy45qySgA3xtChAL5Vz2PAAOEFD.tlbDLaGfa4GpZ3CPZXk 3GckOfirgdj2q3sBHxXZZQbLqfQcQ0hCZHT0Nt5dgy8dttZmTc+1dQk1VaRZ wMwQHVBrFOslXVQ2MuEYMbNlJ+El6X9dmRuT7uJ5q4JtKlZrUpZDZ.yjWrgA 4ufMPHlZrja2n1kb5rWqK8O2KrHDiiPXoR69Bc2TdOGFNsD4q3M1VJ5urNjj TbYgXy+VgHYMgXVDJMsz2lJLzHq8QExxczOBQnqnBYmkoGSIxp812V2b8QgB ZBLJPNYTvPW8439FFz4m5JH5ly0+o+GGDfOKfpWLn65mimms3ef+nndqAqF1 sch2xxQs84lfEMcRE5MnWK52JT7xF3bhgXPC4ceHyJwII4WdFK8S6LlUDxx7 XDi79OhAkA2HU+8e9.Hcx+wbanaruxcTyO9g9CXqMW.kJtV1odQNrixYmrtV .gc8hVY89NiROCABM+FlQLXv8Bh4I3SrnIVgJ2YrRuwWVv7fEYuNVbkHJyCD s4CEQodfH5qCQYTaqEt7yXmXPgWesYM86qjATOX.4CUSIdfnzq.QFimC+M.C G10B -----------end_max5_patcher-----------
i didn’t know those two other ways… the "change" thing is interesting but not accurate in my case, where it’s lists which i want to "loop". But for the pattr object, i don’t know at all how it works and what it does… i’m gonna look that :s
and @Jesse :
"This basically makes the gate unnecessary and adds overhead to your patch."
that’s true, but that’s anyway what makes the thing working… that’s what i was meaning by "it should not work htat way, theoretically" and it’s probably a matter of scheduler time caclcul or whatever.
Anyway, i should have a closer look at the pattr… but that thing looks like a gas factory…
Interesting about [pattr], I didn’t know that. could be quite useful…I wonder how that kind of feedback checking is programmed into the object?
Here’s a way to have dual sliders locked to each other, or each freely moving. Probably there’s a simpler way too, there usually is…
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 697.3oc2XtriaBCEFdMiz7NfPcY5H7Et0cceWOaFEU4.tLtELQXSaZG028hs CYxEx.gDFPcCVw1xme+c94XSd496rbVUrgJbr+j8S1VVuT2iktOUOVMcX4jS 1DmQD5I5DWjmS4RmEaGTR2H0C7HIqhJrKpdcruUvkbRNUO9mKYjrcCwqxqmY FUpWU2ltYI54Vr56eDEraxqKoh5XRjrB9WKowRijgPzCtKrgggpF2sOrWte3 Er+nCO.9vtfrlHielwS2eo7.5kJBqZBM+3fEqVvLdidA5N+682oZqaVb836K Ew+vVjwRnkhaD.8cF.I.fPCIFYPvo+pVj6T3OIk61nUHTjqqWjG9I7xSIUJQ RamPORKSHbxYXDnMFg6xjgh7zL.gZ2jYBf72qol463bFCH3swdjdog9ApFj2 ob+YVRBkevF4fTAbjSEnwNUf5LUfgZr.wiZpHbalH78OSjSEBRJ8TPKnR6O. t75BsBZXWfFi0tPPj+UB5NJ55ZxmXcUFr9ELU0m4imGN1ddPmd9PMi77F2pO dXSQtn+W87tN2XyqOdl6cAir2EF5bqcgfoyEJKRSynWx1O37aeV8E7dUzssS Q5BraeqKp44s+RVU4qnkCIiCaaK24kkvlilQdt8rbkhTKrcVQ3oC8dS9F5oa LwcTtup4p4WhAwqaZoKaDLfZ6sRBsOx7zbSI.Jb1ap.ceDHvTIn2mAd0lJez b0S0SVE3eSrTFNDELLGkYZNYL9I+GC5XoF3H5HJpJiazVy2mYuW.SnBIiq20 6MKkGx9sOlHmkrtn1XrUI1KOeRq2hS8Fd2hSuE.yTwAwSC4B5M4d+Em5CQmu jqWfCMMVtfdKtYJ3lpBI8CbSi3NNrm40goQavdCt4ZEXzzPN0Wu0irp2zjVc 6k3BmlzZuxpty3BIGm6Gf3TcT27O0FPwKC -----------end_max5_patcher-----------
the sw abstraction is your friend here…
-- Pasted Max Patch, click to expand. --Copy all of the following text. Then, in Max, select New From Clipboard.----------begin_max5_patcher---------- 860.3oc2XssbaBCD8Y7WAidsoYPb0ou0uiLY7HCJ1JEjX.Y6zlI+6UHA1HaD VDm3wsufM5xpy4nc0pk2l4.VxdEWCb+g6itNNuMywQ1TSCNsu6.JPullipkC CPw6XKeAbmpKN9Utr4R25ceKmk9qtdnaJXa34XtbZv1VKQ7z0D5pEU3TtZYi Rhu26NWXRRyOwgMO88t2y8o14PxjqfXU+NLoy7Oyn7ZxevRi6KlipY0Rx+cI VYb.XuYZlAEUH6.7yJBJuGTIzNj52Go3pVknUJDVgji2hqpILZOd4.NvGnmm jOggJ9HeKbdOFIj3UMREVRLutFyvOOMqvJwzCyPNBsG5ijPKqv0XJGwaAe+U FsImuXXQUu+mQoXiSdP80ArphjwnMfPalMM2sbBFGIIbTebKGAEUNvj4LV9R T0VRMYYNVauP3.injBDGyIJ736sedjhxJBkqYKLEIrw55zJVdtloT8rcfdxv aIo3cjL9ZosNnVZgT87czBszZerPL8vrUBR4Bc8524fQZlh1lqTYk2UzIAaG GvMu+BYv8X73twi8FH9qq82mMq6O2cCJjQp3yHKExj+WEx5ct04jLwIkWnKo u7mnjyojQWckD9IpjRq9gkJXRv8Qh7.RmNkf4GYVpfgfwDD4wfOYh080xTVQ AVcnI.b6nF9prh1pFQ.6cOt5RgBOl0BOaNNxOvVsH1r29DH6gL04DpojdRz1 z+vpPMaSUZ2lP6Qkt5.OCWyIz82a4wCb3nAtljkoeOAoNSxJYBm8V749jUaa SE1MtWVgaQNUQlmaFXGNAX68uGrStof8bKQczMEpilfV+Y4Y21n.9p5wpQaw YKDqh3HuEHNuhrbCWcjiV8YCUhxGptFQIZKQ4skAt+lBfIT1yHcYphqYGTA4 S0tmM0k2cT8wElatlbOy0jGqJ6DF526RtFKJO3LEkaYk2vO.q4rUqDU+M0u4 PrOrG+7Gmdc0HL9EntbtncM5I78S7UaRRA2scGKX9vjIFb9OTxESDCehniqT vdJFFpJQXNb3RD5yvvu7uPzUbuM3AEwgOXwdavkr2JGg9s3T753bEsr6zDxZ IZMjfP6FamlbX3DCmH01BoXKPzQv9qFRMGlXGlfWMLEXAjBuppTnEHJ3BPj3 k2m8W3RveC. -----------end_max5_patcher-----------
Forums > MaxMSP