Learn Delays in RNBO

Getting Started

Welcome to RNBO

Quickstart

RNBO Basics

Key Differences

Why We Made RNBO

Coding Resources

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++

Special Topics

Sample Accurate Patching
Scala and Custom Tuning

RNBO and Max for Live

RNBO Raspberry Pi OSCQuery Runner

Metadata

Export Description

Raspberry Pi GPIO

Updating the RNBO Package

Delays in RNBO

Here we cover several ways of working with delays, including using objects unique to the RNBO patching environment.

There are some new options for using delay lines when working in RNBO, in addition to some familiar workflows. The video on this page looks at how to use delays in RNBO.

A folder containing examples can be found linked at the bottom of this page.

Basic Delays in RNBO

RNBO doesn’t use tapin~ and tapout~ objects to create delay lines, which is a common method in MSP. The simplest way to work with an audio delay line in RNBO is by using the delay~ object. The delay~ object takes two arguments: the maximum delay memory in samples, followed by the initial delay time, in samples.

The @maxsize attribute sets the maximum delay memory using either the vector size or the sample rate of the target platform. This can be useful to ensure that the delay memory remains a function of time. For example, setting @maxsize samplerate*2 ensures a two second buffer on all targets. The @maxdelayms attribute can be used instead to set the maximum delay memory in milliseconds.

Feedback connections

Using feedback~

Feedback connections in RNBO are handled using the feedback~ object. The feedback~ object works in a similar manner to the history operator in gen~ allowing feedback connections. However in RNBO, the feedback~ introduces a delay of one sample vector. You can use the RNBO vectorsize~ object to output the current vector size.

Unlike in Max, send~ and receive~ in RNBO do not introduce any delay when patched in a feedback loop, and so they cannot be patched directly. If you have used to this strategy in the past, simply add a feedback~ object in series and you’ll now see RNBO compile. As you can see in the image, RNBO won’t allow you to create a feedback connection in your audio signal flow without the feedback~ object.

Using gen~

If you'd prefer your feedback delay connections to work on a single-sample basis instead of per vector, use the gen~ object inside RNBO to create delaylines using the history and delay operators. The delay operator in gen~ can been given multiple taps by setting the taps argument to the number of taps you'd like to use.

Building your own Ring Buffer

The delay~ object in rnbo~ is great for making simple delay lines. If you would like more fine-grained control - for example if you want more control over interpolation or separating the reading and writing signal chains - you can create your own circular buffer with splat~, wave~and data to create a 64-bit delay line in RNBO.

We can use splat~ to write our signal input into data, which we can read back using wave~. If you’d like more taps to create a multitap delay, just create additional wave~ objects referencing the same data object.  This is essentially what tapin~ and tapout~ are doing under the hood when you add taps in the tapout~ object. Try experimenting with the following interpolation modes for wave~ : linear, cubic, spline, cosine, step, and none. We can also introduce an allpass~ into our feedback chain to alter the character of the sound. 

You can use allpass~ by itself to create a delay effect with a flat magnitude response (and potentially complex phase response), which can have an interesting effect on transients.

Delay Memory and External Targets

Keep in mind when working with delays that they require program memory. If you make a 1000 sample delay line, that will use 4000 bytes of program memory, assuming each sample is 32 bits. For most targets this won't be an issue, but it may be important if you're exporting to an environment where memory is limited, or if you use a very large number of delay lines.

Grain Delays with granulator~

RNBO's granulator~ object can be fun to include in your delay line patches. The Granular Delay example, found in the RNBO-Delay-Examples.zip further down this page, demonstrates some of the above methods integrated with the granulator~ object.

Multitap Delay using Polyphony

Finally, the video shows how to take Ring Buffer Delay patch and turn it into a multi-tap delay using polyphony. You can add the @polyphony 4 attribute to clone the Delay subpatcher as a different approach to creating a multi-tap delay from the same audio input. Using the @exposevoiceparams 1 attribute allows each voice to have unique parameter settings.

Materials in this article