AUDIO
Source snapshot · 11 November 2026

API reference / ravet_instrument::PerformanceVoices

Struct PerformanceVoices 

pub struct PerformanceVoices<const N: usize> { /* private fields */ }
Expand description

Allocation-free 1..128-slot normalized/native performance receiver.

All target fields are conjunctive; absent fields are wildcards within this routed endpoint. Unidentified duplicate On events stack. Off releases every held match and retains velocity/expressions through the tail; repeated Off does not restart release or replace its velocity. Expressions update held and released matches, but are not retained for future notes. Volume zero mutes without completing. Concrete duplicate IDs retrigger their existing address, resetting expressions; another address rejects before mutation. Stealing prefers idle, oldest released, then oldest held and reports the old target as completed. Choke removes matching voices immediately; a DSP consumer must implement that policy or choose another receiver.

There are no pedals, MIDI conversion, smoothing, oscillator, endpoint router, thread synchronization or format export. Rank ages stay bounded 0..N-1.

Implementations§

§

impl<const N: usize> PerformanceVoices<N>

pub fn new() -> Result<Self, PerformanceError>

pub fn voices(&self) -> &[PerformanceVoice; N]

pub fn reset(&mut self)

Explicit lifecycle reset discards ownership without generating events. The consumer coordinates host/controller reset and its own DSP history.

pub fn finish( &mut self, index: usize, ) -> Result<Option<NoteTarget>, PerformanceError>

DSP-owned completion, including a consumer-terminated held note. An idle slot returns None; an invalid index leaves the receiver unchanged.

pub fn apply( &mut self, data: EventData, ) -> Result<PerformanceChanges<N>, PerformanceError>

Validate one event before changing any receiver state. See Self::preflight for a complete timed-stream check before a consumer changes DSP/state.

pub fn preflight( &self, events: &[Event], frames: usize, ) -> Result<PerformanceBatchInfo, PerformanceBatchError>

Simulate the entire ordered stream on fixed copied storage without changing this bank. Limits are 1024 events and 65536 frames; zero-frame events use 0. Equal-offset order is retained. Identity conflicts/unsupported/invalid late events reject atomically. Success counts immediate steal/choke completions.

The consumer must keep ownership unchanged between preflight and replay, apply the same events at their sample boundaries, separately budget DSP completions, and stage publication until its own whole operation succeeds. This method does not reserve an output buffer or mutate consumer DSP.

Trait Implementations§

§

impl<const N: usize> Clone for PerformanceVoices<N>

§

fn clone(&self) -> PerformanceVoices<N>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · §

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<const N: usize> Debug for PerformanceVoices<N>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl<const N: usize> PartialEq for PerformanceVoices<N>

§

fn eq(&self, other: &PerformanceVoices<N>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · §

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
§

impl<const N: usize> StructuralPartialEq for PerformanceVoices<N>

Auto Trait Implementations§

§

impl<const N: usize> Freeze for PerformanceVoices<N>

§

impl<const N: usize> RefUnwindSafe for PerformanceVoices<N>

§

impl<const N: usize> Send for PerformanceVoices<N>

§

impl<const N: usize> Sync for PerformanceVoices<N>

§

impl<const N: usize> Unpin for PerformanceVoices<N>

§

impl<const N: usize> UnsafeUnpin for PerformanceVoices<N>

§

impl<const N: usize> UnwindSafe for PerformanceVoices<N>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.