From b0128e30840dff1e7db7bcfd69e6fa4f09ed5fbe Mon Sep 17 00:00:00 2001 From: gramanas Date: Mon, 27 Nov 2023 01:03:38 +0200 Subject: wavetables --- src/synth_gui.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/synth_gui.c') diff --git a/src/synth_gui.c b/src/synth_gui.c index bb394c7..dd4c75b 100644 --- a/src/synth_gui.c +++ b/src/synth_gui.c @@ -357,7 +357,8 @@ draw_fft(synth_t *synth, int x, int y, int width, int height) void draw_osc(synth_t * synth, int x, int y, int width, int height) { - DrawRectangleLines(x - 3, y - 3, width + 6, height + 6, GREEN); + DrawRectangle(x, y, width, height, BLACK); + DrawRectangleLines(x, y, width, height, WHITE); float osc_wave[width]; for (int i = 0; i < width; i++) { osc_wave[i] = 0; @@ -371,7 +372,7 @@ draw_osc(synth_t * synth, int x, int y, int width, int height) note_dup.noteOn = note->noteOn; note_dup.noteOff = note->noteOff; note_dup.velocity = note->velocity; - note_dup.wvt_index = synth->geni == 4 ? note->wvt_index : 0; + note_dup.wvt_index = 0; note_dup.lfo_index = note->lfo_index; note_dup.elapsed = note->elapsed; note_dup.noteOffSample = note->noteOffSample; @@ -442,7 +443,7 @@ draw_signals(synth_t * synth, int x, int y, int width, int height) synth->viz.osc_enabled = GuiCheckBox((Rectangle){ x + width - 170, y, 16, 16 }, "osc", synth->viz.osc_enabled); if (synth->viz.osc_enabled) { - draw_osc(synth, x + width - 170 - 40, y + 80, 80, 80); + draw_osc(synth, x + width - 80, y + height - 80, 80, 80); } } @@ -468,9 +469,11 @@ rayrun(synth_t *synth){ // GUI char buf[64]; - + osc_sound(0); snprintf(buf, sizeof buf, "%d", len); - len = GuiSlider((Rectangle){WIDTH / 2 - 108, 150 + 42 + 42, 216, 24 }, "", buf, len , 0, 99); + len = GuiSlider((Rectangle){WIDTH / 2 - 108, 150 + 42 + 42, 216, 24 }, "", buf, len , 0, 157); + set_sound_start(len*2048); + set_sound_len(len*2048 + 2048); draw_bars(synth, 33, 20, 256, 20, 4); draw_text(synth, f, WIDTH / 2 - 108, 20); -- cgit v1.2.3