Initial commit
This commit is contained in:
commit
91a1e2e312
22 files changed
+885
No files matched your search
@@ -0,0 +1,29 @@
|
||||
#ifndef NOTE_H
|
||||
#define NOTE_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef enum {
|
||||
WAVE_NONE,
|
||||
WAVE_SINE,
|
||||
WAVE_SQUARE,
|
||||
WAVE_SAW,
|
||||
WAVE_TRIANGLE
|
||||
} Waveform;
|
||||
|
||||
typedef struct {
|
||||
float phase;
|
||||
float freq;
|
||||
float gain;
|
||||
float attack_ms;
|
||||
float release_ms;
|
||||
float filter_cutoff;
|
||||
float lp;
|
||||
bool is_playing;
|
||||
Waveform form;
|
||||
} Note;
|
||||
|
||||
void play_note(Note *note, int16_t *buffer, int buffer_size);
|
||||
|
||||
#endif // NOTE_H
|
||||
Reference in new issue
Block a user