Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
mpe_voice_tracker.hpp File Reference

MPE (MIDI Polyphonic Expression) voice tracker. More...

#include <pulp/midi/message.hpp>
#include <pulp/midi/ump.hpp>
#include <array>
#include <cstdint>
#include <functional>
#include <optional>

Go to the source code of this file.

Classes

struct  pulp::midi::MpeNoteState
 Per-note state maintained by MpeVoiceTracker. More...
class  pulp::midi::MpeVoiceTracker
 Tracks MPE voice state across channels. More...
struct  pulp::midi::MpeVoiceTracker::ZoneState

Namespaces

namespace  pulp
namespace  pulp::midi

Typedefs

using pulp::midi::MpeNoteGeneration = std::uint64_t
 Stable identity assigned to one accepted MPE note-on generation.

Detailed Description

MPE (MIDI Polyphonic Expression) voice tracker.

Tracks active notes across MPE member channels, dispatches per-note pitch bend, pressure, and timbre (CC74), and enforces zone boundaries.

Feed all incoming MidiEvents via process(). The tracker classifies each event against the configured MpeConfig:

  • Note On / Note Off on a member channel → updates the per-note record
  • Pitch Bend on a member channel → applies to all active notes on that channel (MPE member channels hold one note at a time in typical use, but the tracker correctly handles overlap)
  • Channel Pressure on a member channel → pressure
  • CC 74 on a member channel → timbre (also aliased as slide)

Messages on manager channels are surfaced as global (zone-wide) state but do not create notes. Messages on channels outside any zone are ignored (returned false from process()).

All mutation is synchronous and lock-free (no allocations after construction). Safe to call from the audio thread.