Files
SeeSynth/oscillator.h

33 lines
566 B
C

#ifndef OSCILLATOR_H
#define OSCILLATOR_H
#include "utils.h"
typedef enum {
Sine,
Triangle,
Saw,
Square
} OscillatorType;
typedef struct Oscillator {
OscillatorType osc;
float freq;
} 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