Struct bevy_fundsp::prelude::hacker::Rez

source ·
pub struct Rez<T, F, N> { /* private fields */ }

Implementations§

source§

impl<T, F, N> Rez<T, F, N>where T: Float, F: Real, N: Size<T>,

source

pub fn new(bandpass: F, cutoff: F, q: F) -> Rez<T, F, N>

Create new resonant filter. The bandpass mode selector is 0 for a lowpass and 1 for a bandpass.

source

pub fn set_cutoff_q(&mut self, cutoff: F, q: F)

Trait Implementations§

source§

impl<T, F, N> AudioNode for Rez<T, F, N>where T: Float, F: Real, N: Size<T>,

source§

const ID: u64 = 75u64

Unique ID for hashing.
§

type Sample = T

Sample type for input and output.
§

type Inputs = N

Input arity.
§

type Outputs = UInt<UTerm, B1>

Output arity.
§

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 set(&mut self, _: (F, F))

Apply setting. Read more
source§

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)

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>

Process one sample. Read more
source§

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]] )

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 more
source§

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

Ping contained AudioNodes 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 allocate(&mut self)

Preallocate all needed memory, including buffers for block processing.
source§

fn inputs(&self) -> usize

Number of inputs. Read more
source§

fn outputs(&self) -> usize

Number of outputs. Read more
source§

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 more
source§

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 more
source§

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

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)

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
source§

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
source§

fn filter_stereo( &mut self, x: Self::Sample, y: Self::Sample ) -> (Self::Sample, Self::Sample)

Filter the next stereo sample (x, y). The node must have exactly 2 inputs and 2 outputs. Read more
source§

impl<T, F, N> Clone for Rez<T, F, N>where T: Clone, F: Clone, N: Clone,

source§

fn clone(&self) -> Rez<T, F, N>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<T, F, N> Default for Rez<T, F, N>where T: Default, F: Default, N: Default,

source§

fn default() -> Rez<T, F, N>

Returns the “default value” for a type. 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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for Twhere T: Any,

§

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>

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)

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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T, Global>) -> Arc<dyn Any + Sync + Send, Global>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> FromWorld for Twhere T: Default,

§

fn from_world(_world: &mut World) -> T

Creates Self using data from the given [World]
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

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

source§

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<F, T> IntoSample<T> for Fwhere T: FromSample<F>,

§

fn into_sample(self) -> T

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

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

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

impl<T, U> ToSample<U> for Twhere U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

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

§

type Error = Infallible

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

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

Performs the conversion.
source§

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

§

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

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

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

Performs the conversion.
§

impl<T> TypeData for Twhere T: 'static + Send + Sync + Clone,

§

fn clone_type_data(&self) -> Box<dyn TypeData, Global>

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<S, T> Duplex<S> for Twhere T: FromSample<S> + ToSample<S>,