pub trait VoiceProcessContext {
// Required methods
fn events(&self) -> impl Iterator<Item = Event> + Clone;
fn parameters(&self) -> &impl SynthParamBufferStates;
fn per_note_expression(
&self,
expression: NumericPerNoteExpression,
) -> NumericBufferState<impl Iterator<Item = PiecewiseLinearCurvePoint> + Clone>;
}Expand description
Non-audio data availble to voices during the processing call.
This includes events that occur during the buffer, as well as relevant parameter values.
Required Methods§
Sourcefn events(&self) -> impl Iterator<Item = Event> + Clone
fn events(&self) -> impl Iterator<Item = Event> + Clone
Returns an iterator of events that occurred for this voice during the processing call.
Sourcefn parameters(&self) -> &impl SynthParamBufferStates
fn parameters(&self) -> &impl SynthParamBufferStates
Returns the parameter states for this processing call.
Sourcefn per_note_expression(
&self,
expression: NumericPerNoteExpression,
) -> NumericBufferState<impl Iterator<Item = PiecewiseLinearCurvePoint> + Clone>
fn per_note_expression( &self, expression: NumericPerNoteExpression, ) -> NumericBufferState<impl Iterator<Item = PiecewiseLinearCurvePoint> + Clone>
Returns the state of per-note expression routed to this voice.
Note that most of the time, this will include data for just one note. However in some cases, a voice will have to play multiple notes within one buffer, which is handled by this call.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.