pub struct LofiProcessor<const BUF_SIZE: usize> { /* private fields */ }Expand description
Applies lo-fi audio effects (bitcrushing, sample-rate reduction, vintage noise, DAC emulation, and delay) to emulate classic digital audio systems.
Implementations§
Source§impl<const BUF_SIZE: usize> LofiProcessor<BUF_SIZE>
impl<const BUF_SIZE: usize> LofiProcessor<BUF_SIZE>
Sourcepub fn new(config: LofiConfig) -> Self
pub fn new(config: LofiConfig) -> Self
Creates a new LofiProcessor with the given configuration.
Sourcepub fn for_system(system: ClassicSystem) -> Self
pub fn for_system(system: ClassicSystem) -> Self
Creates a new LofiProcessor configured for a specific classic system.
Sourcepub fn process_sample(&mut self, input: f32) -> f32
pub fn process_sample(&mut self, input: f32) -> f32
Processes a single audio sample through the lo-fi effect chain.
Sourcepub fn clear_delay_buffer(&mut self)
pub fn clear_delay_buffer(&mut self)
Resets the internal delay buffer to silence.
Trait Implementations§
Source§impl<const BUF_SIZE: usize> Node<f32, BUF_SIZE> for LofiProcessor<BUF_SIZE>
impl<const BUF_SIZE: usize> Node<f32, BUF_SIZE> for LofiProcessor<BUF_SIZE>
Source§fn metadata(&self) -> NodeMetadata
fn metadata(&self) -> NodeMetadata
Get node metadata
Source§fn node_type_id(&self) -> NodeTypeId
fn node_type_id(&self) -> NodeTypeId
Get the node’s type ID
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<f32, BUF_SIZE>>
fn input_port_mut(&mut self, index: usize) -> Option<&mut Port<f32, BUF_SIZE>>
Get mutable input port by index
Source§fn output_port_mut(&mut self, index: usize) -> Option<&mut Port<f32, BUF_SIZE>>
fn output_port_mut(&mut self, index: usize) -> Option<&mut Port<f32, BUF_SIZE>>
Get mutable output port by index
Source§fn control_port(&self, _index: usize) -> Option<&Port<f32, BUF_SIZE>>
fn control_port(&self, _index: usize) -> Option<&Port<f32, BUF_SIZE>>
Get control port by index
Source§fn control_port_mut(
&mut self,
_index: usize,
) -> Option<&mut Port<f32, BUF_SIZE>>
fn control_port_mut( &mut self, _index: usize, ) -> Option<&mut Port<f32, BUF_SIZE>>
Get mutable control port by index
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§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§impl<const BUF_SIZE: usize> Processor<f32, BUF_SIZE> for LofiProcessor<BUF_SIZE>
impl<const BUF_SIZE: usize> Processor<f32, BUF_SIZE> for LofiProcessor<BUF_SIZE>
Source§fn process(
&mut self,
_ctx: &RenderContext,
signal_inputs: &[&[f32; BUF_SIZE]],
_control_inputs: &[f32],
_clock_inputs: &[RenderContext],
_feedback_inputs: &[&[f32; BUF_SIZE]],
) -> ProcessResult<()>
fn process( &mut self, _ctx: &RenderContext, signal_inputs: &[&[f32; BUF_SIZE]], _control_inputs: &[f32], _clock_inputs: &[RenderContext], _feedback_inputs: &[&[f32; BUF_SIZE]], ) -> ProcessResult<()>
Process a block of signal Read more
Auto Trait Implementations§
impl<const BUF_SIZE: usize> !RefUnwindSafe for LofiProcessor<BUF_SIZE>
impl<const BUF_SIZE: usize> !UnwindSafe for LofiProcessor<BUF_SIZE>
impl<const BUF_SIZE: usize> Freeze for LofiProcessor<BUF_SIZE>
impl<const BUF_SIZE: usize> Send for LofiProcessor<BUF_SIZE>
impl<const BUF_SIZE: usize> Sync for LofiProcessor<BUF_SIZE>
impl<const BUF_SIZE: usize> Unpin for LofiProcessor<BUF_SIZE>
impl<const BUF_SIZE: usize> UnsafeUnpin for LofiProcessor<BUF_SIZE>
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