summaryrefslogtreecommitdiffstats
path: root/src/synth_gui.c
diff options
context:
space:
mode:
authorgrm <grm@eyesin.space>2025-11-27 15:53:51 +0200
committergrm <grm@eyesin.space>2025-11-27 15:53:51 +0200
commit7828597e5f159010c168f9fe366828825fc75205 (patch)
treef03a7ca58230ae162a4bf3a6c9d2763a8c6364e4 /src/synth_gui.c
parenta4acc4cd3a4ef237fb7238894336bbc4af659e07 (diff)
downloadsynth-project-7828597e5f159010c168f9fe366828825fc75205.tar.gz
synth-project-7828597e5f159010c168f9fe366828825fc75205.tar.bz2
synth-project-7828597e5f159010c168f9fe366828825fc75205.zip
chore: remove x value, tidy some code
Diffstat (limited to 'src/synth_gui.c')
-rw-r--r--src/synth_gui.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/synth_gui.c b/src/synth_gui.c
index 77e1876..db37bf7 100644
--- a/src/synth_gui.c
+++ b/src/synth_gui.c
@@ -369,7 +369,7 @@ draw_osc(synth_t * synth, int x, int y, int width, int height)
midi_note_t note_dup = {0};
for (int i = 0; i < width; i++) {
float freq = SAMPLE_RATE/(float)width;
- osc_wave[i] += synth->gen[synth->geni](freq, &note_dup, synth->x, SAMPLE_RATE);
+ osc_wave[i] += synth->gen[synth->geni](freq, &note_dup);
}
for (int i = 0; i < width; i++) {
@@ -645,9 +645,10 @@ draw_signals(synth_t * synth, int x, int y, int width, int height)
DrawRectangleLines(x, y, width, height, WHITE);
if (synth->viz.wave_enabled || synth->viz.spectrum_enabled) {
- synth->viz.rate_divider =
- GuiSlider((Rectangle){x + (width / 2.0) / 2, y - 12, width / 2.0, 12},
- "", NULL, synth->viz.rate_divider, 1, 150);
+ synth->viz.rate_divider = generic_hbar(synth->viz.rate_divider, 15, 1, 150, x + (width / 2.0) / 2, y - 12, width / 2.0, 12);
+ /* synth->viz.rate_divider = */
+ /* GuiSlider((Rectangle){x + (width / 2.0) / 2, y - 12, width / 2.0, 12}, */
+ /* "", NULL, synth->viz.rate_divider, 1, 150); */
synth->viz.y_divider = generic_vbar(synth->viz.y_divider, 1.0, 0.5, 3.0, x - 10, y, 10, height);
/* /\* GuiSlider((Rectangle){x - 10, y, 10, height}, "", NULL, *\/ */
/* /\* synth->viz.y_divider, 0.5, 3); *\/ */
@@ -1254,11 +1255,12 @@ draw_main(synth_t *synth)
draw_osc(synth, WIDTH / 2 + 180, 140, 80, 80);
}
- if ( GuiButton((Rectangle){ WIDTH / 2.0 - 108, 150 - 6 - 6 + 42, 216, 6 }, "")) {
- synth->x = 1;
- }
- snprintf(buf, sizeof buf, "%.1f", synth->x);
- synth->x = GuiSlider((Rectangle){ WIDTH / 2.0 - 108, 150 + 42, 216, 24 }, "x", buf, synth->x , 0.0f, 2.0f);
+ // x variable
+ /* if ( GuiButton((Rectangle){ WIDTH / 2.0 - 108, 150 - 6 - 6 + 42, 216, 6 }, "")) { */
+ /* synth->x = 1; */
+ /* } */
+ /* snprintf(buf, sizeof buf, "%.1f", synth->x); */
+ /* synth->x = GuiSlider((Rectangle){ WIDTH / 2.0 - 108, 150 + 42, 216, 24 }, "x", buf, synth->x , 0.0f, 2.0f); */
synth->filter = GuiToggle((Rectangle){ WIDTH - 100 - 50 - 100 - 50 , 50 , 46, 24 }, "LP", synth->filter);
synth->biquad = GuiToggle((Rectangle){ WIDTH - 100 - 50 - 100 - 50 + 46 + 8 , 50 , 46, 24 }, "bq", synth->biquad);
@@ -1341,8 +1343,6 @@ rayrun(synth_t *synth){
ws_send_message(b);
sprintf(b, "autogain:%d", synth->autogain);
ws_send_message(b);
- sprintf(b, "x:%f", synth->x);
- ws_send_message(b);
sprintf(b, "midi_active_n:%d", synth->midi_active_n);
ws_send_message(b);
sprintf(b, "octave:%d", synth->octave);