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

Control-driven amplifier with a linear or exponential response and built-in control lag. More...

#include <pulp/signal/smoothed_value.hpp>
#include <algorithm>
#include <cmath>
#include <cstdint>

Go to the source code of this file.

Classes

class  pulp::signal::VcaT< SampleType >
 Voltage-controlled amplifier. More...

Namespaces

namespace  pulp
namespace  pulp::signal

Typedefs

using pulp::signal::Vca = VcaT<float>
using pulp::signal::Vca64 = VcaT<double>

Enumerations

enum class  pulp::signal::VcaResponse : std::uint8_t { pulp::signal::linear , pulp::signal::exponential }

Detailed Description

Control-driven amplifier with a linear or exponential response and built-in control lag.

RT contract: prepare() and the set_*() setters are control-side calls; process(), gain_for(), reset(), and the accessors allocate nothing and are audio-thread safe. The type owns no memory.

USE — the VCA idioms worth knowing, because "multiply by a control" is one line and every one of these is still a distinct musical result:

  • Tremolo — a 4-7 Hz sine at 20-40% depth (the depth belongs to an AttenuverterT, not here). The exponential response reads more "amp-like" than linear, because loudness perception is closer to logarithmic than the control is.
  • Auto-pan — LfoT::next_quadrature() into two of these. Constant power by construction: sin^2 + cos^2 = 1, so the pair cannot dip in the middle the way two offset triangles do.
  • Sidechain pump with no compressor — TriggerDetectT on the kick, into an ArT (attack = how fast it ducks, release = how fast it recovers), inverted through an AttenuverterT(gain -0.8, offset 1), into this. The exact pump shape you asked for, deterministic, and immune to the kick's level changing.
  • Chopper — a square LFO or a GateGenT through the lag. The lag is the click-versus-crunch knob; it is the whole difference between a gate and a glitch.
  • AM and ring territory — an audio-rate LFO into a linear-response VCA is clean amplitude modulation. Sweeping the LFO rate from 5 Hz upward plays the tremolo-to-sideband transition as a gesture rather than as a mode switch.