phaser

Files: phaser.h, phaser.c

A stereo phaser
This is a stereo phaser, generated from Faust code taken from the Guitarix project.

Functions

sp_phaser_create(sp_phaser **phaser)
sp_phaser_init(sp_data *sp, sp_phaser *phaser)
sp_phaser_compute(sp_data *sp, sp_phaser *phaser, SPFLOAT *input1, SPFLOAT *input2, SPFLOAT *out_left, SPFLOAT *out_right)
sp_phaser_destroy(sp_phaser **phaser)

Optional Parameters

MaxNotch1Freq: Between 20 and 10000
(Default value: 800)
MinNotch1Freq: Between 20 and 5000
(Default value: 100)
Notch_width: Between 10 and 5000
(Default value: 1000)
NotchFreq: Between 1.1 and 4
(Default value: 1.5)
VibratoMode: 1 or 0
(Default value: 1)
depth: Between 0 and 1
(Default value: 1)
feedback_gain: Between 0 and 1
(Default value: 0)
invert: 1 or 0
(Default value: 0)
level: -60 to 10 dB
(Default value: 0)
lfobpm: Between 24 and 360
(Default value: 30)

Inputs

input1: This probably the left audio input signal.
input2: This probably the right audio input signal.

Outputs

out_left: Stereo left output for phaser.
out_right: Stereo right output for phaser.

Example Code

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

typedef struct {
    sp_phaser *phaser;
    sp_diskin *disk;
} UserData;

void process(sp_data *sp, void *udata) {
    UserData *ud = udata;
    SPFLOAT disk1 = 0, disk2 = 0, phaser = 0, foo = 0;
    sp_diskin_compute(sp, ud->disk, NULL, &disk1);
    disk2 = disk1;
    sp_phaser_compute(sp, ud->phaser, &disk1, &disk2, &phaser, &foo);
    sp->out[0] = phaser;
}

int main() {
    UserData ud;
    sp_data *sp;
    sp_create(&sp);

    sp_phaser_create(&ud.phaser);
    sp_diskin_create(&ud.disk);

    sp_diskin_init(sp, ud.disk, "oneart.wav");
    sp_phaser_init(sp, ud.phaser);
    
    sp->len = 44100 * 5;
    sp_process(sp, &ud, process);

    sp_phaser_destroy(&ud.phaser);
    sp_diskin_destroy(&ud.disk);

    sp_destroy(&sp);
    return 0;
}