From 05a3ff88e1375b97e226dae55945df69273c3061 Mon Sep 17 00:00:00 2001 From: Tom-on64 Date: Fri, 24 Apr 2026 14:07:29 +0200 Subject: [PATCH] Added VCO and state.h --- state.h | 24 ++++++++++++++++++++++++ vco.c | 4 ++++ vco.h | 11 +++++++++++ 3 files changed, 39 insertions(+) create mode 100644 state.h create mode 100644 vco.c create mode 100644 vco.h diff --git a/state.h b/state.h new file mode 100644 index 0000000..0c61d80 --- /dev/null +++ b/state.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include +#include "vco.h" + +typedef struct { + float clock_bpm; + float vco_freq; + vco_mode_t vco_mode; + float vco_volume; + bool quant_enabled; + float filter_freq; + float filter_resonance; + float env1_attack; + float env1_release; + float env2_attack; + float env2_release; + float reverb_amount; + bool amen_enabled; +} state_t; + +extern state_t state; + diff --git a/vco.c b/vco.c new file mode 100644 index 0000000..1235a89 --- /dev/null +++ b/vco.c @@ -0,0 +1,4 @@ +float phase = 0.0f; + +float vco(void); + diff --git a/vco.h b/vco.h new file mode 100644 index 0000000..1670bcc --- /dev/null +++ b/vco.h @@ -0,0 +1,11 @@ +#pragma once + +typedef enum { + VCO_SINE = 0, + VCO_SQUARE = 1, + VCO_TRIANGLE = 2, + VCO_SAW = 3, +} vco_mode_t; + +float vco(void); +