Gen~ undocumented behaviour - patch can be enabled/disabled with message "enable $1"

Martin D's icon

Hi,

I recently found that a gen~ patcher can be enabled/disabled with the message "enable $1", but I can't see that it's documented. I found some forum posts about this behavior for MSP objects in general (or maybe all objects, I'm not sure), and that it's undocumented.

I assume many here know about it, but the reason I'm posting is because I found it while working through a gen~ abstraction from Generating Sound & Organizing Time: Thinking with gen~ that has a parameter param enable. They use an attrui to set the param, which works as expected, but I used a message box, which instead disabled the entire patcher. It took me a while to figure out what was happening; I didn't think the param was causing the issue since it was used in the book, and also didn't think setting attributes/params using message box vs. using attrui could give different results.

Is this intended behavior for gen~ objects as for other MSP objects, and if so, why is there a difference between using attrui and a message box?

If you have the book, the abstraction is called go.ramp.frombpm.gendsp in Chapter 2, on page 66 (according to Kindle app).

Example patch:

Max Patch
Copy patch and select New From Clipboard in Max.

- MD

P.S. Not to advertise, but must say it's a great book - personally I don't learn easily from books, but with Max/gen and this book (and being interested in DSP) I'm actually learning and enjoying it, which is new to me.

Roman Thilenius's icon

"enable" is a widely supported standard message to MSP objects and gen~ is an MSP sort of object? that should be the explanation.

and indeed it is not much documented or used.

Martin D's icon

Thanks Roman, I assumed that was why gen~ accepts the "enable" message, but why is there a difference between sending "enable" from a message box vs. from an attrui object? The example from the GO book used attrui, but if they had used a message box, the param enable would not have worked.

Graham Wakefield's icon

Wow, I've been working with Max for 20 years and didn't know about this!

I'll make sure to update the patches to replace any "param enable" with something similar, e.g. "param enabled".

Graham

Martin D's icon

Thanks Graham!

Yeah, it's easy to miss seeing as the only mentions of it are in old forum posts. And this very specific case with param enable + message box probably never happens, but I don't get why the message isn't documented so I had to ask.

Thanks for a great book too