Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::signal::AnalogVcfT< SampleType > Class Template Reference

Measured panel voicings backed by a four-pole nonlinear OTA cascade. More...

#include <analog_vcf.hpp>

Public Types

enum class  Voicing { juno , jupiter , prophet5 , minimoog }
 Selects the complete measured cutoff, resonance, headroom, compensation, saturation, cross-modulation, makeup, and drift law. More...

Public Member Functions

 AnalogVcfT () noexcept
 Constructs the default configuration and clears all DSP history.
void set_sample_rate (double sample_rate) noexcept
 Sets the base sample rate in Hz, with values below 64 Hz clamped to 64.
void set_oversampling (int factor) noexcept
 Sets the oversampling factor to 1, 2, 4, 8, or 16.
void set_voicing (Voicing voicing) noexcept
 Selects a measured voicing and clears DSP history when it changes.
void set_cutoff (SampleType knob01, SampleType modulation_octaves=0) noexcept
 Sets panel cutoff and modulation without clearing DSP history.
void set_resonance (SampleType knob01) noexcept
 Sets the panel resonance position, clamped to [0, 1].
void set_drive_db (SampleType drive_db) noexcept
 Sets input drive in dB; the underlying engine clamps it to [-96, 72] dB.
void set_parameters (SampleType cutoff_knob01, SampleType modulation_octaves, SampleType resonance_knob01, SampleType drive_db) noexcept
 Updates all sample-accurate controls as one transaction.
void set_smoothing_time_ms (double milliseconds) noexcept
 Sets coefficient smoothing time in milliseconds.
SampleType process (SampleType input) noexcept
 Processes one base-rate sample and advances filter, oversampling, smoothing, and deterministic drift state.
void process (SampleType *buffer, int num_samples) noexcept
 Processes num_samples in place at the base sample rate.
void reset () noexcept
 Clears filter and oversampler history, restores deterministic drift state, and snaps smoothed values to their current targets.
int latency_samples () const noexcept
 Returns the current fixed oversampling delay in base-rate samples.
double cutoff_hz () const noexcept
 Returns the table-derived requested corner in Hz.
int oversampling () const noexcept
 Returns the active oversampling factor: 1, 2, 4, 8, or 16.
Voicing voicing () const noexcept
 Returns the active measured voicing.

Static Public Member Functions

static constexpr int latency_samples_for_oversampling (int factor) noexcept
 Returns fixed base-rate latency for an oversampling factor.
static double requested_cutoff_hz_for (Voicing voicing, double knob01, double modulation_octaves=0.0) noexcept
 Converts panel cutoff to the requested corner in Hz without an instance.

Detailed Description

template<typename SampleType = float>
class pulp::signal::AnalogVcfT< SampleType >

Measured panel voicings backed by a four-pole nonlinear OTA cascade.

The default state is a Juno voicing at 44.1 kHz and 2x oversampling, with cutoff 0.5 (262 Hz requested corner), zero resonance, zero dB drive, and no coefficient smoothing. Processing and configuration use fixed storage and allocate no memory. Configuration methods that clear DSP history say so explicitly below.

Template Parameters
SampleTypeFloating-point sample scalar; normally float or double.

Member Enumeration Documentation

◆ Voicing

template<typename SampleType = float>
enum class pulp::signal::AnalogVcfT::Voicing
strong

Selects the complete measured cutoff, resonance, headroom, compensation, saturation, cross-modulation, makeup, and drift law.

Enumerator
juno 

Roland Juno-style IR3109 voicing; the default.

jupiter 

Roland Jupiter-8-style IR3109 voicing.

prophet5 

Sequential Prophet-5-style SSM/CEM voicing.

minimoog 

Minimoog-style transistor-ladder voicing.

Constructor & Destructor Documentation

◆ AnalogVcfT()

template<typename SampleType = float>
pulp::signal::AnalogVcfT< SampleType >::AnalogVcfT ( )
inlinenoexcept

Constructs the default configuration and clears all DSP history.

Member Function Documentation

◆ cutoff_hz()

template<typename SampleType = float>
double pulp::signal::AnalogVcfT< SampleType >::cutoff_hz ( ) const
inlinenoexcept

Returns the table-derived requested corner in Hz.

This is panel intent, not necessarily the realized -3 dB corner: the derived engine pole is clamped to [20 Hz, 0.45 * sample_rate]. Code that must match rendered audio should measure the realized response.

◆ latency_samples()

template<typename SampleType = float>
int pulp::signal::AnalogVcfT< SampleType >::latency_samples ( ) const
inlinenoexcept

Returns the current fixed oversampling delay in base-rate samples.

◆ latency_samples_for_oversampling()

template<typename SampleType = float>
constexpr int pulp::signal::AnalogVcfT< SampleType >::latency_samples_for_oversampling ( int factor)
inlinestaticconstexprnoexcept

Returns fixed base-rate latency for an oversampling factor.

The mapping is 1x/2x/4x/8x/16x to 0/32/48/56/60 samples. Returns -1 for any invalid factor; unlike set_oversampling(), this does not apply the invalid-factor fallback.

◆ oversampling()

template<typename SampleType = float>
int pulp::signal::AnalogVcfT< SampleType >::oversampling ( ) const
inlinenoexcept

Returns the active oversampling factor: 1, 2, 4, 8, or 16.

◆ process() [1/2]

template<typename SampleType = float>
void pulp::signal::AnalogVcfT< SampleType >::process ( SampleType * buffer,
int num_samples )
inlinenoexcept

Processes num_samples in place at the base sample rate.

A null buffer or non-positive count is a no-op.

◆ process() [2/2]

template<typename SampleType = float>
SampleType pulp::signal::AnalogVcfT< SampleType >::process ( SampleType input)
inlinenoexcept

Processes one base-rate sample and advances filter, oversampling, smoothing, and deterministic drift state.

◆ requested_cutoff_hz_for()

template<typename SampleType = float>
double pulp::signal::AnalogVcfT< SampleType >::requested_cutoff_hz_for ( Voicing voicing,
double knob01,
double modulation_octaves = 0.0 )
inlinestaticnoexcept

Converts panel cutoff to the requested corner in Hz without an instance.

Parameters
voicingMeasured cutoff table to use.
knob01Panel position, clamped to [0, 1].
modulation_octavesPitch-domain offset in octaves, clamped to [-16, 16]; defaults to zero.
Returns
The requested, sample-rate-independent corner in Hz. Engine pole clamping is intentionally not represented.

◆ reset()

template<typename SampleType = float>
void pulp::signal::AnalogVcfT< SampleType >::reset ( )
inlinenoexcept

Clears filter and oversampler history, restores deterministic drift state, and snaps smoothed values to their current targets.

Control settings, voicing, sample rate, and oversampling are preserved.

◆ set_cutoff()

template<typename SampleType = float>
void pulp::signal::AnalogVcfT< SampleType >::set_cutoff ( SampleType knob01,
SampleType modulation_octaves = 0 )
inlinenoexcept

Sets panel cutoff and modulation without clearing DSP history.

Parameters
knob01Panel position, clamped to [0, 1].
modulation_octavesPitch-domain offset in octaves, clamped to [-16, 16]; defaults to zero.

◆ set_drive_db()

template<typename SampleType = float>
void pulp::signal::AnalogVcfT< SampleType >::set_drive_db ( SampleType drive_db)
inlinenoexcept

Sets input drive in dB; the underlying engine clamps it to [-96, 72] dB.

This updates the smoothed target without clearing DSP history.

◆ set_oversampling()

template<typename SampleType = float>
void pulp::signal::AnalogVcfT< SampleType >::set_oversampling ( int factor)
inlinenoexcept

Sets the oversampling factor to 1, 2, 4, 8, or 16.

Invalid factors select 2x through the underlying engine. Every call reapplies the active voicing and clears DSP history.

◆ set_parameters()

template<typename SampleType = float>
void pulp::signal::AnalogVcfT< SampleType >::set_parameters ( SampleType cutoff_knob01,
SampleType modulation_octaves,
SampleType resonance_knob01,
SampleType drive_db )
inlinenoexcept

Updates all sample-accurate controls as one transaction.

Parameters
cutoff_knob01Panel cutoff, clamped to [0, 1].
modulation_octavesCutoff offset in octaves, clamped to [-16, 16].
resonance_knob01Panel resonance, clamped to [0, 1].
drive_dbInput drive in dB, clamped by the engine to [-96, 72].

This is equivalent to the individual setters but avoids evaluating the measured laws twice when cutoff and resonance arrive together. It does not clear DSP history.

◆ set_resonance()

template<typename SampleType = float>
void pulp::signal::AnalogVcfT< SampleType >::set_resonance ( SampleType knob01)
inlinenoexcept

Sets the panel resonance position, clamped to [0, 1].

The measured voicing law is updated without clearing DSP history.

◆ set_sample_rate()

template<typename SampleType = float>
void pulp::signal::AnalogVcfT< SampleType >::set_sample_rate ( double sample_rate)
inlinenoexcept

Sets the base sample rate in Hz, with values below 64 Hz clamped to 64.

Reapplies the active voicing and clears filter, oversampler, and drift history, even when the supplied rate equals the current rate.

◆ set_smoothing_time_ms()

template<typename SampleType = float>
void pulp::signal::AnalogVcfT< SampleType >::set_smoothing_time_ms ( double milliseconds)
inlinenoexcept

Sets coefficient smoothing time in milliseconds.

Negative values select zero, so targets are reached on the next processed sample. This does not clear DSP history.

◆ set_voicing()

template<typename SampleType = float>
void pulp::signal::AnalogVcfT< SampleType >::set_voicing ( Voicing voicing)
inlinenoexcept

Selects a measured voicing and clears DSP history when it changes.

Passing the active voicing is a no-op.

◆ voicing()

template<typename SampleType = float>
Voicing pulp::signal::AnalogVcfT< SampleType >::voicing ( ) const
inlinenoexcept

Returns the active measured voicing.


The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/signal/include/pulp/signal/analog_vcf.hpp