sync marks work

This commit is contained in:
Wolfgang Hottgenroth 2024-03-29 13:29:53 +01:00
parent 1ebf85cb9d
commit d4d494ae7b
3 changed files with 8 additions and 4 deletions

View File

@ -7,7 +7,7 @@ MCU=msp430g2553
CFLAGS=-Wall -mmcu=$(MCU) -std=gnu99 -I $(TOOLCHAIN_PREFIX)/include -O1 -g0
# for debugging
CFLAGS+= -g3 -ggdb -gdwarf-2
#CFLAGS+= -g3 -ggdb -gdwarf-2
LDFLAGS=-mmcu=$(MCU) -L $(TOOLCHAIN_PREFIX)/include

View File

@ -295,6 +295,8 @@ const t_tone tetris1[] = {
{ .octave = e_O_4, .note = e_Gis, .length = e_L_1, .legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Null, .length = e_L_SyncMark,.legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Null, .length = e_L_EndMark, .legato = false, .staccato = false },
};
const t_tone tetris2[] = {
@ -533,6 +535,8 @@ const t_tone tetris2[] = {
{ .octave = e_O_3, .note = e_E, .length = e_L_1, .legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Null, .length = e_L_SyncMark,.legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Null, .length = e_L_EndMark, .legato = false, .staccato = false },
};
const t_tone tetris3[] = {
@ -887,8 +891,9 @@ const t_tone tetris3[] = {
{ .octave = e_O_3, .note = e_E, .length = e_L_1_8, .legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Null, .length = e_L_SyncMark,.legato = false, .staccato = false },
};
{ .octave = e_O_Null, .note = e_Null, .length = e_L_EndMark, .legato = false, .staccato = false },
};
t_melodies tetrisTheme = {
.melodies = { { .amplitude = 3, .tones = tetris1 }, { .amplitude = 3, .tones = tetris2 }, { .amplitude = 3, .tones = tetris3 } },
@ -896,7 +901,6 @@ t_melodies tetrisTheme = {
.pace = 4
};
void melodyInit() {
sequencerPlayMelodies(&tetrisTheme);
}

View File

@ -11,7 +11,7 @@ void sequencerInit() {
void sequencerExec(void *handle) {
t_melodies *melodies = (t_melodies*) handle;
for (uint8_t channel = 0; channel < MAX(NUM_OF_CHANNELS, melodies->numOfMelodies); channel++) {
for (uint8_t channel = 0; channel < melodies->numOfMelodies; channel++) {
t_melody *melody = &(melodies->melodies[channel]);
switch (melody->state) {