From 63e1daa70684890d7d0a89732ba35d5b0e6cf337 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sun, 3 Aug 2025 20:42:07 +0200 Subject: [PATCH] export waves to uild folder --- src/synth/wavetable.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/synth/wavetable.c b/src/synth/wavetable.c index 6cb438e..96931d5 100644 --- a/src/synth/wavetable.c +++ b/src/synth/wavetable.c @@ -4,12 +4,10 @@ #include #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) {