Struct fundsp::audionode::MultiBranch
source · [−]pub struct MultiBranch<N, T, X> where
N: Size<T>,
N: Size<X>,
T: Float,
X: AudioNode<Sample = T>,
X::Inputs: Size<T>,
X::Outputs: Size<T> + Mul<N>,
<X::Outputs as Mul<N>>::Output: Size<T>, { /* private fields */ }
Expand description
Branch into a bunch of similar nodes in parallel.
Implementations
sourceimpl<N, T, X> MultiBranch<N, T, X> where
N: Size<T>,
N: Size<X>,
T: Float,
X: AudioNode<Sample = T>,
X::Inputs: Size<T>,
X::Outputs: Size<T> + Mul<N>,
<X::Outputs as Mul<N>>::Output: Size<T>,
impl<N, T, X> MultiBranch<N, T, X> where
N: Size<T>,
N: Size<X>,
T: Float,
X: AudioNode<Sample = T>,
X::Inputs: Size<T>,
X::Outputs: Size<T> + Mul<N>,
<X::Outputs as Mul<N>>::Output: Size<T>,
Trait Implementations
sourceimpl<N, T, X> AudioNode for MultiBranch<N, T, X> where
N: Size<T>,
N: Size<X>,
T: Float,
X: AudioNode<Sample = T>,
X::Inputs: Size<T>,
X::Outputs: Size<T> + Mul<N>,
<X::Outputs as Mul<N>>::Output: Size<T>,
impl<N, T, X> AudioNode for MultiBranch<N, T, X> where
N: Size<T>,
N: Size<X>,
T: Float,
X: AudioNode<Sample = T>,
X::Inputs: Size<T>,
X::Outputs: Size<T> + Mul<N>,
<X::Outputs as Mul<N>>::Output: Size<T>,
type Sample = T
type Sample = T
Sample type for input and output.
sourcefn reset(&mut self, sample_rate: Option<f64>)
fn reset(&mut self, sample_rate: Option<f64>)
Reset the input state of the component to an initial state where it has not processed any samples. In other words, reset time to zero. The sample rate can be set optionally. The default sample rate is 44.1 kHz. The default implementation does nothing. Read more
sourcefn tick(
&mut self,
input: &Frame<Self::Sample, Self::Inputs>
) -> Frame<Self::Sample, Self::Outputs>
fn tick(
&mut self,
input: &Frame<Self::Sample, Self::Inputs>
) -> Frame<Self::Sample, Self::Outputs>
Process one sample.
sourcefn process(
&mut self,
size: usize,
input: &[&[Self::Sample]],
output: &mut [&mut [Self::Sample]]
)
fn process(
&mut self,
size: usize,
input: &[&[Self::Sample]],
output: &mut [&mut [Self::Sample]]
)
Process up to 64 (MAX_BUFFER_SIZE
) samples.
The number of input and output buffers must match the number of inputs and outputs, respectively.
All input and output buffers must be at least as large as size
.
The default implementation is a fallback that calls into tick
. Read more
sourcefn ping(&mut self, probe: bool, hash: AttoRand) -> AttoRand
fn ping(&mut self, probe: bool, hash: AttoRand) -> AttoRand
Ping contained AudioNode
s to obtain a deterministic pseudorandom hash.
The local hash includes children, too.
Leaf nodes should not need to override this.
If probe
is true, then this is a probe for computing the network hash
and set_hash
should not be called yet. Read more
sourcefn route(&self, input: &SignalFrame, frequency: f64) -> SignalFrame
fn route(&self, input: &SignalFrame, frequency: f64) -> SignalFrame
Route constants, latencies and frequency responses at frequency
Hz
from inputs to outputs. Return output signal.
Default implementation marks all outputs unknown. Read more
sourcefn set_hash(&mut self, _hash: u64)
fn set_hash(&mut self, _hash: u64)
Set node pseudorandom phase hash. Override this to use the hash.
This is called from ping
. It should not be called by users.
The default implementation does nothing. Read more
sourcefn get_mono(&mut self) -> Self::Sample
fn get_mono(&mut self) -> Self::Sample
Retrieve the next mono sample from a generator. The node must have no inputs and exactly 1 output. Read more
sourcefn get_stereo(&mut self) -> (Self::Sample, Self::Sample)
fn get_stereo(&mut self) -> (Self::Sample, Self::Sample)
Retrieve the next stereo sample (left, right) from a generator. The node must have no inputs and 1 or 2 outputs. If there is just one output, duplicate it. Read more
sourcefn filter_mono(&mut self, x: Self::Sample) -> Self::Sample
fn filter_mono(&mut self, x: Self::Sample) -> Self::Sample
Filter the next mono sample x
.
The node must have exactly 1 input and 1 output. Read more
Auto Trait Implementations
impl<N, T, X> RefUnwindSafe for MultiBranch<N, T, X> where
T: RefUnwindSafe,
<N as ArrayLength<X>>::ArrayType: RefUnwindSafe,
impl<N, T, X> Send for MultiBranch<N, T, X> where
T: Send,
X: Send,
impl<N, T, X> Sync for MultiBranch<N, T, X> where
T: Sync,
X: Sync,
impl<N, T, X> Unpin for MultiBranch<N, T, X> where
T: Unpin,
<N as ArrayLength<X>>::ArrayType: Unpin,
impl<N, T, X> UnwindSafe for MultiBranch<N, T, X> where
T: UnwindSafe,
<N as ArrayLength<X>>::ArrayType: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self