pub struct Wavefolder { /* private fields */ }Expand description
Wavefolder module.
This is the canonical home of Wavefolder (Q149): it lives here in
modules::nonlinear alongside Distortion and the other waveshapers, and is
re-exported from crate::analog for backward compatibility. Like
Distortion, it supports opt-in oversampling via
Wavefolder::set_oversample.
Implementations§
Source§impl Wavefolder
impl Wavefolder
pub fn new(threshold: f64) -> Self
Sourcepub fn set_oversample(&mut self, mode: Oversample)
pub fn set_oversample(&mut self, mode: Oversample)
Select the oversampling factor for the folding stage (Q143).
Defaults to Oversample::Off. Wavefolding is one of the most
alias-prone nonlinearities; 2x/4x oversampling substantially reduces the
inharmonic aliasing it produces at high input frequencies.
Sourcepub fn oversample_factor(&self) -> usize
pub fn oversample_factor(&self) -> usize
Current oversampling factor of the folding stage (1 = off, 2, or 4).
Trait Implementations§
Source§impl Default for Wavefolder
impl Default for Wavefolder
Source§impl GraphModule for Wavefolder
impl GraphModule for Wavefolder
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, _: f64)
fn set_sample_rate(&mut self, _: f64)
Set sample rate
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§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§impl ModuleIntrospection for Wavefolder
Available on crate feature alloc only.
impl ModuleIntrospection for Wavefolder
Available on crate feature
alloc only.Auto Trait Implementations§
impl Freeze for Wavefolder
impl RefUnwindSafe for Wavefolder
impl Send for Wavefolder
impl Sync for Wavefolder
impl Unpin for Wavefolder
impl UnsafeUnpin for Wavefolder
impl UnwindSafe for Wavefolder
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