diff --git a/Source/synth/wavetable.c b/Source/synth/wavetable.c index 47cbfb9..b11a97a 100644 --- a/Source/synth/wavetable.c +++ b/Source/synth/wavetable.c @@ -9,6 +9,8 @@ #include "vector_utils.h" #include "wavetable.h" +//#define WAVE_EXPORT_FILE + const wt_descr_t _g_wt_descr[WT_NUM_WAVETABLES] = { {8, 0, 101, 8, 69, 16, 70, 24, 71, 32, 72, 40, 73, 48, 74, 60, 75}, @@ -62,6 +64,12 @@ void WT_ModInit(wt_common_t *pCom) synth_float_t kmix; synth_float_t x, dx, wave_tri[WT_WAVE_SIZE], wave_sqr[WT_WAVE_SIZE], wave_saw[WT_WAVE_SIZE]; + FILE *pFileAll = NULL; + +#ifdef WAVE_EXPORT_FILE + pFileAll = fopen("C:\\Users\\jens\\JaySynth\\wave_sweep.pcm", "wb"); +#endif + // Create waves from 16-bit raw data offset = 0; for (i=0; i < 300; i++) @@ -93,8 +101,7 @@ void WT_ModInit(wt_common_t *pCom) pCom->waves[offset+i][j] = (synth_float_t)wave[j]/8192; } -#if 0 -//#ifdef SYNTH_DEBUG +#ifdef WAVE_EXPORT_FILE { FILE *pFile = NULL; char filename[128] = {0}; @@ -108,8 +115,21 @@ void WT_ModInit(wt_common_t *pCom) } } #endif + + if (pFileAll) + { + int i; + + for (i=0; i < 20; i++) + { + fwrite(wave, 2, WT_WAVE_SIZE, pFileAll); + } + } } + if (pFileAll) + fclose(pFileAll); + // Create classic waveforms // Saw x = 1;