34class Freeverb :
public Base {
37 ~Freeverb()
override =
default;
41 void setRoomSize(
float value)
override {
42 roomsize = (value * scaleroom) + offsetroom;
46 [[nodiscard]]
constexpr float getRoomSize()
const override {
return (roomsize - offsetroom) / scaleroom; }
48 void setDamping(
float value)
override {
49 damp = value * scaledamp;
53 [[nodiscard]]
constexpr float getDamping()
const override {
return damp / scaledamp; }
55 void setWet(
float value) {
56 wet = value * scalewet;
60 [[nodiscard]]
constexpr float getWet()
const {
return wet / scalewet; }
62 void setDry(
float value) { dry = value * scaledry; }
64 [[nodiscard]]
constexpr float getDry()
const {
return dry / scaledry; }
66 void setWidth(
float value)
override {
71 [[nodiscard]]
constexpr float getWidth()
const override {
return width; }
73 [[gnu::always_inline]]
void ProcessOne(int32_t input,
StereoSample& output_sample) {
78 combs_.process(input, out_l, out_r);
81 allpasses_.process(out_l, out_r);
84 out_l = (out_l + multiply_32x32_rshift32_rounded(out_r, wet2)) << 1;
85 out_r = (out_r + multiply_32x32_rshift32_rounded(out_l, wet2)) << 1;
88 output_sample.l += multiply_32x32_rshift32_rounded(out_l, this->getPanLeft());
89 output_sample.r += multiply_32x32_rshift32_rounded(out_r, this->getPanRight());
92 void process(std::span<int32_t> input, std::span<StereoSample> output)
override;
117 std::array<int32_t, combtuningL1 + maxblockframes> bufcombL1;
118 std::array<int32_t, combtuningR1 + maxblockframes> bufcombR1;
119 std::array<int32_t, combtuningL2 + maxblockframes> bufcombL2;
120 std::array<int32_t, combtuningR2 + maxblockframes> bufcombR2;
121 std::array<int32_t, combtuningL3 + maxblockframes> bufcombL3;
122 std::array<int32_t, combtuningR3 + maxblockframes> bufcombR3;
123 std::array<int32_t, combtuningL4 + maxblockframes> bufcombL4;
124 std::array<int32_t, combtuningR4 + maxblockframes> bufcombR4;
125 std::array<int32_t, combtuningL5 + maxblockframes> bufcombL5;
126 std::array<int32_t, combtuningR5 + maxblockframes> bufcombR5;
127 std::array<int32_t, combtuningL6 + maxblockframes> bufcombL6;
128 std::array<int32_t, combtuningR6 + maxblockframes> bufcombR6;
129 std::array<int32_t, combtuningL7 + maxblockframes> bufcombL7;
130 std::array<int32_t, combtuningR7 + maxblockframes> bufcombR7;
131 std::array<int32_t, combtuningL8 + maxblockframes> bufcombL8;
132 std::array<int32_t, combtuningR8 + maxblockframes> bufcombR8;
135 std::array<int32_t, allpasstuningL1 + maxblockframes> bufallpassL1;
136 std::array<int32_t, allpasstuningR1 + maxblockframes> bufallpassR1;
137 std::array<int32_t, allpasstuningL2 + maxblockframes> bufallpassL2;
138 std::array<int32_t, allpasstuningR2 + maxblockframes> bufallpassR2;
139 std::array<int32_t, allpasstuningL3 + maxblockframes> bufallpassL3;
140 std::array<int32_t, allpasstuningR3 + maxblockframes> bufallpassR3;
141 std::array<int32_t, allpasstuningL4 + maxblockframes> bufallpassL4;
142 std::array<int32_t, allpasstuningR4 + maxblockframes> bufallpassR4;
144 int32_t reverb_send_post_lpf_ = 0;