Files: fof.h, fof.c

Produces sinusoid bursts for granular and formant synthesis


sp_fof_create(sp_fof **fof)
sp_fof_init(sp_data *sp, sp_fof *fof, sp_ftbl *sine, sp_ftbl *win, int iolaps, SPFLOAT iphs)
sp_fof_compute(sp_data *sp, sp_fof *fof, SPFLOAT *out)
sp_fof_destroy(sp_fof **fof)

Mandatory Parameters

sine: ftable for sine wave.
(Recommended value: N/A)
win: Ftable for envelope function (use either gen_line or gen_sinecomp)
(Recommended value: N/A)
iolaps: Maximum number of foflet overlaps.
(Recommended value: 100)
iphs: Phase
(Recommended value: 0)

Optional Parameters

amp: Overall amplitude
(Default value: 0.5)
fund: Fundamental frequency
(Default value: 100)
form: Formant frequency.
(Default value: 500)
oct: Octaviation index, if greater than zero, lowers the effective fund frequency by attenuating odd-numbered sine bursts. whole numbers are full octaves. fractions transpositional.
(Default value: 0)
band: Bandwidth (in -6db) expressed in Hz. The bandwidth determines the rate of exponential decay throughout the sineburst, before the enveloping is applied.
(Default value: 50)
ris: Rise of sinusoid burst (in seconds)
(Default value: 0.003)
dec: Decay of the sinusoid burst (in seconds).
(Default value: 0.0007)
dur: OVerall duration of sinusoid burst (in seconds).
(Default value: 0.02)


out: Signal output.

Example Code

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

typedef struct {
    sp_fof *fof;
    sp_ftbl *sine;
    sp_ftbl *win;
} UserData;

void process(sp_data *sp, void *udata) {
    UserData *ud = udata;
    SPFLOAT osc = 0, fof = 0;
    sp_fof_compute(sp, ud->fof, &osc, &fof);
    sp->out[0] = fof;

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

    sp_ftbl_create(sp, &ud.sine, 2048);
    sp_ftbl_create(sp, &, 1024);

    sp_gen_sine(sp, ud.sine);
    sp_gen_composite(sp,, "0.5 0.5 270 0.5");

    sp_fof_init(sp, ud.fof, ud.sine,, 100, 0);

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


    return 0;