@@ -199,7 +199,7 @@ void gui_draw(Synth *synth, SDL_Window *window, SDL_GLContext gl_context,
199199
200200 // Oscillators
201201 if (ImGui::CollapsingHeader (" Oscillators" , ImGuiTreeNodeFlags_DefaultOpen)) {
202- ImGui::Columns (2 , " osc_columns" , true );
202+ ImGui::Columns (3 , " osc_columns" , true );
203203 for (int i = 0 ; i < 6 ; ++i) {
204204 ImGui::PushID (i);
205205 char title[32 ];
@@ -270,11 +270,7 @@ void gui_draw(Synth *synth, SDL_Window *window, SDL_GLContext gl_context,
270270
271271 // ADSR Envelope
272272 if (ImGui::CollapsingHeader (" ADSR Envelope" , ImGuiTreeNodeFlags_DefaultOpen)) {
273- ImGui::Columns (2 , " adsr_columns" , true );
274- ImGui::SetColumnWidth (0 , (float )window_width / 3 .0f );
275- ImGui::SetColumnWidth (1 , (float )window_width / 3 .0f );
276-
277- // Left column - Attack and Decay
273+ // Single column layout - Attack, Decay, Sustain, Release stacked vertically
278274 ImGui::Text (" Attack" );
279275 if (ImGui::SliderFloat (" ##adsrattack" , &synth->adsr .attack , 0 .001f , 5 .0f , " %.3f s" , 0 )) {
280276 synth_set_param (synth, " adsr.attack" , synth->adsr .attack );
@@ -285,9 +281,6 @@ void gui_draw(Synth *synth, SDL_Window *window, SDL_GLContext gl_context,
285281 synth_set_param (synth, " adsr.decay" , synth->adsr .decay );
286282 }
287283
288- ImGui::NextColumn ();
289-
290- // Right column - Sustain and Release
291284 ImGui::Text (" Sustain" );
292285 if (ImGui::SliderFloat (" ##adsrsustain" , &synth->adsr .sustain , 0 .0f , 1 .0f , " %.2f" , 0 )) {
293286 synth_set_param (synth, " adsr.sustain" , synth->adsr .sustain );
@@ -298,12 +291,9 @@ void gui_draw(Synth *synth, SDL_Window *window, SDL_GLContext gl_context,
298291 synth_set_param (synth, " adsr.release" , synth->adsr .release );
299292 }
300293
301- ImGui::Columns (1 , " " , false );
302-
303294 // Preset buttons
304295 ImGui::Separator ();
305- ImGui::Text (" Presets:" );
306- ImGui::Columns (8 , " adsr_presets" , true );
296+ ImGui::Columns (7 , " adsr_presets" , true );
307297
308298 if (ImGui::Button (" Pad" )) {
309299 synth_set_param (synth, " adsr.attack" , 1 .5f );
@@ -359,6 +349,63 @@ void gui_draw(Synth *synth, SDL_Window *window, SDL_GLContext gl_context,
359349 synth_set_param (synth, " adsr.sustain" , 0 .8f );
360350 synth_set_param (synth, " adsr.release" , 1 .2f );
361351 }
352+ ImGui::NextColumn ();
353+
354+ // Row 2 - New presets
355+ if (ImGui::Button (" Piano" )) {
356+ synth_set_param (synth, " adsr.attack" , 0 .005f );
357+ synth_set_param (synth, " adsr.decay" , 0 .3f );
358+ synth_set_param (synth, " adsr.sustain" , 0 .4f );
359+ synth_set_param (synth, " adsr.release" , 1 .0f );
360+ }
361+ ImGui::NextColumn ();
362+
363+ if (ImGui::Button (" Organ" )) {
364+ synth_set_param (synth, " adsr.attack" , 0 .01f );
365+ synth_set_param (synth, " adsr.decay" , 0 .1f );
366+ synth_set_param (synth, " adsr.sustain" , 0 .9f );
367+ synth_set_param (synth, " adsr.release" , 0 .3f );
368+ }
369+ ImGui::NextColumn ();
370+
371+ if (ImGui::Button (" Brass" )) {
372+ synth_set_param (synth, " adsr.attack" , 0 .1f );
373+ synth_set_param (synth, " adsr.decay" , 0 .2f );
374+ synth_set_param (synth, " adsr.sustain" , 0 .8f );
375+ synth_set_param (synth, " adsr.release" , 0 .4f );
376+ }
377+ ImGui::NextColumn ();
378+
379+ if (ImGui::Button (" Guitar" )) {
380+ synth_set_param (synth, " adsr.attack" , 0 .002f );
381+ synth_set_param (synth, " adsr.decay" , 0 .4f );
382+ synth_set_param (synth, " adsr.sustain" , 0 .6f );
383+ synth_set_param (synth, " adsr.release" , 0 .8f );
384+ }
385+ ImGui::NextColumn ();
386+
387+ if (ImGui::Button (" Synth" )) {
388+ synth_set_param (synth, " adsr.attack" , 0 .02f );
389+ synth_set_param (synth, " adsr.decay" , 0 .3f );
390+ synth_set_param (synth, " adsr.sustain" , 0 .7f );
391+ synth_set_param (synth, " adsr.release" , 0 .5f );
392+ }
393+ ImGui::NextColumn ();
394+
395+ if (ImGui::Button (" Percussion" )) {
396+ synth_set_param (synth, " adsr.attack" , 0 .001f );
397+ synth_set_param (synth, " adsr.decay" , 0 .02f );
398+ synth_set_param (synth, " adsr.sustain" , 0 .0f );
399+ synth_set_param (synth, " adsr.release" , 0 .05f );
400+ }
401+ ImGui::NextColumn ();
402+
403+ if (ImGui::Button (" Fade In" )) {
404+ synth_set_param (synth, " adsr.attack" , 2 .0f );
405+ synth_set_param (synth, " adsr.decay" , 0 .5f );
406+ synth_set_param (synth, " adsr.sustain" , 0 .8f );
407+ synth_set_param (synth, " adsr.release" , 3 .0f );
408+ }
362409
363410 ImGui::Columns (1 , " " , false );
364411 }
0 commit comments