Converting jit.gen to codebox?

Marigold Maripol's icon

Hi there-

I have been experimenting a bit with jit.gen lately, but I think it would make some sense to convert my work into more standard code blocks. I know "codebox" exists as a code prompt - but is there a way to convert a pre-existing, patched bit of information into straight code?

Thanks!

TFL's icon

Yes!

When in your jit.gen window, click that "C" icon in your right-side toolbar, and it will show you a code version of your patch that you can reuse in codebox.


Marigold Maripol's icon

Well, that's amazing - thank you for pointing that out to me.

One more, maybe slightly more complex idea:
Is it possible to dynamically dump blocks of code into jit.gen, in real-time?

TFL's icon

You can save the content of a [jit.gen] as a .genjit file and then recall that file through the @gen attribute of [jit.gen].

The recall process can be done programmatically by sending a gen path/to/file.genjit message to [jit.gen] but you have to save your genjit file manually first (double-click your [jit.gen] and while having its window in focus, do File > "Save as" or CMD+SHIFT+S. A simple "Save" command will save the parent patcher instead so you really need to use "save as").

Bonus point: .genjit files can be used for both [jit.gen] and [jit.gl.pix], and you can find plenty of them built-in if you search for 'genjit' in the Max File Browser.