export waves to uild folder

This commit is contained in:
2025-08-03 20:42:07 +02:00
parent bc8a2b5b20
commit 63e1daa706
+9 -5
View File
@@ -4,12 +4,10 @@
#include <math.h>
#include "synth_defs.h"
#include "blit.h"
#include "vco.h"
#include "vector_utils.h"
#include "wavetable.h"
//#define WAVE_EXPORT_FILE
#define WAVE_EXPORT_FILE
extern const wt_descr_t _g_wt_descr[WT_NUM_WAVETABLES];
#if 0
@@ -70,7 +68,7 @@ void WT_ModInit(wt_common_t *pCom)
FILE *pFileAll = NULL;
#ifdef WAVE_EXPORT_FILE
pFileAll = fopen("C:\\Users\\jens\\JaySynth\\wave_sweep.pcm", "wb");
pFileAll = fopen("build/wave_sweep.bin", "wb");
#endif
// Create waves from 16-bit raw data
@@ -83,7 +81,13 @@ void WT_ModInit(wt_common_t *pCom)
for (j=0; j < 64; j++)
{
sample = ((INT16)pCom->wave_rawdata[128*i + 2*j + 0] << 8) + pCom->wave_rawdata[128*i + 2*j + 1];
#if 0
if (sample & 0x8000)
{
sample = 0xFFFF - sample + 1;
}
wave[j] = sample;
#endif
}
// Possible assembly 1
@@ -109,7 +113,7 @@ void WT_ModInit(wt_common_t *pCom)
FILE *pFile = NULL;
char filename[128] = {0};
sprintf(filename, "C:\\Users\\jens\\JaySynth\\wave_%03d.pcm", offset+i);
sprintf(filename, "build/wave_%03d.bin", offset+i);
pFile = fopen(filename, "wb");
if (pFile)
{