zitarev

Files: zitarev.h, zitarev.c

8 FDN stereo zitareverb algorithm, imported from Faust.

Functions

sp_zitarev_create(sp_zitarev **zitarev)
sp_zitarev_init(sp_data *sp, sp_zitarev *zitarev)
sp_zitarev_compute(sp_data *sp, sp_zitarev *zitarev, SPFLOAT *input_1, SPFLOAT *input_2, SPFLOAT *out_1, SPFLOAT *out_2)
sp_zitarev_destroy(sp_zitarev **zitarev)

Optional Parameters

in_delay: Delay in ms before reverberation begins.
(Default value: 60)
lf_x: Crossover frequency separating low and middle frequencies (Hz).
(Default value: 200)
rt60_low: Time (in seconds) to decay 60db in low-frequency band.
(Default value: 3.0)
rt60_mid: Time (in seconds) to decay 60db in mid-frequency band.
(Default value: 2.0)
hf_damping: Frequency (Hz) at which the high-frequency T60 is half the middle-band's T60.
(Default value: 6000.0)
eq1_freq: Center frequency of second-order Regalia Mitra peaking equalizer section 1.
(Default value: 315.0)
eq1_level: Peak level in dB of second-order Regalia-Mitra peaking equalizer section 1
(Default value: 0)
eq2_freq: Center frequency of second-order Regalia Mitra peaking equalizer section 2.
(Default value: 1500.0)
eq2_level: Peak level in dB of second-order Regalia-Mitra peaking equalizer section 2
(Default value: 0)
mix: 0 = all dry, 1 = all wet
(Default value: 1)
level: Output scale factor (in dB).
(Default value: -20)

Inputs

input_1: First input.
input_2: Second input.

Outputs

out_1: Channel 1 output. Most likely for the left channel.
out_2: Channel 2 output. Mose likely for the right channel.

Example Code

#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include "soundpipe.h"

typedef struct {
    sp_diskin *disk;
    sp_zitarev *rev;
    int counter;
} UserData;

void process(sp_data *sp , void *udata) {
    UserData *ud = udata;
    SPFLOAT in = 0;
    SPFLOAT out = 0;
    SPFLOAT foo = 0;

    sp_diskin_compute(sp, ud->disk, NULL, &in);
    sp_zitarev_compute(sp, ud->rev, &in, &in, &sp->out[0], &foo);
}

int main() {
    srand(time(NULL));
    UserData ud;
    ud.counter = 0;
    sp_data *sp;
    sp_create(&sp);
    sp_diskin_create(&ud.disk);
    sp_zitarev_create(&ud.rev);

    sp_diskin_init(sp, ud.disk, "oneart.wav");
    sp_zitarev_init(sp, ud.rev);
    *ud.rev->level = 0;
    *ud.rev->in_delay = 20;

    sp->len = 44100 * 5;
    sp_process(sp, &ud, process);

    sp_diskin_destroy(&ud.disk);
    sp_zitarev_destroy(&ud.rev);
    sp_destroy(&sp);
    return 0;
}