From 6f70cf0a3da290ccf0638c895b4f3282022fe4a4 Mon Sep 17 00:00:00 2001 From: Tom-on64 Date: Fri, 24 Apr 2026 14:52:45 +0200 Subject: [PATCH] Insane changes --- CMakeLists.txt | 3 ++- sint-gauntlet.c => main.cc | 4 ++++ mux.c | 4 ++-- vco.c | 13 ++++++++++++- 4 files changed, 20 insertions(+), 4 deletions(-) rename sint-gauntlet.c => main.cc (93%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f558791..b49f234 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ pico_sdk_init() # Add executable. Default name is the project name, version 0.1 -add_executable(sint-gauntlet sint-gauntlet.c vco.c ) +add_executable(sint-gauntlet main.cc vco.c mux.c) pico_set_program_name(sint-gauntlet "sint-gauntlet") pico_set_program_version(sint-gauntlet "0.1") @@ -39,6 +39,7 @@ target_link_libraries(sint-gauntlet # Add the standard include files to the build target_include_directories(sint-gauntlet PRIVATE + ${CMAKE_CURRENT_LIST_DIR}/daisysp ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_CURRENT_LIST_DIR}/.. # for our common lwipopts or any other standard includes, if required ) diff --git a/sint-gauntlet.c b/main.cc similarity index 93% rename from sint-gauntlet.c rename to main.cc index 282d8d2..7fe5780 100644 --- a/sint-gauntlet.c +++ b/main.cc @@ -9,6 +9,10 @@ #include "hardware/pwm.h" #include "hardware/adc.h" #include "state.h" +#include "daisysp.h" + +daisysp::Oscillator osc; +daisysp::Svf filter; state_t state; diff --git a/mux.c b/mux.c index 8ffd16d..d0f9d6f 100644 --- a/mux.c +++ b/mux.c @@ -9,11 +9,11 @@ void set_mux_addr(uint8_t addr) { } float read_value_from_mux() { - return ; + return 0.0f; } void update_inputs() { for(uint8_t i = 0; i < 2; i++) { } -} \ No newline at end of file +} diff --git a/vco.c b/vco.c index 1235a89..17ccf0f 100644 --- a/vco.c +++ b/vco.c @@ -1,4 +1,15 @@ +#include "const.h" +#include "state.h" + +#include "vco.h" + float phase = 0.0f; +float vco(void) { + float phase_inc = (state.vco_freq * 1760) / SAMPLE_RATE; + phase += phase_inc; -float vco(void); + if (phase >= 1.0f) phase -= 1.0f; + + return (phase * 2.0f) - 1.0f; +}