Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release JSWavesynth v1.1.1 #349

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions Synth/tilr_JSWavesynth.jsfx
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -85,6 +86,7 @@ import ws.mouselib.jsfx-inc
options:gfx_hz=60 no_meter

@init
ext_noinit = 1;
lfile = -1;
wavebuf = 100000;
wavechn = 0;
Expand Down Expand Up @@ -129,8 +131,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 ? (
Expand All @@ -149,6 +150,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];
Expand Down Expand Up @@ -216,6 +228,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();
Expand Down
Loading