Skip to content

Commit

Permalink
fix reverb initialization.
Browse files Browse the repository at this point in the history
Due to non-zeroed re-allocation of the reverb-buffers
there may have been clicks, strange-noise or even
just silence all the time (huge float values).
  • Loading branch information
x42 committed Apr 6, 2013
1 parent 3e416e6 commit e7a0c6a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion b_reverb/reverb.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ static void setReverbPointers (struct b_reverb *r, int i) {
if (!r->delays[i]) {
fprintf (stderr, "FATAL: memory allocation failed for reverb.\n");
exit(1);
} else {
memset(r->delays[i], 0 , (e + 2) * sizeof(float));
}
r->endp[i] = r->delays[i] + e + 1;
r->idx0[i] = r->idxp[i] = &(r->delays[i][0]);
Expand Down Expand Up @@ -320,7 +322,6 @@ float * reverb (struct b_reverb *r,
const float xo = (*xp++);
const float x = y_1 + (inputGain * xo) + DENORMAL_HACK;
float xa = 0.0;

/* First we do four feedback comb filters (ie parallel delay lines,
each with a single tap at the end that feeds back at the start) */

Expand Down

0 comments on commit e7a0c6a

Please sign in to comment.