JS API

RNBO JavaScript API Reference

The @rnbo/js package is the main package for running RNBO Patchers within the Browser. Using the main entry point createDevice(), RNBO Devices can be created from RNBO Patchers and integrated into the WebAudio graph of your application.

For more examples of how to utilize the JavaScript API, check out our Working with JavaScript Learn articles.

Classes

Class

Description

BaseDevice

RNBO BaseDevice class.

BaseEvent

Common Base Event class for all RNBO Events.

BeatTimeEvent

BeatTimeEvent class to send transport beattime changes into a RNBO Device.

DataBuffer

Helper class for retrieved binary data from a RNBO Patcher using BaseDevice.releaseDataBuffer()

EnumParameter

Parameter Class for describing and interacting with Enum Type Parameters in RNBO.

Uses the CommonParameterMixin interface

EventSubject

The EventSubject class is used to enable the concept of listening and emitting events while maintaining type safety for the subscribing listeners. The generic type T hereby refers to the event parameter passed on the listeners when emitting events.

MessageEvent

MessageEvent class to send Message Events into a RNBO Device or receive events from a Device.

MIDIEvent

MIDIEvent class to send MIDI Events into a RNBO Device or receive events from a Device.

NumberParameter

Parameter Class for describing and interacting with Number (Float) Type Parameters in RNBO Uses the CommonParameterMixin interface

PresetEvent

PresetEvent class to receive Preset Touched events from a RNBO Device.

ScriptDevice

RNBO Device using a WebAudio ScriptProcessorNode for its processing.

TempoEvent

TempoEvent class to send tempo changes into a RNBO Device.

TimeSignatureEvent

TimeSignatureEvent class to send time signature changes into a RNBO Device.

TransportEvent

TransportEvent class to send transport state changes into a RNBO Device.

WorkletDevice

RNBO Device using AudioWorklets for its processing.

Enumerations

Enumeration

Description

DeviceType

Enum to identify the type of a Device via BaseDevice.type

Also used within createDevice()

EventType

Enum used to distinguish the type of events. See BaseEvent.

MessagePortType

The type (Inport, Outport) of a message endpoint

ParameterNotificationSetting

Enum defining the available options for the parameter change event setting of a Device

ParameterType

Enum used to distinguish the type of a Parameter.

RNBOPresetEventAction

Enum used to distinguished the type of RNBOPresetEventAction

TransportState

Enum containing the potential transport states

WASMEncoding

WASM Encodings

Functions

Function

Description

createDevice(parameters, prevDevice)

The main entry point to @rnbo/js. Use the createDevice factory function to create Devices from your RNBO Patches.

Interfaces

Interface

Description

CommonParameterMixin

The mixin base interface for all Parameters providing common functionality and attributes across all types of Parameters

IBaseEvent

Interface for the BaseEvent and the serialized version of it.

IBeatTimeEvent

Interface for the BeatTimeEvent and the serialized version of it.

ICreateDeviceParameters

Interface describing the parameters passed to createDevice() when attempting to create a new Device.

IDeviceOptions

Options for creating a RNBO BaseDevice

IEventListener

Generic Interface used for ListenerCallbacks alongside the EventSubject class. The IEventListener is hereby used to safely type the callback and the passed on event parameter.

IEventSubscription

Interface describing the return value of a call to

EventSubject.subscribe()

IMessageEvent

Interface for the MessageEvent and the serialized version of it.

IMIDIEvent

Interface for the MIDIEvent and the serialized version of it.

IParameterDescription

Parameter Description of a generated RNBO Patcher

IPatcher

Interface describing the generated RNBO Patcher Object. See the Working with TypeScript guide for some more information.

IPatcherDescription

Patcher Description of a generated RNBO Patcher

IPatcherOptions

Option Settings of a generated RNBO Patcher

IPreset

Collection of parameter values as a RNBO Patcher Preset, mapping:

⁠- a parameter name to a numerical value
⁠- a parameter name to a list of numerical values
⁠- a subpatcher name to a sub preset (subpatcher or object state)
⁠- a subpatcher name a list of sub presets (for polyphonic subpatchers)

IPresetEvent

Interface for the PresetEvent and the serialized version of it.

ITempoEvent

Interface for the TempoEvent and the serialized version of it.

ITimeSignatureEvent

Interface for the TimeSignatureEvent and the serialized version of it.

ITransportEvent

Interface for the TransportEvent and the serialized version of it.

IWorkletNode

WorkletNode of a WorkletDevice extending AudioWorkletNode.

Variables

Variable

Description

TimeNow

Constant representing the time "Now"

version

String representing the version of @rnbo/js in use.

Type Aliases

Type Alias

Description

Constructor

Mixin Constructor Helper

ConvertFromNormalizedValueFunction

Conversion function to convert a normalized value to a real value

ConvertToNormalizedValueFunction

Conversion function to convert a real value to a normalized value

Device

Union Device Type for handling ScriptDevice and WorkletDevice.

EnumValue

Possible value of an EnumParameter

Event

Union Type for RNBO Event Classes

EventTarget

Used internally to route events based on their target.

ExternalDataId

Type of the ID of the External Data

ExternalDataInfo

Union type of ExternalDataInfoURL and ExternalDataInfoFile

MessageInfo

The description of a message endpoint

MessagePayload

The payload of a Message

MessageTag

The tag / identifier of a Message

MIDIByte

A single byte of MIDIData

MIDIData

The data of a MIDIEvent consisting out of 3 MIDIBytes

MillisecondTime

All time is measured in milliseconds

Parameter

Union Type of all available Parameter Classes.

ParameterId

Type of the ID of a parameter