PRESET HELP ! Stack overflow in UMENU

azahn123's icon

I want to be able to both click on a preset and it SHOW the name of the preset in a UMENU +++ AND+++ Be able to select an item in that same UMENU and have the preset change...
BUT I am getting a "Stack Overflow" warning with the way I have it set up...
Any suggestions ?

2266.presettest.maxpat
Max Patch
Emmanuel Jourdan's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Have a look to the set message:

azahn123's icon

I pasted youre code... But it is only a preset object

seejayjames's icon

as ej said, use the "set $1" message. this is the same in many cases where you want to have visual feedback *back* to an object after a number comes out (like if you want a slider to go into a number box, but changing the number box also sets the slider level). Without "set" in the loop, you're choosing a umenu number, it goes into the preset and selects it, the preset sends the number out into the umenu, it sends it back into preset, etc... not allowed. Put "set $1" between preset and umenu so that the umenu actually selects the preset (which is the overall goal) but when you click a preset, it will only *set* the umenu selection.

Also, umenu counts from 0, but preset counts from 1, so you will need to use +1 and -1 respectively.

seejayjames's icon
Max Patch
Copy patch and select New From Clipboard in Max.
azahn123's icon

Thanks !

Emmanuel Jourdan's icon

oups… sorry… it was probably to early to write on the forum ;-) seejayjames example is what I was thinking about.

Russell Richards's icon

I had the same problem with setting symbols in a umenu i.e. "symbol vid_1.mp4" would go in and come back out again causing a loop. Solution: "setsymbol vid_1.mp4" sets without output.

I needed this post to get me through that. Still useful 12 years on.

Cheers.