Learn Using Abstractions

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

Advanced

Abstractions

Using Abstractions

Subpatchers and Abstractions in Depth

Transports and Synchronization

Gen in RNBO

Delays in RNBO

Max Projects and RNBO

Presets With Snapshots

Send and Receive

Working with Lists

Object Properties

Architecture

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

Using Abstractions

How to create and save RNBO abstractions.

Just like Max and Gen, RNBO supports abstractions. These are reusable RNBO patches, saved in the .rnbopat format. When you change the original abstraction file, any patchers containing an instance of that abstraction will be updated as well. This allows you to build up a library of abstractions, both to fit your own particular workflow, and to share with other RNBO users.

Creating an Abstraction

To create a RNBO abstraction, focus on the window containing the RNBO patcher that you want to turn into an abstraction. Then, press Command-Shift-s (or Control-Shift-s on Windows), or select "Save As..." from the file menu. This should bring up a save dialog for the RNBO patcher itself. If you see the .rnbopat extension on the default file name, then everything is working as expected.

saving-an-abstraction.png

Using an Abstraction

Using abstractions is slightly different depending on whether you're creating a rnbo~ object in a Max patch, or creating a subpatcher in RNBO itself. In a Max patcher, a rnbo~ object will bind to an abstraction if the first argument matches the filename of the abstraction, minus the .rnbopat extension.

using-an-abstraction.png

To use an abstraction inside of RNBO, use the p object with the @file attribute. For example, an object like [p @file my_abstraction] will load the file "my_abstraction.rnbopat" as an abstraction.

In order for a Max patch or RNBO patch to use an abstraction, the abstraction file must be in Max's search path. The usual rules for the search path apply. See the Max Search Path documentation for details.

Abstraction Arguments

When using an abstraction inside of RNBO with the p object, you can supply arguments to the abstraction with the @args attribute. These arguments will replace placeholders in the abstraction that use "#n" syntax. For example, if you create an abstraction with box text [p @file my_abstraction @args 440 10], then any instance of "#1" in the abstraction will be replaced with "440," and any instance of "#2" will be replaced with "10."

abstraction-arguments.png

There are some limits to what you can do with this technique. For example, you can't dynamically set the class of an object this way (of course, you couldn't do this in Max either). But object arguments and attribute values will work.