diff options
author | gramanas <anastasis.gramm2@gmail.com> | 2023-11-27 01:03:38 +0200 |
---|---|---|
committer | gramanas <anastasis.gramm2@gmail.com> | 2023-11-27 01:03:38 +0200 |
commit | b0128e30840dff1e7db7bcfd69e6fa4f09ed5fbe (patch) | |
tree | 633be15d0e962db8fd7f2254df7a852f53b85ddc /src/synth_gui.c | |
parent | fb31c071fe835c5ffd1f70d3558acecee2ed7f17 (diff) | |
download | synth-project-b0128e30840dff1e7db7bcfd69e6fa4f09ed5fbe.tar.gz synth-project-b0128e30840dff1e7db7bcfd69e6fa4f09ed5fbe.tar.bz2 synth-project-b0128e30840dff1e7db7bcfd69e6fa4f09ed5fbe.zip |
wavetables
Diffstat (limited to 'src/synth_gui.c')
-rw-r--r-- | src/synth_gui.c | 13 |
1 files changed, 8 insertions, 5 deletions
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); |