pub struct Delay<T: Transcendental, const BUF_SIZE: usize> {
pub delay_time: f32,
pub feedback: f32,
pub mix: f32,
/* private fields */
}Expand description
Delay effect with feedback
Parameters:
- delay_time: delay time in seconds (0.01 - 2.0)
- feedback: feedback amount (0.0 - 0.99)
- mix: dry/wet mix (0.0 - 1.0)
Fields§
§delay_time: f32Delay time in seconds
feedback: f32Feedback amount (0.0 - 0.99)
mix: f32Dry/wet mix (0.0 = dry, 1.0 = wet)
Implementations§
Source§impl<T: Transcendental, const BUF_SIZE: usize> Delay<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> Delay<T, BUF_SIZE>
Sourcepub fn with_params(
sample_rate: f32,
delay_time: f32,
feedback: f32,
mix: f32,
) -> Self
pub fn with_params( sample_rate: f32, delay_time: f32, feedback: f32, mix: f32, ) -> Self
Create a new delay effect with custom parameters
Sourcepub fn set_delay_time(&mut self, time: f32)
pub fn set_delay_time(&mut self, time: f32)
Set delay time in seconds
Sourcepub fn set_feedback(&mut self, fb: f32)
pub fn set_feedback(&mut self, fb: f32)
Set feedback amount
Sourcepub fn process_sample(&mut self, input: T) -> T
pub fn process_sample(&mut self, input: T) -> T
Process a single sample (internal helper)
Trait Implementations§
Source§impl<T: Transcendental, const BUF_SIZE: usize> Node<T, BUF_SIZE> for Delay<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> Node<T, BUF_SIZE> for Delay<T, BUF_SIZE>
Source§fn node_type_id(&self) -> NodeTypeIdwhere
Self: 'static + Sized,
fn node_type_id(&self) -> NodeTypeIdwhere
Self: 'static + Sized,
Get the node’s type ID
Source§fn metadata(&self) -> NodeMetadata
fn metadata(&self) -> NodeMetadata
Get node metadata
Source§fn get_parameter(&self, id: &ParameterId) -> Option<ParamValue>
fn get_parameter(&self, id: &ParameterId) -> Option<ParamValue>
Get the value of a parameter
Source§fn set_parameter(
&mut self,
id: &ParameterId,
value: ParamValue,
) -> ProcessResult<()>
fn set_parameter( &mut self, id: &ParameterId, value: ParamValue, ) -> ProcessResult<()>
Set the value of a parameter
Source§fn input_port_mut(&mut self, index: usize) -> Option<&mut Port<T, BUF_SIZE>>
fn input_port_mut(&mut self, index: usize) -> Option<&mut Port<T, BUF_SIZE>>
Get mutable input port by index
Source§fn output_port_mut(&mut self, index: usize) -> Option<&mut Port<T, BUF_SIZE>>
fn output_port_mut(&mut self, index: usize) -> Option<&mut Port<T, BUF_SIZE>>
Get mutable output port by index
Source§fn control_port_mut(&mut self, index: usize) -> Option<&mut Port<T, BUF_SIZE>>
fn control_port_mut(&mut self, index: usize) -> Option<&mut Port<T, BUF_SIZE>>
Get mutable control port by index
Source§fn num_inputs(&self) -> usize
fn num_inputs(&self) -> usize
Total number of input ports
Source§fn num_outputs(&self) -> usize
fn num_outputs(&self) -> usize
Total number of output ports
Source§fn num_signal_inputs(&self) -> usize
fn num_signal_inputs(&self) -> usize
Number of signal input ports
Source§fn num_signal_outputs(&self) -> usize
fn num_signal_outputs(&self) -> usize
Number of signal output ports
Source§fn apply_set_parameter(
&mut self,
cmd: &SetParameter,
) -> Result<(), ProcessError>
fn apply_set_parameter( &mut self, cmd: &SetParameter, ) -> Result<(), ProcessError>
Apply a
SetParameter command to this node. Read moreSource§fn resolve_resources(&mut self, _resources: &mut ResourceRegistry<T>)
fn resolve_resources(&mut self, _resources: &mut ResourceRegistry<T>)
Resolve named shared resources (tape loops, etc.) from the registry,
acquiring the capability handle matching this node’s role.
Source§fn num_control_inputs(&self) -> usize
fn num_control_inputs(&self) -> usize
Number of control input ports
Source§fn num_control_outputs(&self) -> usize
fn num_control_outputs(&self) -> usize
Number of control output ports
Source§fn num_clock_inputs(&self) -> usize
fn num_clock_inputs(&self) -> usize
Number of clock input ports
Source§fn num_clock_outputs(&self) -> usize
fn num_clock_outputs(&self) -> usize
Number of clock output ports
Source§fn num_feedback_ports(&self) -> usize
fn num_feedback_ports(&self) -> usize
Number of feedback ports
Source§impl<T: Transcendental, const BUF_SIZE: usize> Processor<T, BUF_SIZE> for Delay<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> Processor<T, BUF_SIZE> for Delay<T, BUF_SIZE>
Source§fn process(
&mut self,
_ctx: &RenderContext,
_signal_inputs: &[&[T; BUF_SIZE]],
_control_inputs: &[T],
_clock_inputs: &[RenderContext],
_feedback_inputs: &[&[T; BUF_SIZE]],
) -> ProcessResult<()>
fn process( &mut self, _ctx: &RenderContext, _signal_inputs: &[&[T; BUF_SIZE]], _control_inputs: &[T], _clock_inputs: &[RenderContext], _feedback_inputs: &[&[T; BUF_SIZE]], ) -> ProcessResult<()>
Process a block of signal Read more
Auto Trait Implementations§
impl<T, const BUF_SIZE: usize> !Freeze for Delay<T, BUF_SIZE>
impl<T, const BUF_SIZE: usize> !RefUnwindSafe for Delay<T, BUF_SIZE>
impl<T, const BUF_SIZE: usize> !UnwindSafe for Delay<T, BUF_SIZE>
impl<T, const BUF_SIZE: usize> Send for Delay<T, BUF_SIZE>
impl<T, const BUF_SIZE: usize> Sync for Delay<T, BUF_SIZE>
impl<T, const BUF_SIZE: usize> Unpin for Delay<T, BUF_SIZE>where
T: Unpin,
impl<T, const BUF_SIZE: usize> UnsafeUnpin for Delay<T, BUF_SIZE>where
T: UnsafeUnpin,
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