Learn Gen in RNBO

Getting Started

Welcome to RNBO

Quickstart

RNBO Basics

Key Differences

Why We Made RNBO

Fundamentals

Audio IO

Messages to rnbo~

Using Parameters

MIDI in RNBO

Messages and Ports

Polyphony and Voice Control

Audio Files in RNBO

Using Buffers

Using the FFT

Export Targets

Export Targets Overview

VST/AudioUnit
Max External Target
Raspberry Pi Target
The Web Export Target
The C++ Source Code Target

Code Export

Working with JavaScript
Working with C++

Gen in RNBO

gen~ is fully functional inside of RNBO. Here we take a look at how to use it inside RNBO and some important details for seamless integration.

RNBO supports gen~ and all gen objects and operators. This means you can fully utilize the existing library of gendsp audio effects as well as your own creations, and deploy them into any of the available target exports.

Like in Max, you simply create a gen~ object in your RNBO patcher. Your gen~ object can be embedded directly in your RNBO patcher, or you can load .gendsp files from disk with the @file attribute. 

You can use codebox inside gen~ as well, which is especially useful if you want to grab some existing DSP code (from musicDSP.org etc). Of course, you can use codebox side by side with other Gen objects.

Single Sample Processing

Like Max itself, RNBO processes audio in blocks. This is normally fine, but certain effects like delays, filters, and physical models rely on very short delays of only a few samples. For single-sample feedback, you can use gen~ inside of RNBO.

Using the Gen Example Library

The Gen example library contains filters, reverbs, physical models, and other audio effects. Since gen~ works inside of RNBO, you can use any of these in your RNBO patches. That includes Gen patches that you've made yourself, or that you've found on the Max forums.

The video shows how to get the Gen gigaverb example from the inbuilt examples, and add it to a RNBO polyphonic synthesizer.

Gen Parameters and RNBO Parameters

If a Gen patch has its own parameters, use the @exposeparameters 1 attribute to expose those parameters to the top level of your RNBO patcher. This exposes the names of any gen~ params as RNBO params, making them available for modulation after export.

Parameter names for gen~ objects will take the form gen_obj_<int>/parameter_name. You can set an explicit name for the gen~ object by setting its @varname attribute. For example, setting the gen~ @varname to foo will result in the exposed parameter name foo/parameter_name

Using the set object

Parameters in RNBO-hosted gen~ patchers can be addressed internally using the set object or exposed as attrbutes in the containing rnbo~ object and exported code. This is done by specifying the name of a param object in the gen subpatcher as an argument to set, then sending the value to the set object. i.e., for a gen~ object with a parameter foo, the parameter can be changed by passing a value to a [set foo] object connected to the gen~ object.

The @exposeparams attribute

Setting gen~'s @exposeparams attribute to 1 (default 0) exposes the names of all parameters in that Gen patcher as attributes of the rnbo~ object (and thus any exported code). By default, each parameter is given a unique name in the form gentilde_obj_<int>/parameter_name. You can set an explicit name for the attribute by setting a varname for the gen~ object in the object inspector. i.e., setting the gen~ varname to foo will result in foo/parameter_name.

Note: The varname must be set in the object inspector. Setting the title or using varname in the object box will not set the parameter attribute name.

gen_in_rnbo_0

Minimum and maximum values in exposed parameters

Please note that if a parameter does not have a minimum or maximum value set in the Gen patcher, RNBO will assign the parameter a minimum value of 0 and/or a maximum value of 1 when those parameters are exposed with the @exposeparams attribute.

Resetting gen~ Parameters

The set object followed by the word reset can be used to reset all parameters of a connected gen~ object. When set reset receives a bang, all param objects in gen~ return to their initial @value.

gen_in_rnbo_1

Filters

The video demonstrates how to grab the lores~ filter example and insert it into the signal processing chain in RNBO. Unlike the other example, this Gen patcher doesn't have any parameters, but uses signal inlets to control the frequency and resonance. For any values like these, you can use the RNBO param~ object to control them at signal rate.

Like many DSP algorithms, the lores~ filter perform calculations involving internal feedback with only a few samples of delay Gen accomplishes this using the history object. RNBO has no direct equivalent for history. In RNBO, if you need access to the immediate sample memory, use the history operator inside gen~.

For feedback connections in RNBO that don’t require single sample delay, you can use the feedback~ object.  The feedback~ object operates in a similar way to the Gen history operator, except it works by introducing one audio vector of delay. The RNBO vectorsize~ object will return the current vector size.

Materials in this article