Added VCO and state.h

This commit is contained in:
Tom-on64 2026-04-24 14:07:29 +02:00
parent 2748e58a68
commit 05a3ff88e1
3 changed files with 39 additions and 0 deletions

24
state.h Normal file
View File

@ -0,0 +1,24 @@
#pragma once
#include <stdint.h>
#include <stdbool.h>
#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;

4
vco.c Normal file
View File

@ -0,0 +1,4 @@
float phase = 0.0f;
float vco(void);

11
vco.h Normal file
View File

@ -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);