pub struct WriteHead<T: Transcendental, const BUF_SIZE: usize> { /* private fields */ }Expand description
Write head node — mixes input signal with feedback and writes into a
shared [TapeLoop] that ReadHead nodes
read from.
The tape loop is allocated by the graph’s resource registry during node initialization.
§Signal ports
- 1 audio input (dry)
- 1 feedback input (from feedback loop)
- 1 main output (forward path passthrough)
§Parameters
delay_time(0.01 – 2.0 s)feedback(0.0 – 0.99)
Implementations§
Source§impl<T: Transcendental, const BUF_SIZE: usize> WriteHead<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> WriteHead<T, BUF_SIZE>
Sourcepub fn new(sample_rate: f32) -> Self
pub fn new(sample_rate: f32) -> Self
Create a new WriteHead with default delay (0.5 s) and feedback (0.3).
resource_name is the name of the shared tape loop in the buffer registry.
Defaults to "tape_0".
Sourcepub fn with_resource(sample_rate: f32, resource_name: &str) -> Self
pub fn with_resource(sample_rate: f32, resource_name: &str) -> Self
Create a new WriteHead with an explicit resource name.
Trait Implementations§
Source§impl<T: Transcendental, const BUF_SIZE: usize> Node<T, BUF_SIZE> for WriteHead<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> Node<T, BUF_SIZE> for WriteHead<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 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 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, i: usize) -> Option<&mut Port<T, BUF_SIZE>>
fn input_port_mut(&mut self, i: usize) -> Option<&mut Port<T, BUF_SIZE>>
Get mutable input port by index
Source§fn output_port_mut(&mut self, i: usize) -> Option<&mut Port<T, BUF_SIZE>>
fn output_port_mut(&mut self, i: usize) -> Option<&mut Port<T, BUF_SIZE>>
Get mutable output port by index
Source§fn control_port_mut(&mut self, _: usize) -> Option<&mut Port<T, BUF_SIZE>>
fn control_port_mut(&mut self, _: usize) -> Option<&mut Port<T, 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 num_feedback_ports(&self) -> usize
fn num_feedback_ports(&self) -> usize
Number of feedback 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 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_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<T: Transcendental, const BUF_SIZE: usize> Processor<T, BUF_SIZE> for WriteHead<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> Processor<T, BUF_SIZE> for WriteHead<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
impl<T: Transcendental, const B: usize> Send for WriteHead<T, B>
impl<T: Transcendental, const B: usize> Sync for WriteHead<T, B>
Auto Trait Implementations§
impl<T, const BUF_SIZE: usize> !RefUnwindSafe for WriteHead<T, BUF_SIZE>
impl<T, const BUF_SIZE: usize> !UnwindSafe for WriteHead<T, BUF_SIZE>
impl<T, const BUF_SIZE: usize> Freeze for WriteHead<T, BUF_SIZE>where
T: Freeze,
impl<T, const BUF_SIZE: usize> Unpin for WriteHead<T, BUF_SIZE>where
T: Unpin,
impl<T, const BUF_SIZE: usize> UnsafeUnpin for WriteHead<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