sounds good

This commit is contained in:
2024-03-26 23:13:59 +01:00
parent 2e629f12aa
commit 1c2414463b
5 changed files with 89 additions and 73 deletions

View File

@ -8,11 +8,12 @@
typedef enum {
e_L_EndMark = 0,
e_L_1 = 80,
e_L_1_2 = 40,
e_L_1_4 = 20,
e_L_1_8 = 10,
e_L_1_16 = 5
e_L_1 = 320,
e_L_1_2 = 160,
e_L_1_4 = 80,
e_L_1_8 = 40,
e_L_1_16 = 20,
e_L_1_32 = 10,
} t_noteLength;
typedef struct {
@ -20,11 +21,14 @@ typedef struct {
t_note note;
t_noteLength length;
bool legato;
bool staccato;
} t_tone;
typedef enum {
e_PlayTone,
e_HoldTone,
e_StaccatoBreak,
e_HoldStaccatoBreak,
e_SeparateTone
} t_sequencerState;
@ -32,12 +36,14 @@ typedef struct {
uint16_t idx;
uint8_t lengthCnt;
t_sequencerState state;
uint8_t pace;
uint8_t amplitude;
uint8_t channel;
const t_tone *tones;
} t_melody;
void sequencerInit();
uint8_t sequencerPlayMelody(t_melody *melody);
uint16_t sequencerPlayMelody(t_melody *melody);
#endif // _SEQUENCER_H_