Skip to content

Commit 0f0d680

Browse files
committed
misc
1 parent 59d16cd commit 0f0d680

File tree

2 files changed

+160
-0
lines changed

2 files changed

+160
-0
lines changed

src/gui.cpp

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,162 @@ void gui_draw(Synth *synth, SDL_Window *window, SDL_GLContext gl_context) {
572572
ImGui::SliderInt("Octaves", &synth->arp.octaves, 1, 6, "%d");
573573
ImGui::Checkbox("Polyphonic", (bool*)&synth->arp.polyphonic);
574574
ImGui::Checkbox("Hold", (bool*)&synth->arp.hold);
575+
576+
ImGui::Separator();
577+
ImGui::Text("Presets:");
578+
ImGui::Columns(4, "arp_presets", true);
579+
580+
if (ImGui::Button("Classic Up")) {
581+
synth->arp.mode = ARP_UP;
582+
synth->arp.tempo = 120.0f;
583+
synth->arp.octaves = 2;
584+
synth->arp.polyphonic = 0;
585+
synth->arp.hold = 0;
586+
}
587+
ImGui::SameLine(); ImGui::Text("8th notes");
588+
589+
if (ImGui::Button("Classic Down")) {
590+
synth->arp.mode = ARP_DOWN;
591+
synth->arp.tempo = 120.0f;
592+
synth->arp.octaves = 2;
593+
synth->arp.polyphonic = 0;
594+
synth->arp.hold = 0;
595+
}
596+
ImGui::SameLine(); ImGui::Text("Descending");
597+
598+
if (ImGui::Button("Synth Pop")) {
599+
synth->arp.mode = ARP_UP;
600+
synth->arp.tempo = 130.0f;
601+
synth->arp.octaves = 3;
602+
synth->arp.polyphonic = 1;
603+
synth->arp.hold = 1;
604+
}
605+
ImGui::SameLine(); ImGui::Text("Pop style");
606+
607+
if (ImGui::Button("Bass Line")) {
608+
synth->arp.mode = ARP_ORDER;
609+
synth->arp.tempo = 128.0f;
610+
synth->arp.octaves = 1;
611+
synth->arp.polyphonic = 0;
612+
synth->arp.hold = 0;
613+
}
614+
ImGui::SameLine(); ImGui::Text("Sequential");
615+
616+
ImGui::NextColumn();
617+
618+
if (ImGui::Button("Trance Gate")) {
619+
synth->arp.mode = ARP_UP;
620+
synth->arp.tempo = 140.0f;
621+
synth->arp.octaves = 4;
622+
synth->arp.polyphonic = 1;
623+
synth->arp.hold = 1;
624+
}
625+
ImGui::SameLine(); ImGui::Text("16th notes");
626+
627+
if (ImGui::Button("Random Chaos")) {
628+
synth->arp.mode = ARP_RANDOM;
629+
synth->arp.tempo = 100.0f;
630+
synth->arp.octaves = 3;
631+
synth->arp.polyphonic = 0;
632+
synth->arp.hold = 0;
633+
}
634+
ImGui::SameLine(); ImGui::Text("Unpredictable");
635+
636+
if (ImGui::Button("House Chord")) {
637+
synth->arp.mode = ARP_ORDER;
638+
synth->arp.tempo = 124.0f;
639+
synth->arp.octaves = 2;
640+
synth->arp.polyphonic = 1;
641+
synth->arp.hold = 1;
642+
}
643+
ImGui::SameLine(); ImGui::Text("Progressive");
644+
645+
if (ImGui::Button("Ambient Pad")) {
646+
synth->arp.mode = ARP_UP;
647+
synth->arp.tempo = 60.0f;
648+
synth->arp.octaves = 3;
649+
synth->arp.polyphonic = 1;
650+
synth->arp.hold = 1;
651+
}
652+
ImGui::SameLine(); ImGui::Text("Slow & wide");
653+
654+
ImGui::NextColumn();
655+
656+
if (ImGui::Button("Techno Pulse")) {
657+
synth->arp.mode = ARP_DOWN;
658+
synth->arp.tempo = 135.0f;
659+
synth->arp.octaves = 2;
660+
synth->arp.polyphonic = 0;
661+
synth->arp.hold = 0;
662+
}
663+
ImGui::SameLine(); ImGui::Text("Driving");
664+
665+
if (ImGui::Button("Dub Sequence")) {
666+
synth->arp.mode = ARP_UP;
667+
synth->arp.tempo = 70.0f;
668+
synth->arp.octaves = 1;
669+
synth->arp.polyphonic = 0;
670+
synth->arp.hold = 0;
671+
}
672+
ImGui::SameLine(); ImGui::Text("Reggae");
673+
674+
if (ImGui::Button("DnB Roll")) {
675+
synth->arp.mode = ARP_RANDOM;
676+
synth->arp.tempo = 174.0f;
677+
synth->arp.octaves = 2;
678+
synth->arp.polyphonic = 1;
679+
synth->arp.hold = 0;
680+
}
681+
ImGui::SameLine(); ImGui::Text("Fast");
682+
683+
if (ImGui::Button("Video Game")) {
684+
synth->arp.mode = ARP_UP;
685+
synth->arp.tempo = 110.0f;
686+
synth->arp.octaves = 2;
687+
synth->arp.polyphonic = 0;
688+
synth->arp.hold = 0;
689+
}
690+
ImGui::SameLine(); ImGui::Text("8-bit");
691+
692+
ImGui::NextColumn();
693+
694+
if (ImGui::Button("Arpeggiator")) {
695+
synth->arp.mode = ARP_UP;
696+
synth->arp.tempo = 92.0f;
697+
synth->arp.octaves = 4;
698+
synth->arp.polyphonic = 0;
699+
synth->arp.hold = 0;
700+
}
701+
ImGui::SameLine(); ImGui::Text("Classic");
702+
703+
if (ImGui::Button("Dream Pop")) {
704+
synth->arp.mode = ARP_ORDER;
705+
synth->arp.tempo = 80.0f;
706+
synth->arp.octaves = 3;
707+
synth->arp.polyphonic = 1;
708+
synth->arp.hold = 1;
709+
}
710+
ImGui::SameLine(); ImGui::Text("Ethereal");
711+
712+
if (ImGui::Button("Industrial")) {
713+
synth->arp.mode = ARP_RANDOM;
714+
synth->arp.tempo = 160.0f;
715+
synth->arp.octaves = 2;
716+
synth->arp.polyphonic = 0;
717+
synth->arp.hold = 0;
718+
}
719+
ImGui::SameLine(); ImGui::Text("Harsh");
720+
721+
if (ImGui::Button("Jazz Walker")) {
722+
synth->arp.mode = ARP_ORDER;
723+
synth->arp.tempo = 140.0f;
724+
synth->arp.octaves = 2;
725+
synth->arp.polyphonic = 1;
726+
synth->arp.hold = 0;
727+
}
728+
ImGui::SameLine(); ImGui::Text("Walking");
729+
730+
ImGui::Columns(1, "", false);
575731
}
576732

577733
// Oscilloscope

src/ring_modulator.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#include "ring_modulator.h"
22
#include <math.h>
33

4+
#ifndef M_PI
5+
#define M_PI 3.14159265358979323846
6+
#endif
7+
48
void ring_mod_init(RingModulator *rm, float sample_rate) {
59
rm->frequency = 100.0f; // 100 Hz default
610
rm->mix = 0.0f; // Dry by default

0 commit comments

Comments
 (0)