Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::midi::MpeVoiceAllocator< Voice > Class Template Reference

Routes MPE expression events to a pool of voices of type Voice (which must derive from MpeSynthVoice). More...

#include <mpe_synth_voice.hpp>

Public Member Functions

 MpeVoiceAllocator (std::size_t polyphony)
std::size_t polyphony () const
Voice & voice (std::size_t i)
const Voice & voice (std::size_t i) const
void set_steal_mode (MpeVoiceStealMode m)
MpeVoiceStealMode steal_mode () const
void dispatch (const MpeExpressionEvent &e)
 Dispatch a single MPE expression event to the voice pool.
void dispatch_all (const MpeBuffer &buf)
 Dispatch all events in a buffer (in the order they appear).
std::size_t active_count () const
std::size_t releasing_count () const
std::uint64_t steal_count () const
void reset_steal_count ()
MpeVoiceAllocatorTelemetry telemetry () const
 Cheap owner-thread snapshot for voice-count telemetry.
std::uint64_t estimate_optional_runtime_cost () const
MpeVoiceAllocatorRuntimeBudgetReport evaluate_optional_runtime_budget (runtime::RuntimeBudgetFrame &frame, runtime::RuntimeWorkLane lane=runtime::RuntimeWorkLane::Background, bool required=false) const
bool last_was_glide () const
void reset_all ()

Detailed Description

template<typename Voice>
class pulp::midi::MpeVoiceAllocator< Voice >

Routes MPE expression events to a pool of voices of type Voice (which must derive from MpeSynthVoice).

Voices are preallocated.

Constructor & Destructor Documentation

◆ MpeVoiceAllocator()

template<typename Voice>
pulp::midi::MpeVoiceAllocator< Voice >::MpeVoiceAllocator ( std::size_t polyphony)
inlineexplicit

Member Function Documentation

◆ active_count()

template<typename Voice>
std::size_t pulp::midi::MpeVoiceAllocator< Voice >::active_count ( ) const
inline

◆ dispatch()

template<typename Voice>
void pulp::midi::MpeVoiceAllocator< Voice >::dispatch ( const MpeExpressionEvent & e)
inline

Dispatch a single MPE expression event to the voice pool.

◆ dispatch_all()

template<typename Voice>
void pulp::midi::MpeVoiceAllocator< Voice >::dispatch_all ( const MpeBuffer & buf)
inline

Dispatch all events in a buffer (in the order they appear).

◆ estimate_optional_runtime_cost()

template<typename Voice>
std::uint64_t pulp::midi::MpeVoiceAllocator< Voice >::estimate_optional_runtime_cost ( ) const
inline

◆ evaluate_optional_runtime_budget()

template<typename Voice>
MpeVoiceAllocatorRuntimeBudgetReport pulp::midi::MpeVoiceAllocator< Voice >::evaluate_optional_runtime_budget ( runtime::RuntimeBudgetFrame & frame,
runtime::RuntimeWorkLane lane = runtime::RuntimeWorkLane::Background,
bool required = false ) const
inline

◆ last_was_glide()

template<typename Voice>
bool pulp::midi::MpeVoiceAllocator< Voice >::last_was_glide ( ) const
inline

◆ polyphony()

template<typename Voice>
std::size_t pulp::midi::MpeVoiceAllocator< Voice >::polyphony ( ) const
inline

◆ releasing_count()

template<typename Voice>
std::size_t pulp::midi::MpeVoiceAllocator< Voice >::releasing_count ( ) const
inline

◆ reset_all()

template<typename Voice>
void pulp::midi::MpeVoiceAllocator< Voice >::reset_all ( )
inline

◆ reset_steal_count()

template<typename Voice>
void pulp::midi::MpeVoiceAllocator< Voice >::reset_steal_count ( )
inline

◆ set_steal_mode()

template<typename Voice>
void pulp::midi::MpeVoiceAllocator< Voice >::set_steal_mode ( MpeVoiceStealMode m)
inline

◆ steal_count()

template<typename Voice>
std::uint64_t pulp::midi::MpeVoiceAllocator< Voice >::steal_count ( ) const
inline

◆ steal_mode()

template<typename Voice>
MpeVoiceStealMode pulp::midi::MpeVoiceAllocator< Voice >::steal_mode ( ) const
inline

◆ telemetry()

template<typename Voice>
MpeVoiceAllocatorTelemetry pulp::midi::MpeVoiceAllocator< Voice >::telemetry ( ) const
inline

Cheap owner-thread snapshot for voice-count telemetry.

Call from the allocator owner (normally the audio thread) and publish the returned value through a lock-free latest-value channel if another thread needs to observe it.

◆ voice() [1/2]

template<typename Voice>
Voice & pulp::midi::MpeVoiceAllocator< Voice >::voice ( std::size_t i)
inline

◆ voice() [2/2]

template<typename Voice>
const Voice & pulp::midi::MpeVoiceAllocator< Voice >::voice ( std::size_t i) const
inline

The documentation for this class was generated from the following file: