fix: rename oscillator struct
This commit is contained in:
16
main.c
16
main.c
@@ -72,23 +72,23 @@ SynthSound note(int semitone, float beats) {
|
||||
float hz = get_hz_by_semitone(semitone);
|
||||
float duration = beats * BEAT_DURATION;
|
||||
|
||||
OscillatorParameter first = {
|
||||
Oscillator first = {
|
||||
.osc = Square,
|
||||
.freq = hz
|
||||
};
|
||||
|
||||
OscillatorParameter second = {
|
||||
Oscillator second = {
|
||||
.osc = Saw,
|
||||
.freq = hz + 0.5
|
||||
};
|
||||
|
||||
OscillatorParameter third = {
|
||||
Oscillator third = {
|
||||
.osc = Saw,
|
||||
.freq = hz - 1.f
|
||||
};
|
||||
|
||||
OscillatorParameter oscArray[] = { first/*, second, third */};
|
||||
OscillatorParameterList parameters = {
|
||||
Oscillator oscArray[] = { first/*, second, third */};
|
||||
OscillatorArray parameters = {
|
||||
.array = oscArray,
|
||||
.count = 1
|
||||
};
|
||||
@@ -137,6 +137,12 @@ size_t detect_note_pressed(Note* note) {
|
||||
return is_pressed;
|
||||
}
|
||||
|
||||
typedef struct Synth {
|
||||
OscillatorArray oscillators;
|
||||
Note current_note;
|
||||
SynthSound out_signal;
|
||||
} Synth;
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
// Main
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user