Best way to save gen~ code within a max patcher and within gen~?
So I have an occasional problem that I can't reproduce where a gen~ patch inside my main Max patch will just revert to the default in1 + in2 = out3 and my code vanishes into the ether so I have to use Time Machine to get it back. Do I have to save every gen~ patch and then name it as an argument on my gen~ object? And there seem to be several ways to do that, like if my .gendsp file is called window.gendsp should it be [gen~ window] or [gen~ @gen window] or either of those with "window.gendsp" instead of "window"? Not clear what is the best way.
Then, when I create a sub patch inside my gen~ patch, using a gen object, is that sub patch going to be saved reliably within my .gendsp file, or do I need to save that sub patch too and call it as an argument within my gen~ patch? I'd rather not be calling files within files, it seems like it would be better to save my gen~ patch as one file if possible?
I just want to have a stable reliable system
Hi,
I've had the same problem of losing code in gen~, and also intermittently. I have found that when you give a gen~ patch a name without using any attributes (@gen or @title) - sometimes I get a prompt to save as gendsp, sometimes not. I've assumed there is some right way to do this so that you don't worry about losing work.
Here is how I think it works. Someone please confirm or correct:
[gen~ @gen myGenfileName] Will prompt to save the gendsp file.
[gen~ @title myNameWiPatch] Doesn't save a gendsp file, but is helpful when you have multiple gen~ subpatches in a patch.
[gen~ myGenName ] No @attribute given. This sometimes prompts for gendsp, sometimes not. To me, this is not the best solution. I will avoid it and use the @gen attribute when I want to save as gendsp.
[gen~ ] No name. Embeds in the patcher. This seems OK, but you can't ever reuse it.
Gen subpatcher within gen~
I have not had problems loosing code here, but I think it is a good practice to use @title or @gen. The problem with @gen is that if you have a lot of these, you quickly get a lot of gendsp files everywhere. My experience is that many are unique and will never be reused.
gen~ vs gen at main patch level
[gen @title myEventGen]
Plain gen is good for event processing at sample rate, when you don't use the audio signal.
Again, any further clarification or correction is welcome!
https://cycling74.com/forums/contents-of-gen-patchers-disappearing
Ok so gen~ content is still dissapearing 8 years on... I’ll try naming and saving the .gendsp files from now on.
I’m still not sure what is the best practice for encapsulation within a gen~ patch. That thread doesn’t mention it. Is it safer to use an un-named gen inside a gen~ patch?