change pling and way to mute

This commit is contained in:
Wolfgang Hottgenroth 2024-04-26 12:55:21 +02:00
parent 1f807cdb7c
commit 5de2761fde
3 changed files with 13 additions and 35 deletions

View File

@ -9,41 +9,17 @@ const t_tone plingVoice1[] = {
{ .octave = e_O_5, .note = e_Cis, .length = e_L_1_16, .legato = false, .staccato = false }, { .octave = e_O_5, .note = e_Cis, .length = e_L_1_16, .legato = false, .staccato = false },
{ .octave = e_O_5, .note = e_D, .length = e_L_1_16, .legato = false, .staccato = false }, { .octave = e_O_5, .note = e_D, .length = e_L_1_16, .legato = false, .staccato = false },
{ .octave = e_O_5, .note = e_Dis, .length = e_L_1_16, .legato = false, .staccato = false }, { .octave = e_O_5, .note = e_Dis, .length = e_L_1_16, .legato = false, .staccato = false },
{ .octave = e_O_5, .note = e_E, .length = e_L_1_4, .legato = false, .staccato = false }, { .octave = e_O_5, .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_SyncMark,.legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Null, .length = e_L_StopMark,.legato = false, .staccato = false }, { .octave = e_O_Null, .note = e_Null, .length = e_L_StopMark,.legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Null, .length = e_L_EndMark, .legato = false, .staccato = false }, { .octave = e_O_Null, .note = e_Null, .length = e_L_EndMark, .legato = false, .staccato = false },
}; };
const t_tone plingVoice2[] = {
{ .octave = e_O_Null, .note = e_Pause, .length = e_L_1_16, .legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Pause, .length = e_L_1_16, .legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Pause, .length = e_L_1_16, .legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Pause, .length = e_L_1_16, .legato = false, .staccato = false },
{ .octave = e_O_5, .note = e_Gis, .length = e_L_1_4, .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_HoldMark,.legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Null, .length = e_L_EndMark, .legato = false, .staccato = false },
};
const t_tone plingVoice3[] = {
{ .octave = e_O_Null, .note = e_Pause, .length = e_L_1_16, .legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Pause, .length = e_L_1_16, .legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Pause, .length = e_L_1_16, .legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Pause, .length = e_L_1_16, .legato = false, .staccato = false },
{ .octave = e_O_5, .note = e_H, .length = e_L_1_4, .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_HoldMark,.legato = false, .staccato = false },
{ .octave = e_O_Null, .note = e_Null, .length = e_L_EndMark, .legato = false, .staccato = false },
};
t_melodies pling = { t_melodies pling = {
.melodies = { { .amplitude = 12, .tones = plingVoice1 }, { .amplitude = 12, .tones = plingVoice2 }, { .amplitude = 12, .tones = plingVoice3 } }, .melodies = { { .amplitude = 12, .tones = plingVoice1 } },
.numOfMelodies = 3, .numOfMelodies = 1,
.pace = 200, .pace = 200,
.chip = 1 .chip = 1
}; };

View File

@ -8,15 +8,15 @@ void muteInit() {
P1DIR |= BIT6; P1DIR |= BIT6;
// initially, mute // initially, mute
P1OUT |= BIT6;
}
void mute() {
P1OUT |= BIT6;
}
void unMute() {
P1OUT &= ~BIT6; P1OUT &= ~BIT6;
} }
void mute() {
P1OUT &= ~BIT6;
}
void unMute() {
P1OUT |= BIT6;
}

View File

@ -96,9 +96,11 @@ void sequencerExec(void *handle) {
melody->state = e_PlayTone; melody->state = e_PlayTone;
break; break;
case e_Hold: case e_Hold:
psgPlayTone(melodies->chip, channel, 0, e_O_Null, e_Pause);
break; break;
case e_Terminate: case e_Terminate:
schDel(melodies->taskId); schDel(melodies->taskId);
psgPlayTone(melodies->chip, channel, 0, e_O_Null, e_Pause);
slots &= ~(melodies->slotMask); slots &= ~(melodies->slotMask);
break; break;
} }