Learn

    Insight · 8 min read

    What is Gen~ and How Dubby Uses It

    Welcome to Gen~, the Max/MSP code export format that powers Dubby's algorithms alongside libDubby. Learn how visual patching becomes embedded audio processing.

    Max/MSP and the Visual Patching Paradigm

    Max was originally created by Miller Puckette at IRCAM in 1988, making it one of the oldest and most influential tools in computer music. Puckette later created Pure Data - an open-source sibling to Max that shares the same visual patching philosophy. Today, Max/MSP (now developed by Cycling '74) remains the go-to environment for experimental audio software. Musicians, sound designers, and researchers use it to build custom audio tools by connecting visual objects - oscillators, filters, delays, math operators - with virtual patch cables.

    Enter Gen~: From Patch to Code

    Gen~ is a special environment within Max/MSP that compiles visual patches into optimized, sample-rate C++ code. While standard Max patches run on a scheduler with some overhead, Gen~ patches run at the audio sample rate - every single sample is processed by your code. This makes Gen~ ideal for low-latency, high-performance DSP.

    The key innovation: Gen~ can export its patches as standalone C++ code. That exported code doesn't need Max/MSP to run. It's just pure, portable DSP - and that's exactly what Dubby runs.

    How Dubby Runs Gen~ Code

    When you design an algorithm in Max/MSP using Gen~, our Dubby Max Patcher lets you build, compile, and flash it directly to Dubby with a single click from within your Max patch - as long as you follow our simple naming and routing conventions. The patcher handles exporting your Gen~ code as C++, compiling it for Dubby's ARM processor, and packaging it with metadata like parameter names, ranges, default values, and display info. The result is an algorithm file that Dubby loads and runs natively.

    This means the DSP runs bare-metal - no operating system overhead, no garbage collection, no scheduler. Just your audio code running at 48kHz with sub-2ms latency from input to output.

    Why Gen~ (and Not Something Else)?

    We chose Gen~ because it hits a rare sweet spot: it's accessible to visual thinkers (patch cables, not text editors), it produces production-quality DSP code, and it has decades of community knowledge behind it. FAUST, Csound, and SuperCollider are all great - but none of them have Max's combination of visual workflow and code export quality.

    That said, Dubby's architecture isn't locked to Gen~. You can also build DSP in C++ with libDubby. The algorithm format is documented and open, and the roadmap includes support for additional code sources.

    Getting Started with Gen~

    If you're new to Max/MSP, Cycling '74 offers a free trial and extensive documentation. Their Gen~ video tutorial series is a great place to start - build a simple delay or filter, then compile and export it with the Dubby Max patcher to transfer it to your Dubby. If you want to share your creation with other Dubby users, upload it to Dubby.Studio where others can flash it directly to their Dubbys.

    For a deeper dive, we highly recommend Generating Sound and Organizing Time by Graham Wakefield & Gregory Taylor - it's a brilliant resource that we all use at the office. And the community Discord is always ready to help with your first patch.

    Once you've built your first algorithm, explore how to load it onto Dubby, or read about why an open platform matters for tools like this.