sequencer states

This commit is contained in:
2024-03-26 22:12:46 +01:00
parent 9989a52c38
commit 2e629f12aa
5 changed files with 57 additions and 121 deletions

View File

@ -6,29 +6,30 @@
const t_tone notes[] = {
{ .octave = e_O_3, .note = e_G, .length = e_L_1_4, .legato = false },
{ .octave = e_O_3, .note = e_D, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Dis, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Es, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_F, .length = e_L_1_4, .legato = false },
{ .octave = e_O_3, .note = e_Dis, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Es, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_D, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_C, .length = e_L_1_4, .legato = false },
{ .octave = e_O_3, .note = e_C, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Dis, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Es, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_G, .length = e_L_1_4, .legato = false },
{ .octave = e_O_3, .note = e_F, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Dis, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Es, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_D, .length = e_L_1_4, .legato = true },
{ .octave = e_O_3, .note = e_D, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Dis, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Es, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_F, .length = e_L_1_4, .legato = false },
{ .octave = e_O_3, .note = e_G, .length = e_L_1_4, .legato = false },
{ .octave = e_O_3, .note = e_Dis, .length = e_L_1_8, .legato = true },
{ .octave = e_O_3, .note = e_Dis, .length = e_L_1_16, .legato = false },
// Staccato
{ .octave = e_O_3, .note = e_Es, .length = e_L_1_8, .legato = true },
{ .octave = e_O_3, .note = e_Es, .length = e_L_1_16, .legato = false },
{ .octave = e_O_Null, .note = e_Pause, .length = e_L_1_16, .legato = false },
{ .octave = e_O_3, .note = e_C, .length = e_L_1_8, .legato = true },
{ .octave = e_O_3, .note = e_C, .length = e_L_1_16, .legato = false },
@ -41,29 +42,30 @@ const t_tone notes[] = {
{ .octave = e_O_Null, .note = e_Pause, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_F, .length = e_L_1_8, .legato = true },
{ .octave = e_O_3, .note = e_F, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Gis, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_As, .length = e_L_1_8, .legato = false },
{ .octave = e_O_4, .note = e_C, .length = e_L_1_4, .legato = false },
{ .octave = e_O_3, .note = e_Ais, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Gis, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_B, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_As, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_G, .length = e_L_1_4, .legato = true },
{ .octave = e_O_3, .note = e_G, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Dis, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Es, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_G, .length = e_L_1_4, .legato = false },
{ .octave = e_O_3, .note = e_F, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Dis, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Es, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_D, .length = e_L_1_4, .legato = false },
{ .octave = e_O_3, .note = e_D, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Dis, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_Es, .length = e_L_1_8, .legato = false },
{ .octave = e_O_3, .note = e_F, .length = e_L_1_4, .legato = false },
{ .octave = e_O_3, .note = e_G, .length = e_L_1_4, .legato = false },
{ .octave = e_O_3, .note = e_Dis, .length = e_L_1_8, .legato = true },
{ .octave = e_O_3, .note = e_Dis, .length = e_L_1_16, .legato = false },
// Staccato
{ .octave = e_O_3, .note = e_Es, .length = e_L_1_8, .legato = true },
{ .octave = e_O_3, .note = e_Es, .length = e_L_1_16, .legato = false },
{ .octave = e_O_Null, .note = e_Pause, .length = e_L_1_16, .legato = false },
{ .octave = e_O_3, .note = e_C, .length = e_L_1_8, .legato = true },
{ .octave = e_O_3, .note = e_C, .length = e_L_1_16, .legato = false },
@ -75,36 +77,15 @@ const t_tone notes[] = {
{ .octave = e_O_Null, .note = e_Null, .length = e_L_EndMark, .legato = false },
};
/*
const t_tone ladder[16] = {
{ .octave = e_O_3, .note = e_C, .length = e_L_1_4 },
{ .octave = e_O_3, .note = e_D, .length = e_L_1_4 },
{ .octave = e_O_3, .note = e_E, .length = e_L_1_4 },
{ .octave = e_O_3, .note = e_F, .length = e_L_1_4 },
{ .octave = e_O_3, .note = e_G, .length = e_L_1_4 },
{ .octave = e_O_3, .note = e_A, .length = e_L_1_4 },
{ .octave = e_O_3, .note = e_H, .length = e_L_1_4 },
{ .octave = e_O_4, .note = e_C, .length = e_L_1_4 },
{ .octave = e_O_3, .note = e_H, .length = e_L_1_4 },
{ .octave = e_O_3, .note = e_A, .length = e_L_1_4 },
{ .octave = e_O_3, .note = e_G, .length = e_L_1_4 },
{ .octave = e_O_3, .note = e_F, .length = e_L_1_4 },
{ .octave = e_O_3, .note = e_E, .length = e_L_1_4 },
{ .octave = e_O_3, .note = e_D, .length = e_L_1_4 },
{ .octave = e_O_3, .note = e_H, .length = e_L_EndMark },
};
*/
t_melody melody= {
.idx = 0,
.lengthCnt = 0,
.channel = 0,
.tones = notes
};
void melodyInit() {
psgWrite(07, 0b11111110);
psgWrite(010, 03);
psgAmplitude(melody.channel, 3);
sequencerPlayMelody(&melody);
}