Stack Overflow Errors with pattrstorage

fas11030's icon

Every time I try to recall a preset with pattrstorage in a patch I'm working on, I'm keep getting stack overflow errors related to seemingly random objects. First it was with a sprintf object. I got rid of it. Now, the error message directs me to a message object elsewhere in the patch. Can somebody help me figure out why this is happening? Better yet, if someone can tell me the best way of creating a save/recall patch for my application. I'm trying to create a save/recall from 1 to 55, corresponding to the scene number from an Ableton session (I'm using live.observer to feed this patch over UPD receive with the active scene number in an Ableton session). Any help would be greatly appreciated!



TrackingPatch.maxpat
Max Patch


Source Audio's icon

exclude elements that control pattr itself from storage

fas11030's icon

I don't think I understand. What elements are those?

fas11030's icon

The error which says stack overflow now points to this message object. Why would this message control pattr from storage?

fas11030's icon

When I route the exclude outlet of the autopattr object in that subpatcher to that object, I still get the same error.

TFL's icon

I had a few times this happening (stack overflow happening on various objects) and it happened that all objects indicated as culprits were more or less related, in the same patch cord chain, and I ended up finding the actual culprit by trial and error.

Difficult to see anything in small parts of what seems a giant patcher.

Maybe your best bet is to make a backup of your patch, delete half of it, see if the problem persists, and if not you know that the culprit is part of that half you just deleted. Then start over from the clean patch and delete half of that half, and repeat until you find the source.

Source audio was suggesting that maybe in all your pattr-controled objects you had some that were trigger some preset recall/interpolation, hence the feedback loop.

But maybe that's something else. You're using [pattrstorage @greedy 1] with [autopattr @autoname 1] so you are basically exposing every possible object to pattrstorage. Maybe when some of these get recalled together they don't play well because they both impact each other.

Also, message objects (and most regular max objects like [sprintf]) are not part of the pattr system so it won't do anything to 'exclude' them, they are already. And the @greedy 1 on your autopattr is useful only to store attributes of attached objects, which you have none.

fas11030's icon

I think I figured it out. I connected the number objects that control the preset store and recall to the exclude outlet of the autopattr object, and that seems to be working for now. Thanks!