osc

Files: osc.h, osc.c

Table-lookup oscilator with linear interpolation

Functions

sp_osc_create(sp_osc **osc)
sp_osc_init(sp_data *sp, sp_osc *osc, sp_ftbl *tbl, SPFLOAT phase)
sp_osc_compute(sp_data *sp, sp_osc *osc, SPFLOAT *dummy, SPFLOAT *out)
sp_osc_destroy(sp_osc **osc)

Mandatory Parameters

tbl: Wavetable to read from. Note: the size of this table must be a power of 2.
(Recommended value: N/A)
phase: Initial phase of waveform, expects a value 0-1
(Recommended value: 0)

Optional Parameters

freq: Frequency (in Hz)
(Default value: 440)
amp: Amplitude (typically a value between 0 and 1).
(Default value: 0.2)

Outputs

out: Signal output.