pub struct ReadHead<T: Transcendental, const BUF_SIZE: usize> { /* private fields */ }Expand description
Read head — pure tape reader. Reads from the shared [TapeLoop] at a
fixed delay. Mono output. Level and pan are handled by a downstream
SumNode with per-channel gains.
The tape loop is obtained through the graph’s resource registry during node initialization.
§Signal ports
- 1 audio output (mono), no inputs
§Parameters
delay(0.01 – 2.0 s)
Implementations§
Source§impl<T: Transcendental, const BUF_SIZE: usize> ReadHead<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> ReadHead<T, BUF_SIZE>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new ReadHead with default delay of 0.5 seconds.
resource_name is the name of the shared tape loop in the buffer registry.
Defaults to "tape_0".
Sourcepub fn with_resource(resource_name: &str) -> Self
pub fn with_resource(resource_name: &str) -> Self
Create a new ReadHead with an explicit resource name.
Sourcepub fn set_reader(&mut self, reader: TapeReader<T>)
pub fn set_reader(&mut self, reader: TapeReader<T>)
Set the tape read handle (used by tests; the graph uses
resolve_resources).
Trait Implementations§
Source§impl<T: Transcendental, const BUF_SIZE: usize> Node<T, BUF_SIZE> for ReadHead<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> Node<T, BUF_SIZE> for ReadHead<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, _: usize) -> Option<&mut Port<T, BUF_SIZE>>
fn input_port_mut(&mut self, _: 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 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_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
impl<T: Transcendental, const B: usize> Send for ReadHead<T, B>
Source§impl<T: Transcendental, const BUF_SIZE: usize> Source<T, BUF_SIZE> for ReadHead<T, BUF_SIZE>
impl<T: Transcendental, const BUF_SIZE: usize> Source<T, BUF_SIZE> for ReadHead<T, BUF_SIZE>
Source§fn generate(
&mut self,
_ctx: &RenderContext,
_control_inputs: &[T],
_clock_inputs: &[RenderContext],
_tick: &ClockTick,
) -> ProcessResult<()>
fn generate( &mut self, _ctx: &RenderContext, _control_inputs: &[T], _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.
impl<T: Transcendental, const B: usize> Sync for ReadHead<T, B>
Auto Trait Implementations§
impl<T, const BUF_SIZE: usize> !RefUnwindSafe for ReadHead<T, BUF_SIZE>
impl<T, const BUF_SIZE: usize> !UnwindSafe for ReadHead<T, BUF_SIZE>
impl<T, const BUF_SIZE: usize> Freeze for ReadHead<T, BUF_SIZE>where
T: Freeze,
impl<T, const BUF_SIZE: usize> Unpin for ReadHead<T, BUF_SIZE>where
T: Unpin,
impl<T, const BUF_SIZE: usize> UnsafeUnpin for ReadHead<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