pub struct SamplerNode { /* private fields */ }Expand description
A polyphonic sampler node.
Implementations§
Source§impl SamplerNode
impl SamplerNode
pub fn new(sample_rate: f32) -> Self
Sourcepub fn midi_queue(&self) -> Arc<Mutex<Vec<MidiEvent>>>
pub fn midi_queue(&self) -> Arc<Mutex<Vec<MidiEvent>>>
Get the MIDI queue for pushing events from the MIDI thread.
Sourcepub fn instrument_slot(&self) -> Arc<Mutex<Option<LoadedInstrument>>>
pub fn instrument_slot(&self) -> Arc<Mutex<Option<LoadedInstrument>>>
Get the instrument slot for loading/replacing instruments.
Sourcepub fn reset_round_robin(&mut self)
pub fn reset_round_robin(&mut self)
Reset the round-robin state (call when loading a new instrument).
Trait Implementations§
Source§impl DspNode for SamplerNode
impl DspNode for SamplerNode
Source§fn process(
&mut self,
_inputs: &[Option<&[f32; 64]>; 8],
output: &mut [f32; 64],
_params: &mut ParamBlock,
_sample_rate: f32,
)
fn process( &mut self, _inputs: &[Option<&[f32; 64]>; 8], output: &mut [f32; 64], _params: &mut ParamBlock, _sample_rate: f32, )
Process one buffer of audio. Read more
Source§fn capture_state(&self) -> StateBlob
fn capture_state(&self) -> StateBlob
Capture internal state for continuity transfer.
Source§fn restore_state(&mut self, _state: StateBlob)
fn restore_state(&mut self, _state: StateBlob)
Restore internal state after a graph mutation.
Auto Trait Implementations§
impl Freeze for SamplerNode
impl RefUnwindSafe for SamplerNode
impl Send for SamplerNode
impl Sync for SamplerNode
impl Unpin for SamplerNode
impl UnsafeUnpin for SamplerNode
impl UnwindSafe for SamplerNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more