Add extended waveshaper primitives for fuzz and tube effects #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds
waveshaper.hwith three new clipping functions that complement the existingdistortion.hprimitives:fold_back(x, threshold): Foldback distortion for synth-fuzz tones. Signal folds back when exceeding threshold, creating complex harmonics. Includes iteration limiting to prevent infinite loops on extreme input.tube_clip(x): Polynomial tube approximation with soft knee. Based ony = x * (1.5 - 0.5 * x^2), provides gentle compression similar to tube saturation.diode_clip(x, ratio): Asymmetric diode emulation. Uses internal soft clip helper to create even harmonics with configurable asymmetry ratio.Design Notes
static inlinefollowing existing patterns_ws_soft_cliphelper)distortion.hfunctionsTesting
These primitives are building blocks for future effects (fuzz, wah, etc.) as discussed in #63.
Addresses #63
Signed-off-by: The Hand [email protected]