20 process(std::span<const float> input, std::span<float> left, std::span<float> right) = 0;
37 void reset() noexcept { state_ = 0.0; }
39 [[nodiscard]]
double process(
double input)
noexcept
68 [[nodiscard]]
static double send_gain(
int controller)
noexcept
76 process(std::span<const float> input, std::span<float> left, std::span<float> right)
override;
79 void process(std::span<const float> input,
80 std::span<const float> chorus_left,
81 std::span<const float> chorus_right,
82 std::span<float> left,
83 std::span<float> right);
86 static constexpr int ring_mask =
ring_size - 1;
87 static constexpr int input_tap = 0x1000;
95 double& state)
noexcept;
98 std::vector<double> ring_ = std::vector<double>(
ring_size, 0.0);
100 double dc_state_ = 0.0;
102 double tank_state_a_ = 0.0;
103 double tank_state_b_ = 0.0;
104 int write_cursor_ = 0;
123 [[nodiscard]]
static double send_gain(
int controller)
noexcept
131 process(std::span<const float> input, std::span<float> left, std::span<float> right)
override;
134 static constexpr int ring_mask =
ring_size - 1;
135 static constexpr int phase_sign = 1 << 24;
136 static constexpr int phase_half = 1 << 23;
138 [[nodiscard]]
double read_tap(
int depth,
int base_delay,
int triangle)
const noexcept;
141 std::vector<double> ring_ = std::vector<double>(
ring_size, 0.0);
144 double dc_state_ = 0.0;
145 double lowpass_ = 0.0;
146 double feedback_ = 0.0;
147 int write_cursor_ = 0;
177 [[nodiscard]]
static double send_gain(
int send)
noexcept
194 process(std::span<const float> input, std::span<float> left, std::span<float> right)
override;
197 static constexpr int ring_mask =
ring_size - 1;
200 std::vector<double> ring_ = std::vector<double>(
ring_size, 0.0);
203 double pre_low_pass_coefficient_ = 0.0;
204 std::vector<float> pending_left_;
205 std::vector<float> pending_right_;
207 double lowpass_ = 0.0;
208 int write_cursor_ = 0;
static Chorus for_type(std::optional< int > type)
Creates a chorus for a GS type 0–7, or the default when none is given.
static double send_gain(int controller) noexcept
The send-bus gain for CC#93.
Definition send_effects.hpp:123
void process(std::span< const float > input, std::span< float > left, std::span< float > right) override
Processes a block.
Chorus(const ChorusPreset &preset)
Definition send_effects.hpp:117
static constexpr int ring_size
Size of the delay ring.
Definition send_effects.hpp:115
void reset() override
Clears all internal state.
The engine's DC blocker: one design, instantiated once on each effect input.
Definition send_effects.hpp:32
static constexpr double state_coefficient
Definition send_effects.hpp:35
static constexpr double input_coefficient
Definition send_effects.hpp:34
void reset() noexcept
Definition send_effects.hpp:37
double process(double input) noexcept
Definition send_effects.hpp:39
A stereo send effect fed from one mono bus.
Definition send_effects.hpp:14
virtual void process(std::span< const float > input, std::span< float > left, std::span< float > right)=0
Processes a block.
virtual void reset()=0
Clears all internal state.
virtual ~Effect()=default
static Reverb for_type(std::optional< int > type)
Creates a reverb for a GS type 0–7, or the default when none is given.
void process(std::span< const float > input, std::span< const float > chorus_left, std::span< const float > chorus_right, std::span< float > left, std::span< float > right)
Processes a block with the chorus feeding into it; either chorus span may be empty.
static double send_gain(int controller) noexcept
The send-bus gain for CC#91. Linear in the controller, unlike the volume law.
Definition send_effects.hpp:68
void reset() override
Clears all internal state.
void process(std::span< const float > input, std::span< float > left, std::span< float > right) override
Processes a block.
Reverb(const ReverbPreset &preset)
Definition send_effects.hpp:62
static constexpr int ring_size
Size of the shared delay ring.
Definition send_effects.hpp:60
static double send_gain(int send) noexcept
The send-bus gain for a part's delay send, 0–127.
Definition send_effects.hpp:177
SystemDelay(const DelayParameters ¶meters)
static constexpr int ring_size
Size of the delay ring.
Definition send_effects.hpp:167
void reset() override
Clears all internal state.
static DelayParameters compile(std::span< const int > raw, int sample_rate=32000)
Compiles ten raw GS parameters into DSP coefficients.
static double ratio_percent(int raw)
Converts a raw ratio value, 1–120, to a percentage.
void process(std::span< const float > input, std::span< float > left, std::span< float > right) override
Processes a block.
static SystemDelay for_type(int type)
Creates a delay for a GS type 0–9.
static double time_milliseconds(int raw)
Converts a raw time value, 1–115, to milliseconds.
Definition control_decode.hpp:7
One allpass stage: a read tap, a write tap and the two coefficients around them.
Definition effect_presets.hpp:12
Coefficients for one GS chorus type.
Definition effect_presets.hpp:68
static constexpr double send_at_full_scale
Send-bus gain at controller 127.
Definition effect_presets.hpp:94
Compiled coefficients for one GS delay type.
Definition send_effects.hpp:151
double left_gain
Definition send_effects.hpp:156
double centre_gain
Definition send_effects.hpp:155
double send_to_reverb
Definition send_effects.hpp:160
double right_gain
Definition send_effects.hpp:157
int centre_samples
Definition send_effects.hpp:152
int pre_low_pass
Definition send_effects.hpp:159
int left_samples
Definition send_effects.hpp:153
double feedback
Definition send_effects.hpp:158
int right_samples
Definition send_effects.hpp:154
static constexpr double send_at_full_scale
Send-bus gain at full scale.
Definition effect_presets.hpp:104
static constexpr int pre_delay_samples
Fixed input pre-delay ahead of the feedback line, in samples — 60 ms at 32 kHz.
Definition effect_presets.hpp:109
Coefficients for one GS reverb type.
Definition effect_presets.hpp:53
static constexpr double send_at_full_scale
Send-bus gain at controller 127.
Definition effect_presets.hpp:84
One reverb tank.
Definition effect_presets.hpp:38
One reverb tank's eight ring offsets, resolved from their names once.
Definition effect_presets.hpp:26