#include "osc.h" #include osc_t OSC_sound = { .name = "w_sound", .data = 0, .len = 0, .start = 0, .end = 0, .type = WAVE, }; OSC_COMMON(sound) int wvt_size = 2048; float osc_sound(float offset) { if (!OSC_sound.len) { // osc_load_wav(&OSC_sound, "/home/gramanas/code/synth-project/waves/test_lick.wav"); //osc_load_wav(&OSC_sound, "/home/gramanas/code/synth-project/waves/Free Wavetables[128]/FM Synthesis[128-44.1khz-16bit]/FM Sq- NotPM.wav"); //osc_load_wav(&OSC_sound, "/home/gramanas/code/synth-project/waves/Free Wavetables[2048]/Melda Oscillator[2048-44.1khz-32bit]/Melda SKEW.wav"); //osc_load_wav(&OSC_sound, "/home/gramanas/code/synth-project/waves/Free Wavetables[2048]/Filter Sweep[2048-44.1khz-32bit]/SweepSaw.wav"); //osc_load_wav(&OSC_sound, "/home/gramanas/code/synth-project/waves/Free Wavetables[2048]/Additive Synth[2048-44.1khz-32bit]/Add Synth7.wav"); //osc_load_wav(&OSC_sound, "/home/gramanas/code/synth-project/waves/Free Wavetables[2048]/Korg Analog Synth PhaseShift[2048-44.1khz-32bit]/MS 20 Saw MPS.wav"); osc_load_wav(&OSC_sound, "/home/gramanas/code/synth-project/waves/Free Wavetables[2048]/Korg Analog Synth PhaseShift[2048-44.1khz-32bit]/MonoPoly Saw PS1.wav"); OSC_sound.start = wvt_size*0; OSC_sound.len = OSC_sound.start + wvt_size; } return osc_interpolate(offset, OSC_sound.data[(int)offset], OSC_sound.data[osc_next_index(&OSC_sound, offset)]); } float osc_sound_next(float f, float offset) { return osc_next_offset(&OSC_sound, f, offset); }