Files
SeeSynth/oscillator.h
e1lama aaec53cfea feat: Oscillator GUI (#9)
Waveshape and volume implemented. Added Signal drawing

Todo: explore possibility to separate ui and applying state changes

Co-authored-by: HiveBeats <e1lama@protonmail.com>
Reviewed-on: #9
2023-06-18 19:14:30 +03:00

34 lines
642 B
C

#ifndef OSCILLATOR_H
#define OSCILLATOR_H
#include "utils.h"
#define WAVE_SHAPE_OPTIONS "Sine;Triangle;Sawtooth;Square"
typedef enum {
Sine,
Triangle,
Saw,
Square
} OscillatorType;
typedef struct Oscillator {
OscillatorType osc;
float freq;
float volume;
} Oscillator;
typedef struct OscillatorArray {
Oscillator* array;
size_t count;
} OscillatorArray;
typedef struct OscillatorGenerationParameter {
OscillatorArray oscillators;
float sample;
} OscillatorGenerationParameter;
float multiosc(OscillatorGenerationParameter param);
SynthSound freq(float duration, OscillatorArray osc);
#endif