int main(int argc, char *argv[]) { float hertz = argc > 1 ? atof(argv[1]) : 440.0f; // AVOID_DENORMALS; for (int spd = OSC8K; spd <= OSC192K; spd += 1) oscillator_init(&osc[spd], hertz, 0.0f, speed[spd]); int trun = 60*60; /* one hour */ int tsmp = 60; /* one minute */ for (;;) { for (int spd = OSC8K; spd <= OSC192K; spd += 1) { int nrun = trun * speed[spd]; int nsmp = tsmp * speed[spd]; for (int j = 0; j < nrun-nsmp; j += 1) { float z = oscillator_process(&osc[spd]); } for (int j = 0; j < nsmp; j += 1) { test(spd, oscillator_process(&osc[spd]), hertz, speed[spd]); } res[spd].samples += nrun; summarize(spd); reset(spd); } } return 0; }
int note_init(struct note_t *self_p, int note, int32_t *waveform_p, size_t length, float frequency, float vibrato, long attack, long decay, long release, int sample_rate) { self_p->note = note; oscillator_init(&self_p->oscillator, waveform_p, length, frequency, vibrato, sample_rate); return (envelope_init(&self_p->envelope, attack, decay, release)); }
void osc_z_init(float hertz, float radians, int sample_rate) { oscillator_init(&osc, hertz, radians, sample_rate); }