pub struct Granular { /* private fields */ }Expand description
Granular synthesis/processing engine
Records input audio into a circular buffer and plays back overlapping grains with individual pitch shifting and envelope shaping.
§Ports
- Input 0: Audio input
- Input 1: Playback position (0-1 maps to buffer position)
- Input 2: Grain size (0-1 maps to 10ms-500ms)
- Input 3: Density (0-1 maps to 1-20 grains per second)
- Input 4: Pitch shift (bipolar CV ±5V maps to ±24 semitones, i.e. playback speed 0.25×–4×). Grain size is bounded so a grain’s read span can never exceed the buffer length at the chosen speed.
- Input 5: Spray (position randomization, 0-1)
- Input 6: Freeze (gate > 2.5V stops recording)
- Output 10: Processed output
Implementations§
Trait Implementations§
Source§impl GraphModule for Granular
impl GraphModule for Granular
Source§fn tick(&mut self, inputs: &PortValues, outputs: &mut PortValues)
fn tick(&mut self, inputs: &PortValues, outputs: &mut PortValues)
Process one sample given port values
Source§fn set_sample_rate(&mut self, sample_rate: f64)
fn set_sample_rate(&mut self, sample_rate: f64)
Set sample rate
Source§fn process_block(
&mut self,
inputs: &BlockPortValues,
outputs: &mut BlockPortValues,
frames: usize,
)
fn process_block( &mut self, inputs: &BlockPortValues, outputs: &mut BlockPortValues, frames: usize, )
Process a block of samples (optional optimization). Read more
Source§fn breaks_feedback_cycle(&self) -> bool
fn breaks_feedback_cycle(&self) -> bool
Whether this module breaks a feedback cycle in the patch graph. Read more
Source§fn serialize_state(&self) -> Option<Value>
fn serialize_state(&self) -> Option<Value>
Available on crate feature
alloc only.Serialize module state (alloc feature only)
Source§fn deserialize_state(&mut self, _state: &Value) -> Result<(), String>
fn deserialize_state(&mut self, _state: &Value) -> Result<(), String>
Available on crate feature
alloc only.Deserialize module state (alloc feature only)
Source§fn introspect(&self) -> Option<&dyn ModuleIntrospection>
fn introspect(&self) -> Option<&dyn ModuleIntrospection>
Available on crate feature
alloc only.Downcast this module to its
ModuleIntrospection view, if it exposes one. Read moreSource§fn introspect_mut(&mut self) -> Option<&mut dyn ModuleIntrospection>
fn introspect_mut(&mut self) -> Option<&mut dyn ModuleIntrospection>
Available on crate feature
alloc only.Mutable companion to
introspect, used to set internal parameters.Source§impl ModuleIntrospection for Granular
Available on crate feature alloc only.
impl ModuleIntrospection for Granular
Available on crate feature
alloc only.Auto Trait Implementations§
impl Freeze for Granular
impl RefUnwindSafe for Granular
impl Send for Granular
impl Sync for Granular
impl Unpin for Granular
impl UnsafeUnpin for Granular
impl UnwindSafe for Granular
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