- improved wave export
git-svn-id: http://moon:8086/svn/software/trunk/projects/JaySynth@274 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -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,7 +115,20 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user