Struct bevy_fundsp::prelude::hacker::Rez
source · pub struct Rez<T, F, N> { /* private fields */ }
Implementations§
Trait Implementations§
source§impl<T, F, N> AudioNode for Rez<T, F, N>where
T: Float,
F: Real,
N: Size<T>,
impl<T, F, N> AudioNode for Rez<T, F, N>where T: Float, F: Real, N: Size<T>,
§type Setting = (F, F)
type Setting = (F, F)
Setting type. Settings are parameters that do not have a dedicated input.
This is the unit type if there are no settings.
source§fn reset(&mut self)
fn reset(&mut self)
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. Read more
source§fn set_sample_rate(&mut self, sample_rate: f64)
fn set_sample_rate(&mut self, sample_rate: f64)
Set the sample rate of the unit.
The default sample rate is 44100 Hz.
The unit is allowed to reset its state here in response to sample rate changes.
If the sample rate stays unchanged, then the goal is to maintain current state. Read more
source§fn tick(
&mut self,
input: &NumericArray<<Rez<T, F, N> as AudioNode>::Sample, <Rez<T, F, N> as AudioNode>::Inputs>
) -> NumericArray<<Rez<T, F, N> as AudioNode>::Sample, <Rez<T, F, N> as AudioNode>::Outputs>
fn tick( &mut self, input: &NumericArray<<Rez<T, F, N> as AudioNode>::Sample, <Rez<T, F, N> as AudioNode>::Inputs> ) -> NumericArray<<Rez<T, F, N> as AudioNode>::Sample, <Rez<T, F, N> as AudioNode>::Outputs>
Process one sample. Read more
source§fn route(
&mut self,
input: &TinyVec<[Signal; 64]>,
_frequency: f64
) -> TinyVec<[Signal; 64]>
fn route( &mut self, input: &TinyVec<[Signal; 64]>, _frequency: f64 ) -> TinyVec<[Signal; 64]>
Route constants, latencies and frequency responses at
frequency
Hz
from inputs to outputs. Return output signal.source§fn 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
.
If size
is zero then this is a no-op, which is permitted. Read moresource§fn set_hash(&mut self, hash: u64)
fn set_hash(&mut self, hash: u64)
Set node pseudorandom phase hash.
This is called from
ping
(only). It should not be called by users.source§fn ping(&mut self, probe: bool, hash: AttoHash) -> AttoHash
fn ping(&mut self, probe: bool, hash: AttoHash) -> AttoHash
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.
To set a custom hash for a graph, call this method with ping
set to false and hash
initialized with the custom hash.source§fn response(&mut self, output: usize, frequency: f64) -> Option<Complex<f64>>
fn response(&mut self, output: usize, frequency: f64) -> Option<Complex<f64>>
Evaluate frequency response of
output
at frequency
Hz.
Any linear response can be composed.
Return None
if there is no response or it could not be calculated. Read moresource§fn response_db(&mut self, output: usize, frequency: f64) -> Option<f64>
fn response_db(&mut self, output: usize, frequency: f64) -> Option<f64>
Evaluate frequency response of
output
in dB at frequency
Hz.
Any linear response can be composed.
Return None
if there is no response or it could not be calculated. Read moresource§fn latency(&mut self) -> Option<f64>
fn latency(&mut self) -> Option<f64>
Causal latency in (fractional) samples.
After a reset, we can discard this many samples from the output to avoid incurring a pre-delay.
The latency may depend on the sample rate. Read more
source§fn 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 1 or 2 outputs.
If there are two outputs, average the channels. Read more
source§fn 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
Auto Trait Implementations§
impl<T, F, N> RefUnwindSafe for Rez<T, F, N>where F: RefUnwindSafe, N: RefUnwindSafe, T: RefUnwindSafe,
impl<T, F, N> Send for Rez<T, F, N>where F: Send, N: Send, T: Send,
impl<T, F, N> Sync for Rez<T, F, N>where F: Sync, N: Sync, T: Sync,
impl<T, F, N> Unpin for Rez<T, F, N>where F: Unpin, N: Unpin, T: Unpin,
impl<T, F, N> UnwindSafe for Rez<T, F, N>where F: UnwindSafe, N: UnwindSafe, T: UnwindSafe,
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates
Self
using data from the given [World]