struct MyEffect : Stereo::Effect {
Delay<192000> feedforward[2];
Delay<192000> feedback[2];
LPF filter[2];
param times[2][8] =
{ 2.078, 5.154, 5.947, 7.544, 8.878, 10.422, 13.938, 17.140 };
param gains[8] =
{ .609, .262, -.360, -.470, .290, -.423, .100, .200 };
MyEffect() {
controls = {
Dial("Resonance", 0, 0.5, 0.4),
Dial("Room Size", 0, 0.4, 0.2),
Dial("Brightness", 500, 5000, 2250),
};
for(int t=0; t<8; t++)
times[1][t] = times[0][t] * (1.f - 0.2f * gains[t]);
}
void prepare() {
filter[0].set(controls[2]);
filter[1].set(controls[2]);
}
// early reflections
signal early(int chn) {
in[chn] >> feedforward[chn];
signal mix = in[chn];
for(int t=0; t<8; t++)
mix += feedforward[chn](times[chn][t] * fs/1000) * gains[t];
return mix;
}
// early reflections
signal late(int chn) {
return controls[0] * feedback[chn]((controls[1] + 0.01232 * chn) * fs) >> filter[chn];
}
void process() {
early(0) + late(0) >> out.l >> feedback[0];
early(1) + late(1) >> out.r >> feedback[1];
}
};