Using Buses and Buffers for audio data
mainSynths interact with audio data through two main mechanisms: Buses and Buffers.
Buses (supriya.contexts.entities.Bus)
Buses are placeholders for signals. They are instantiated when the server boots and their count cannot be changed after booting.
- Audio-rate buses: Manage signals sample-by-sample (similar to mixer channels).
- Control-rate buses: Manage signals once per sample-block (conceptually similar to control voltage).
Buffers (supriya.contexts.entities.Buffer)
Buffers are fixed-size arrays of floating-point values used for wavetables, samples, envelopes, or delay lines.
- Persistence: Unlike buses, buffers maintain their data until explicitly changed.
- Allocation: Buffers must be explicitly allocated on the server (an asynchronous action) because they require additional memory allocation.