fix: refactor code structure into files (#8)

closes #7

Co-authored-by: HiveBeats <e1lama@protonmail.com>
Reviewed-on: #8
This commit is contained in:
2023-06-18 14:46:20 +03:00
parent 97c743100a
commit 7eb6a1755d
12 changed files with 473 additions and 456 deletions

33
oscillator.h Normal file
View File

@@ -0,0 +1,33 @@
#ifndef OSCILLATOR_H
#define OSCILLATOR_H
#include "utils.h"
typedef enum {
Sine,
Triangle,
Saw,
Square
} OscillatorType;
typedef struct OscillatorParameter {
OscillatorType osc;
float freq;
} OscillatorParameter;
typedef struct OscillatorParameterList {
OscillatorParameter* array;
size_t count;
} OscillatorParameterList;
typedef struct OscillatorGenerationParameter {
OscillatorParameterList oscillators;
float sample;
} OscillatorGenerationParameter;
float multiosc(OscillatorGenerationParameter param);
SynthSound freq(float duration, OscillatorParameterList osc);
#endif