Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::host::pitch::whammy Namespace Reference

Classes

struct  Instance

Typedefs

using Shifter = signal::PitchShifter

Functions

signal::PedalMode decode_pedal_mode (float v)
 Decodes the stepped pedal_mode value.
float whammy_worst_case_gain (double sample_rate)
 Worst-case linear gain for the Forge registry (series law 8).
int whammy_latency_samples (double sample_rate, double window_ms=Shifter::kWindowMsDefault)
 The node's reported latency at a given window and sample rate, in samples.
float whammy_default_mix_for_mode (signal::PedalMode mode)
 The conventional dry/wet default for a mode, for the PRESET layer.
CustomNodeType make_whammy_node (double window_ms=Shifter::kWindowMsDefault)
 The expression-pedal pitch shifter as a lowerable custom node.
ForgeNodeDescriptor descriptor ()

Variables

constexpr const char * kTypeId = "pitch.whammy"
constexpr state::ParamID kPedal = 1
constexpr state::ParamID kPedalMode = 2
constexpr state::ParamID kShiftSource = 3
constexpr state::ParamID kShiftSemitones = 4
constexpr state::ParamID kHeelSemis = 5
constexpr state::ParamID kToeSemis = 6
constexpr state::ParamID kIntervalASemis = 7
constexpr state::ParamID kIntervalBSemis = 8
constexpr state::ParamID kDetuneCents = 9
constexpr state::ParamID kDiveFloorSemis = 10
constexpr state::ParamID kGlideUpMs = 11
constexpr state::ParamID kGlideDownMs = 12
constexpr state::ParamID kMix = 13
constexpr state::ParamID kDetents = 14
constexpr state::ParamID kInterp = 15
constexpr state::ParamID kDriftDepth = 16
constexpr float kModeWhammy = 0.0f
 The pedal_mode param's stepped encoding.
constexpr float kModeHarmony = 1.0f
constexpr float kModeDetune = 2.0f
constexpr float kModeDive = 3.0f
constexpr float kSourcePedal = 0.0f
 The shift_source param's stepped encoding.
constexpr float kSourceDirect = 1.0f
constexpr float kInterpLinear = 0.0f
 The interp param's stepped encoding.
constexpr float kInterpCubic = 1.0f

Typedef Documentation

◆ Shifter

Function Documentation

◆ decode_pedal_mode()

signal::PedalMode pulp::host::pitch::whammy::decode_pedal_mode ( float v)

Decodes the stepped pedal_mode value.

Rounds rather than truncates so a host that sends 0.9999 for "harmony" gets harmony instead of whammy.

◆ descriptor()

ForgeNodeDescriptor pulp::host::pitch::whammy::descriptor ( )

◆ make_whammy_node()

CustomNodeType pulp::host::pitch::whammy::make_whammy_node ( double window_ms = Shifter::kWindowMsDefault)

The expression-pedal pitch shifter as a lowerable custom node.

window_ms is a construction-time argument, not a param: it IS this member's latency_samples(), and it sets the warble rate. The DSP sizes its line for the whole declared range at prepare(), so any value in range is allocation-free — it is frozen here for the host's sake.

◆ whammy_default_mix_for_mode()

float pulp::host::pitch::whammy::whammy_default_mix_for_mode ( signal::PedalMode mode)

The conventional dry/wet default for a mode, for the PRESET layer.

Deliberately not applied when the pedal_mode param moves — see the note at the top of this file.

◆ whammy_latency_samples()

int pulp::host::pitch::whammy::whammy_latency_samples ( double sample_rate,
double window_ms = Shifter::kWindowMsDefault )

The node's reported latency at a given window and sample rate, in samples.

Exposed because CustomNodeType cannot declare latency and the graph's PDC therefore sees zero (see the gap note at the top of this file). A host that needs to align a whammy branch against a dry one has to read this and compensate itself. Computed by the shipped block rather than by repeating its expression here.

◆ whammy_worst_case_gain()

float pulp::host::pitch::whammy::whammy_worst_case_gain ( double sample_rate)

Worst-case linear gain for the Forge registry (series law 8).

Cited from the invariant the DSP suite asserts, not re-derived here.

This used to be kWorstCaseGain * dc_blocker_peak_gain() with kWorstCaseGain = √2 and the DC blocker contributing 2/(1+p) at Nyquist — 1.000327 at 48 kHz, so the product was 1.4147. Measured, the node reaches 2.2117 on sustained near-DC content: the registry was understating the headroom a downstream stage plans against by 3.9 dB.

The error was using the DC blocker's MAGNITUDE-response peak as a bound on its worst single SAMPLE. Those are different quantities; the sample bound is the impulse response's L1 norm, which is exactly 2 at every pole position. Shifter::kWorstCaseGain now folds that in — an equal-power mix maximises cos θ · 1 + sin θ · 2 at √5 — so it is the whole bound and multiplying by the blocker again would double-count it.

No longer sample-rate dependent, and that is a consequence rather than a simplification: the L1 norm of y[n] = x[n] − x[n−1] + p·y[n−1] is 2 for every p, so the pole's position (and hence the rate) drops out.

Variable Documentation

◆ kDetents

state::ParamID pulp::host::pitch::whammy::kDetents = 14
inlineconstexpr

◆ kDetuneCents

state::ParamID pulp::host::pitch::whammy::kDetuneCents = 9
inlineconstexpr

◆ kDiveFloorSemis

state::ParamID pulp::host::pitch::whammy::kDiveFloorSemis = 10
inlineconstexpr

◆ kDriftDepth

state::ParamID pulp::host::pitch::whammy::kDriftDepth = 16
inlineconstexpr

◆ kGlideDownMs

state::ParamID pulp::host::pitch::whammy::kGlideDownMs = 12
inlineconstexpr

◆ kGlideUpMs

state::ParamID pulp::host::pitch::whammy::kGlideUpMs = 11
inlineconstexpr

◆ kHeelSemis

state::ParamID pulp::host::pitch::whammy::kHeelSemis = 5
inlineconstexpr

◆ kInterp

state::ParamID pulp::host::pitch::whammy::kInterp = 15
inlineconstexpr

◆ kInterpCubic

float pulp::host::pitch::whammy::kInterpCubic = 1.0f
inlineconstexpr

◆ kInterpLinear

float pulp::host::pitch::whammy::kInterpLinear = 0.0f
inlineconstexpr

The interp param's stepped encoding.

◆ kIntervalASemis

state::ParamID pulp::host::pitch::whammy::kIntervalASemis = 7
inlineconstexpr

◆ kIntervalBSemis

state::ParamID pulp::host::pitch::whammy::kIntervalBSemis = 8
inlineconstexpr

◆ kMix

state::ParamID pulp::host::pitch::whammy::kMix = 13
inlineconstexpr

◆ kModeDetune

float pulp::host::pitch::whammy::kModeDetune = 2.0f
inlineconstexpr

◆ kModeDive

float pulp::host::pitch::whammy::kModeDive = 3.0f
inlineconstexpr

◆ kModeHarmony

float pulp::host::pitch::whammy::kModeHarmony = 1.0f
inlineconstexpr

◆ kModeWhammy

float pulp::host::pitch::whammy::kModeWhammy = 0.0f
inlineconstexpr

The pedal_mode param's stepped encoding.

Ordered so 0 is the default and the two continuous-bend modes sit at the ends.

◆ kPedal

state::ParamID pulp::host::pitch::whammy::kPedal = 1
inlineconstexpr

◆ kPedalMode

state::ParamID pulp::host::pitch::whammy::kPedalMode = 2
inlineconstexpr

◆ kShiftSemitones

state::ParamID pulp::host::pitch::whammy::kShiftSemitones = 4
inlineconstexpr

◆ kShiftSource

state::ParamID pulp::host::pitch::whammy::kShiftSource = 3
inlineconstexpr

◆ kSourceDirect

float pulp::host::pitch::whammy::kSourceDirect = 1.0f
inlineconstexpr

◆ kSourcePedal

float pulp::host::pitch::whammy::kSourcePedal = 0.0f
inlineconstexpr

The shift_source param's stepped encoding.

◆ kToeSemis

state::ParamID pulp::host::pitch::whammy::kToeSemis = 6
inlineconstexpr

◆ kTypeId

const char* pulp::host::pitch::whammy::kTypeId = "pitch.whammy"
inlineconstexpr