You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
522 B
17 lines
522 B
1 year ago
|
#include <cmath>
|
||
|
|
||
1 year ago
|
#include "dsp/reverb.h"
|
||
1 year ago
|
|
||
|
Reverb::Reverb() {
|
||
|
size_t interval = REVERB_FRAMES / REVERB_TAPS - 4096 / REVERB_TAPS;
|
||
|
for(size_t tap = 0; tap < REVERB_TAPS; ++tap) {
|
||
|
float gain = exp2f(-8.f + 8.f * tap / (REVERB_TAPS - 1));
|
||
|
taps[tap] = {
|
||
|
.lp = tap * interval + (rand() % interval),
|
||
|
.rp = tap * interval + (rand() % interval),
|
||
|
.lg = (rand() > RAND_MAX / 2 ? 1 : -1) * gain,
|
||
|
.rg = (rand() > RAND_MAX / 2 ? 1 : -1) * gain
|
||
|
};
|
||
|
}
|
||
|
}
|