Mute in gen~

pm's icon

Probably a stupid question...

I'm trying to make use of multiple voices of gen in a poly~. Is there a way to mute a gen~ instance in order to save some CPU when it is not in use? I guess it has to be always in use, but since the "mute" message to poly is not at audio rate, it will not be as efficient as it would be in gen~.

Thanks!

Graham Wakefield's icon

Hi there,

The gen~ object will not use any CPU if the patcher it is contained in is muted, such as a muted poly~ voice. This is the most efficient way to handle it, and definitely more efficient (if not as accurate) as checking the muted state at audio-rate would be!

Graham

pm's icon

Thanks for the info!

Shakeeb Alireza's icon

Great advice by Graham.

This also worked for me:
- add [pass] at the output outlet(s) inside a [gen~] patch
- then create a toggled [mute~] object in the [gen~] object's parent patcher and connect it to the [gen~] object.

Graham Wakefield's icon

Just to clarify, the [pass] operator in gen~ doesn't do anything. It is not related at all to the pass object in Max, and has nothing to do with mute~.

(The [pass] operator in gen~ is explicitly meant to be an operator that does nothing -- it is useful as a "placeholder" while patching, or as a way to organize patch cables, nothing more. )

Shakeeb Alireza's icon

Thanks for the clarification, Graham. My bad. I had something else going on which was actually doing the work. The [mute~] object didn't do anything in this instance.

What actually did the trick was adding a conditional based on a a `mute` or `bypass` parameter to switch on or off the expensive dsp code. I've converted the gigaverb example to demonstrate this which is attached to this post as a zip file.

test_bypass.maxpat.zip
application/zip 3.98 KB
demonstration of gen bypass or mute

Shakeeb Alireza's icon

Incidentally, is there any example of poly~ wrapping gen code with mute that someone can point to?

Shakeeb Alireza's icon

Incidentally, is there any example of poly~ wrapping gen code with mute that someone can point to?

Just found this good example of gen in poly in a forum post by LVDW: (see https://cycling74.com/forums/gen-in-poly)