Fundamentals
Export Targets
Code Export
Patcher UI
Special Topics
RNBO Raspberry Pi OSCQuery Runner
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).
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.
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:
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, thebang
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 thebang
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.