Gen: Resources, Examples, and a Bonus Patch!

    Over the last few weeks, I’ve been writing about how I use Gen in my own idiosyncratic patching life, and how you can use my experiences as an introduction to Gen, in both its audio and video incarnations. But, my Gen education didn’t happen in a vacuum. In this article, I’ll share where I looked for advice and edification when I first started patching in Gen and writing the gen~ for Beginners tutorial series. I hope you’ll find the resources and recommendations presented here to be of use to you, and maybe even have a little fun!
    Way back when, I started my own Gen journey exactly where you probably will: by searching out and investigating the resources that come with Max itself.
    The arrival of Max 8 changes quite a lot of that for you if you’re starting out now, since Max’s search facility brings all the resources together in one place for you to explore by opening up a patcher window, clicking on the magnifying glass icon to display the search window, typing in the word “Gen,” and browsing through the results.
    Double-clicking on that link in the Documentation tab will display the Gen launch page:
    Those links on the left-hand side open up more detailed documentation on specific topics:
    I used that documentation (which is much more detailed than what I covered in my beginner tutorial series) as the starting point. And went from there.
    Max 8’s search facility makes it easier to work through those resources. In addition, there are now a number of example patches that come with Max that will provide you with some interesting examples and samples for self-study.
    I thought I might take a minute to talk a little about those examples. They’re certainly not all that’s out there, of course – and, happily, Max’s search facility also will direct you to interesting Forum posts about using Gen under the Posts tab.
    One great place to begin is the Gen Patch-A-Day series.
    It’s a collection of beginner patches that my Cycling ’74 colleagues and I put together as a group project over the course of a month a while back as we were learning about Gen in-house. They’re as varied as group of starter patches as we are as persons, and a lot of fun

    Watching and Listening – the gen~ examples

    To get started exploring the gen~ example patches, just do a search for the word Gen and then scroll down to the examples tab. Helpfully, the gen~ patchers are all listed before their Jitter counterparts, since g precedes j in the alphabet. There’s a lot there to explore, from seeing just how easy cross-synthesis becomes when your gen~ patcher is hosted by the MSP pfft~ object… considerably more complex work. I’d like to suggest two (okay, three, if you count the bonus patch at the end of this article) interesting examples of some more complex gen~ patching.
    As we’ve discussed in the past, while the Gen codebox operator provides a convenience for people who enjoy text-based coding (a club to which my dues have lapsed), there are a few places where gen~ patching requires a codebox operator - procedural operations, situations where you need specific and explicit control of the order or reads and writes for things like delays and operations on data and buffer operators, and the facility for creating reusable tools (For more on this, this tutorial will help you get started).
    I’d like to show you two examples where codeboxing is not only needed/useful, but shows spectacular results.
    First up is an absolutely exquisite Moog ladder filter from MSP wizard Peter Dowling. Peter started with Victor Lazzarini’s Csound port of the ladder filter, and created a codebox-based gen~ patch that’s an elegant demonstration of the poly~ object’s up/downsampling capabilities.
    When it comes to the gen~ heart of his patch, Peter uses the require operator in the codebox. That message tells the gen~ object it needs to load the file from disc. It’s a classic use of the technique.
    Our next “codebox on parade” example is Graham Wakefield’s gen.chopper.repeat gen~ patch: an example of using the codebox operator to manage read and write operations in a complex patch that has separate read and write portions of the patch and lots of procedural code, as well.
    This gen~ patch is one of a pair or example patches — gen~.chopper.maxpat and gen~.chopper-repeat.maxpat — that Graham Wakefield developed as a way of investigating Trevor Wishart’s idea of wavesets, which involve chopping up audio material by the zero-crossings and recombining them. The gen~.chopper.maxpat example is simpler, and doesn’t use a codebox operator, unlike the example I'm highlighting here. Graham Wakefield (who developed both patches) has this to say about the pair:
    Basically, the patcher has two parts: a recording part (left side) and a playback part (right side). In the case of the gen~.chopper.maxpat patch, the recording part is basically sampling in1 and looking for full periods of a waveform by segmenting on any positive-direction (rising) zero-crossing. Each sampled segment is written into a different channel of the data segments, so at any time there’s a bank of 16 waveforms (though one of them is currently being re-recorded - the one indicated by the use of the history writesegment operator. The data len operator stores the length of each of these 16 waveforms. The playback part reads through these waveform segments using the peek segments operator at a rate given by param rate, and at the end of each, the peek segment operator jumps to the most recently completed waveform (the history playsegment operator). The gen~.chopper-repeat.maxpat example show you've selected is a lot more involved, but is still bascially a recording section and a playback section. In this case, the codebox operator was used because it provided an easier way to deal with the logic.
    Once you’re finished having a great time exploring the patch, it’s a great example of the codebox operator in action.

    From the Familiar to the New – the Jitter gen examples

    The Jitter examples folder is in your Examples/Jitter/gen directory, and its contents are both different and somewhat more practical for the modern Jitter user trying to make the jump from matrix to texture-based Jitterizing. The folder contains a number of examples of things you already work with – you’ll find some very familiar names (e.g. jit.pix.eclipse.maxpat). Those patches contain jit.pix/ equivalents of the vanilla Jitter objects you work with all the time – you can just drop the .genjit files into your working folder or search path, add a @gen eclipse object to your patch and use this when porting your patches to the GPU.
    You’ll also find some cool jit.pix/ examples that aren’t in the standard Jitter object set at all, with interesting names – the infinite mirror, for example - and more interesting insides that’ll provide you with examples of repositioning and image manipulation to explore.
    Would you like to see how displacing a texture using polar co-ordinates works? There’s an elementary example in the file to puzzle out for your edification:
    Here’s a texture generator I am particularly fond of - It uses a weighted color palette and random feedback to create beautiful evolving images.
    It also provides an example of how feedback can be handled by combining jit.pix and jit.slab objects.
    There’s plenty here to read and to study – and, in the case of the jit.pix/ GPU-based examples of the Jitter objects you already now, plenty to help you on your way as you move from matrices to textures..

    Another Moog Ladder Filter (Bonus Patch!)

    Before I go, I wanted to share one more piece of gen~ awesomeness with you - something that I know some of you have been looking for: Peter McCulloch’s version of the Moog Ladder filter. (Download at the end of this article.)
    The patch is a port of a version of the Moog ladder filter originally created at the Zurich University of the Arts by Beat Frei. Peter got the necessary permissions to port the code as a gen~ patcher (Look Ma — no codebox operator!), and added some nice improvements that make it the perfect replacement for the svf~-based filter you’ve been using.
    Although it’s been unavailable through the Forum, the gen~ patching was hiding in plain sight all along inside the BEAP Ladder filter, but you can’t expect anyone to neccessarily know that, can you?
    So here, courtesy of our mutual friend Mr. McCulloch, is a copy of his Moog Ladder filter gen~ patcher. You (and I) owe him a pint, at least.

    • Feb 20 2020 | 6:31 am
      Going in my To Read bookmark folder! Thanks for this Greg, your examples are really helpful. And you've piqued my interest with the moogvcf, I used to the use the Lazarrini one in csound many years ago, it's really nice!