feat: phase-based oscillators (#12)

Co-authored-by: HiveBeats <e1lama@protonmail.com>
Reviewed-on: #12
This commit is contained in:
2023-08-06 20:17:16 +03:00
parent 2e4dc2c179
commit bcb75a65f9
5 changed files with 150 additions and 72 deletions

View File

@@ -14,6 +14,8 @@ typedef struct Oscillator {
OscillatorType osc;
float freq;
float volume;
float phase;
float phase_dt;
} Oscillator;
typedef struct OscillatorArray {
@@ -23,9 +25,10 @@ typedef struct OscillatorArray {
typedef struct OscillatorGenerationParameter {
OscillatorArray oscillators;
float sample;
} OscillatorGenerationParameter;
void osc_set_freq(Oscillator* osc, float freq);
void osc_reset(Oscillator* osc);
float multiosc(OscillatorGenerationParameter param);
SynthSound freq(float duration, OscillatorArray osc);