SPSC MIDI accumulator for UI-thread → audio-thread MIDI delivery. More...
#include <pulp/midi/buffer.hpp>#include <pulp/midi/message.hpp>#include <pulp/runtime/spsc_queue.hpp>#include <algorithm>#include <array>#include <atomic>#include <cmath>#include <cstddef>#include <cstdint>#include <optional>Go to the source code of this file.
Classes | |
| struct | pulp::midi::TimestampedShortMessage |
| Timestamped MIDI event in the collector queue. More... | |
| struct | pulp::midi::MidiMessageCollectorTelemetry |
| class | pulp::midi::MidiMessageCollector< Capacity > |
Namespaces | |
| namespace | pulp |
| namespace | pulp::midi |
SPSC MIDI accumulator for UI-thread → audio-thread MIDI delivery.
MidiMessageCollector lets the UI / virtual-keyboard / scripting thread push timestamped MIDI events into a lock-free queue that the audio callback drains into the current block's MidiBuffer at the correct sample offsets.
Capacity is a compile-time parameter so the underlying queue allocates no heap memory in the audio thread. The default of 256 covers typical UI input rates (mouse + scripting) at any block size; larger consumers (sequencers playing back patterns) should pick a higher capacity at construction.
Usage: