Learn Sample Accurate Patching Reference

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

Special Topics

Sample Accurate Patching

Intro to Sample Accurate Patching

Sample Accurate Patching Reference

Scala and Custom Tuning

RNBO and Max for Live

RNBO Raspberry Pi OSCQuery Runner

Raspberry Pi Debug Interface

Metadata

Export Description

Raspberry Pi GPIO

Updating the RNBO Package

Sample Accurate Patching Reference

With RNBO it is possible to create patchers with exact timing. This means, for example, that an ADSR trigger could occur at the exact sample when the MIDI note that triggers the note arrives.

All events in RNBO are timestamped, which means that any audio processing object can, in principle, assign an event (including MIDI events, internal message events, and all other events) to an exact sample. In general, most objects do not do this, which gives you the flexibility to decide when you need sample accuracy, and when it's fine to handle events once per signal vector.

Converting to a Sample Accurate Signal

Any object with an inlet marked auto can accept either number events or signals (auto inlets cannot handle lists).

Screenshot 2022-02-18 at 16.43.03.png

The objects sig~, click~, line~, and curve~ can convert events to a sample accurate signal. You can use these objects in conjunction with any auto inlet to handle messages in a sample accurate way.

Screenshot 2022-02-18 at 16.51.11.png

Events vs. Signals

RNBO currently supports two types of data flowing through its graph (flowing through the patch lines from object to object).

  • events: a single number or list sent through the grey patch cords. All events are timestamped, meaning they can be associated with an exact microsecond time and an exact audio sample.
  • signals: audio signals, which means 44100 (or whatever sampling rate you are using) numbers per second, running through the striped patch cords.

Events can be sent to the RNBO engine from the host, or else are generated by RNBO itself. Once they arrive, they are timestamped and put into an ordered queue. Once per signal vector, RNBO will pull events off the queue, process them first, and then process all audio buffers. This means that most audio processing objects will only handle one event per signal vector.

Signal to Event Conversion

Consider this (somewhat academic) example:

Screenshot 2022-02-21 at 11.32.50.png

Interestingly, this example will introduce exactly one signal vector of delay. Here are the relevant processing stages:

  • The edge~ object detects a zero-to-one transition, and outputs a timestamped bang event. Because events are processed after audio, the bang event from edge~ will not be processed until the next signal vector.
  • The host advances by one signal vector, and calls into RNBO to fill the next audio signal buffer.
  • The click~ object receives a timestamped bang. Since the click~ object accounts for event timestamps, it generates a sample-accurate signal output that includes the appropriate time offset for the bang event.
  • Finally the signal is displayed in the scope~ object.

Importantly, the relative timing of the bang event (the offset within the current audio signal vector) has been maintained.

Final Considerations

Once again, the upsampling (event-to-audio conversion) objects are sig~, click~, line~, and curve~. However, some objects can still have some sample accurate functionality. The groove~ object, for example, will start/stop in a sample accurate way when it receives a bang message. In general, check the object reference for more details on the exact behavior of a specific object.