From 704365b4449c33b10d874440c4fd19981b4bc803 Mon Sep 17 00:00:00 2001 From: TiagoLr Date: Wed, 13 Dec 2023 18:57:25 +0000 Subject: [PATCH 1/2] Release JSWavesynth v1.1.1 Fix read initial wave file --- Synth/tilr_JSWavesynth.jsfx | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Synth/tilr_JSWavesynth.jsfx b/Synth/tilr_JSWavesynth.jsfx index 1e242fc..2829cef 100644 --- a/Synth/tilr_JSWavesynth.jsfx +++ b/Synth/tilr_JSWavesynth.jsfx @@ -1,6 +1,7 @@ desc: JSWavesynth author: tilr -version: 1.1 +version: 1.1.1 +changelog: Fix read initial wave file provides: tilr_JSWavesynth/ws.adsr.jsfx-inc tilr_JSWavesynth/ws.array.jsfx-inc @@ -48,7 +49,7 @@ about: desc: JSWavesynth tags: synth, instrument -slider1:/tilr_JSWavesynth:Sine.wav:Wave +slider1:/tilr_JSWavesynth:none:Wave slider2:vol=80<0, 100, .01>-Volume slider4:_uni_voices=1<1, 8, 1>-Unison voices slider5:uni_detune=15<0, 100, 0.1>-Unison detune @@ -129,8 +130,7 @@ function stereo_to_mono_wave(buf, len) ( ); ); -function on_file_change () ( - filehandle=file_open(slider1); +function read_file(filehandle) ( filehandle > 0 ? ( file_riff(filehandle, wavechn, wavesrate); wavechn ? ( @@ -149,6 +149,17 @@ function on_file_change () ( ); ); +function on_file_change() ( + lfile = slider1; + filehandle=file_open(slider1); + read_file(filehandle); +); + +function read_file_string(str) ( + filehandle=file_open(str); + read_file(filehandle); +); + // copy filter coeficients from buffer1 to buffer2 function filter_copy_coefs(buf1, buf2) ( buf2[2] = buf1[2]; @@ -216,6 +227,9 @@ function on_slider() ( detune_amt = uni_detune / 100 * 3 / srate; // 3 hz max detune ); +// FIX - read initial wave from string instead of slider +read_file_string("tilr_JSWavesynth/Sine 1.wav"); + @slider on_slider(); From 17adc6bf6e29a14ffba0441ab1e37c4788e63b8c Mon Sep 17 00:00:00 2001 From: TiagoLr Date: Wed, 13 Dec 2023 19:36:22 +0000 Subject: [PATCH 2/2] Update tilr_JSWavesynth.jsfx --- Synth/tilr_JSWavesynth.jsfx | 1 + 1 file changed, 1 insertion(+) diff --git a/Synth/tilr_JSWavesynth.jsfx b/Synth/tilr_JSWavesynth.jsfx index 2829cef..2c959a1 100644 --- a/Synth/tilr_JSWavesynth.jsfx +++ b/Synth/tilr_JSWavesynth.jsfx @@ -86,6 +86,7 @@ import ws.mouselib.jsfx-inc options:gfx_hz=60 no_meter @init +ext_noinit = 1; lfile = -1; wavebuf = 100000; wavechn = 0;