Feature request: add Fuzz plugin for Pedalboard (#402)#403
Feature request: add Fuzz plugin for Pedalboard (#402)#403LorenzoMonti wants to merge 7 commits intospotify:masterfrom
Conversation
…d. It features a two-stage clipping process: first a hard diode clipping (threshold=0.25), then a soft clipping via tanh, followed by a tone control stage implemented as a low-pass filter.
…t_fuzz_process_signal() methods added.
psobot
left a comment
There was a problem hiding this comment.
Excellent work, thank you @LorenzoMonti! I've left a couple comments inline (mostly about touching the actual DSP parameters directly in the setters/getters rather than copies) - but otherwise, this is virtually a perfect pull request. Great job!
pedalboard/plugins/Fuzz.h
Outdated
| SampleType driveDecibels; | ||
| SampleType toneHz; |
There was a problem hiding this comment.
We probably don't want to keep a copy of these variables here, as they can differ from the variables set in the ProcessorChain depending on when prepare is called. (And indeed; if you use Fuzz in an AudioStream, it should be possible to call .drive_db = x and the audio should update without needing to stop and start the stream again.)
pedalboard/plugins/Fuzz.h
Outdated
| void setDriveDecibels(const float f) noexcept { driveDecibels = f; } | ||
| float getDriveDecibels() const noexcept { return driveDecibels; } |
There was a problem hiding this comment.
| void setDriveDecibels(const float f) noexcept { driveDecibels = f; } | |
| float getDriveDecibels() const noexcept { return driveDecibels; } | |
| void setDriveDecibels(const float f) noexcept { this->getDSP().template get<gainIndex>().setGainDecibels(f); } | |
| float getDriveDecibels() const noexcept { return this->getDSP().template get<gainIndex>().getGainDecibels(f); } |
pedalboard/plugins/Fuzz.h
Outdated
| }; | ||
|
|
||
| // Third stage: Tone control via low-pass filter | ||
| auto coeffs = juce::dsp::IIR::Coefficients<SampleType>::makeLowPass(spec.sampleRate, toneHz); |
There was a problem hiding this comment.
Could try using ArrayCoefficients here to allow updating the toneHz parameter without requiring a realloc/extra prepare call here - with the caveat that I haven't worked with that API in a long time and am not sure if it would actually work here.
Thanks for the thorough and speedy comment! I’m still getting familiar with JUCE, so I really appreciate the guidance. I’ll go through your comments carefully and deepen my understanding of how the |
… audio streaming. Previously, parameter changes would only take effect after calling prepare(), requiring the audio stream to be restarted. The refactored implementation allows parameters to be updated while audio is streaming without interruption.
|
Dear @psobot, Below are the changes I made to the Fuzz.h file:
Let me know what you think about it. |
Problem
Fuzz is a staple effect in many music genres, particularly rock and
experimental electronic music. While distortion and gain effects exist
in Pedalboard, fuzz has a unique aggressive character that cannot be
easily replicated. Adding a fuzz plugin would expand Pedalboard’s
flexibility, providing more options for guitarists and producers
seeking vintage or experimental tones.
This feature request was initially discussed in #402.
Solution
Implemented a new Fuzz effect, emulating a classic fuzz pedal.
The effect consists of:
Result
Pedalboard now includes a fuzz effect, broadening its range of
distortion-based effects. Users can apply fuzz to their audio chains
for a distinctive saturated sound characteristic of classic fuzz pedals.