pub struct LofiChipSource<C: Algorithm<f32> + ChipEmulator + ParameterWrite, const BUF_SIZE: usize> { /* private fields */ }Expand description
Source node wrapping a chip emulator with lofi processing.
C implements both Algorithm<f32> (audio generation) and
ChipEmulator (register writes). LofiProcessor applies
bitcrushing, noise, and DAC coloring after the chip output.
Implementations§
Source§impl<C: Algorithm<f32> + ChipEmulator + ParameterWrite, const BUF_SIZE: usize> LofiChipSource<C, BUF_SIZE>
impl<C: Algorithm<f32> + ChipEmulator + ParameterWrite, const BUF_SIZE: usize> LofiChipSource<C, BUF_SIZE>
Sourcepub fn new(chip: C, lofi_config: LofiConfig, num_channels: usize) -> Self
pub fn new(chip: C, lofi_config: LofiConfig, num_channels: usize) -> Self
Create a new chip source with the given emulator and lofi configuration.
Trait Implementations§
Source§impl<C: Algorithm<f32> + ChipEmulator + ParameterWrite, const BUF_SIZE: usize> Node<f32, BUF_SIZE> for LofiChipSource<C, BUF_SIZE>
impl<C: Algorithm<f32> + ChipEmulator + ParameterWrite, const BUF_SIZE: usize> Node<f32, BUF_SIZE> for LofiChipSource<C, 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<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<C: Algorithm<f32> + ChipEmulator + ParameterWrite, const BUF_SIZE: usize> Source<f32, BUF_SIZE> for LofiChipSource<C, BUF_SIZE>
impl<C: Algorithm<f32> + ChipEmulator + ParameterWrite, const BUF_SIZE: usize> Source<f32, BUF_SIZE> for LofiChipSource<C, BUF_SIZE>
Source§fn generate(
&mut self,
_ctx: &RenderContext,
_control_inputs: &[f32],
_clock_inputs: &[RenderContext],
_tick: &ClockTick,
) -> ProcessResult<()>
fn generate( &mut self, _ctx: &RenderContext, _control_inputs: &[f32], _clock_inputs: &[RenderContext], _tick: &ClockTick, ) -> ProcessResult<()>
Generate the next block of signal Read more
Source§fn num_signal_outputs(&self) -> usize
fn num_signal_outputs(&self) -> usize
Number of signal outputs (default 1)
Source§fn num_control_inputs(&self) -> usize
fn num_control_inputs(&self) -> usize
Number of control inputs (default 0)
Source§fn num_clock_inputs(&self) -> usize
fn num_clock_inputs(&self) -> usize
Number of clock inputs (default 0)
Source§fn set_capture(&mut self, _capture: Arc<dyn IoCapture>)
fn set_capture(&mut self, _capture: Arc<dyn IoCapture>)
Attach a capture backend. No-op by default; I/O nodes override.
Auto Trait Implementations§
impl<C, const BUF_SIZE: usize> !RefUnwindSafe for LofiChipSource<C, BUF_SIZE>
impl<C, const BUF_SIZE: usize> !UnwindSafe for LofiChipSource<C, BUF_SIZE>
impl<C, const BUF_SIZE: usize> Freeze for LofiChipSource<C, BUF_SIZE>where
C: Freeze,
impl<C, const BUF_SIZE: usize> Send for LofiChipSource<C, BUF_SIZE>
impl<C, const BUF_SIZE: usize> Sync for LofiChipSource<C, BUF_SIZE>
impl<C, const BUF_SIZE: usize> Unpin for LofiChipSource<C, BUF_SIZE>where
C: Unpin,
impl<C, const BUF_SIZE: usize> UnsafeUnpin for LofiChipSource<C, BUF_SIZE>where
C: 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