In the sidebar on the right of Gen you may have noticed a section called ‘code’.
This is a textual representation of the Gen patch, in this case, the defining of an add variable, which is assigned to the addition of inputs 1 and 2, and then assigned as the output. This code panel is a representation only, and if you try to change it, nothing will happen. Luckily Gen sports the codebox operator which is undoubtedly the most unique and extendible operator in Gen.
Create a new [gen~] object, and in the Gen replace the + operator with the operator codebox. This should turn into a text box with the default code
Test out the patch, sounds familiar?
Yes you’re right, this is the same patch as GenTutorial1.1, albeit this time using written code instead of the visual operator +.
Here the presented wished to create a waveshaper, and easily found some code online which he was able to convert into GenExpr code, and thus created a waveshaper in the matter of minutes.
The expr operator has the same functionality as codebox, but lacks the text editor features such as syntax highlighting, multi-line text display, and navigation. Thus expr is most useful for short, one-line expressions, saving time patching multiple operators together.
All patches can be downloaded here.