void growl_init(sp_data *sp, growl_d *form) { int i; for(i = 0; i < 4; i++) { sp_reson_init(sp, form->filt[i]); form->filt[i]->freq = formants[i]; form->filt[i]->bw = (formants[i] * 0.02) + 50; } sp_bal_init(sp, form->bal); sp_dcblock_init(sp, form->dcblk); form->x = 0; form->y = 0; }
int main() { udata ud; sp_data *sp; sp_create(&sp); sp_srand(sp, 12345); sp_noise_create(&ud.ns); sp_reson_create(&ud.reson); sp_noise_init(sp, ud.ns); ud.ns->amp = 1.0; sp_reson_init(sp, ud.reson); sp->len = 44100 * 5; sp_process(sp, &ud, write_noise); sp_noise_destroy(&ud.ns); sp_reson_destroy(&ud.reson); sp_destroy(&sp); return 0; }