Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
soft_bypass.hpp File Reference

Click-free bypass wrapper for a DSP processor. More...

#include <algorithm>
#include <cstddef>
#include <utility>

Go to the source code of this file.

Classes

class  pulp::signal::SoftBypassT< Processor, SampleType >

Namespaces

namespace  pulp
namespace  pulp::signal

Typedefs

template<typename Processor>
using pulp::signal::SoftBypass = SoftBypassT<Processor, float>
template<typename Processor>
using pulp::signal::SoftBypass64 = SoftBypassT<Processor, double>

Detailed Description

Click-free bypass wrapper for a DSP processor.

Toggling a processor in/out of the signal path with a hard switch clicks, because the output jumps between the processed and dry signal. SoftBypass wraps any processor that exposes float process(float) and crossfades between its wet output and the dry input over a configurable fade time, so engaging or bypassing is smooth.

It composes with the existing ProcessorChain — SoftBypass<ProcessorChain<...>> gives a whole chain a click-free bypass — making it a small container/wrapper building block rather than a one-off.

Note: while fully bypassed the wrapped processor is skipped entirely, so its internal state freezes. For memoryless / short-state processors the dry/wet crossfade on re-engage is click-free. For long-tail / feedback processors (delays, reverbs) the frozen state resumes on re-engage, which the mix crossfade cannot fully smooth — keep such a processor running through the bypass (e.g. wrap a dry/wet level rather than SoftBypass) if tail continuity matters.

RT contract: process()/set_bypassed()/set_fade_samples() are allocation-free and audio-thread safe when the wrapped processor is. set_fade_samples() and the bypass target are plain stores; the fade is applied per sample.