This commit is contained in:
2024-10-02 22:59:51 +03:00
parent dd6e05951b
commit 0e845d9ebd
3 changed files with 329 additions and 151 deletions

View File

@ -208,6 +208,113 @@ int main(void)
return "UNKNOWN";
}
}
sound_set_bpm(147);
Note_t melody[] = {
sound_create_note(C0, T16, 50),
sound_create_note(C0_sharp, T16, 50),
sound_create_note(D0, T16, 50),
sound_create_note(D0_sharp, T16, 50),
sound_create_note(E0, T16, 50),
sound_create_note(F0, T16, 50),
sound_create_note(F0_sharp, T16, 50),
sound_create_note(G0, T16, 50),
sound_create_note(G0_sharp, T16, 50),
sound_create_note(A0, T16, 50),
sound_create_note(A0_sharp, T16, 50),
sound_create_note(B0, T16, 50),
sound_create_note(C1, T16, 50),
sound_create_note(C1_sharp, T16, 50),
sound_create_note(D1, T16, 50),
sound_create_note(D1_sharp, T16, 50),
sound_create_note(E1, T16, 50),
sound_create_note(F1, T16, 50),
sound_create_note(F1_sharp, T16, 50),
sound_create_note(G1, T16, 50),
sound_create_note(G1_sharp, T16, 50),
sound_create_note(A1, T16, 50),
sound_create_note(A1_sharp, T16, 50),
sound_create_note(B1, T16, 50),
sound_create_note(C2, T16, 50),
sound_create_note(C2_sharp, T16, 50),
sound_create_note(D2, T16, 50),
sound_create_note(D2_sharp, T16, 50),
sound_create_note(E2, T16, 50),
sound_create_note(F2, T16, 50),
sound_create_note(F2_sharp, T16, 50),
sound_create_note(G2, T16, 50),
sound_create_note(G2_sharp, T16, 50),
sound_create_note(A2, T16, 50),
sound_create_note(A2_sharp, T16, 50),
sound_create_note(B2, T16, 50),
sound_create_note(C3, T16, 50),
sound_create_note(C3_sharp, T16, 50),
sound_create_note(D3, T16, 50),
sound_create_note(D3_sharp, T16, 50),
sound_create_note(E3, T16, 50),
sound_create_note(F3, T16, 50),
sound_create_note(F3_sharp, T16, 50),
sound_create_note(G3, T16, 50),
sound_create_note(G3_sharp, T16, 50),
sound_create_note(A3, T16, 50),
sound_create_note(A3_sharp, T16, 50),
sound_create_note(B3, T16, 50),
sound_create_note(C4, T16, 50),
sound_create_note(C4_sharp, T16, 50),
sound_create_note(D4, T16, 50),
sound_create_note(D4_sharp, T16, 50),
sound_create_note(E4, T16, 50),
sound_create_note(F4, T16, 50),
sound_create_note(F4_sharp, T16, 50),
sound_create_note(G4, T16, 50),
sound_create_note(G4_sharp, T16, 50),
sound_create_note(A4, T16, 50),
sound_create_note(A4_sharp, T16, 50),
sound_create_note(B4, T16, 50),
sound_create_note(C5, T16, 50),
sound_create_note(C5_sharp, T16, 50),
sound_create_note(D5, T16, 50),
sound_create_note(D5_sharp, T16, 50),
sound_create_note(E5, T16, 50),
sound_create_note(F5, T16, 50),
sound_create_note(F5_sharp, T16, 50),
sound_create_note(G5, T16, 50),
sound_create_note(G5_sharp, T16, 50),
sound_create_note(A5, T16, 50),
sound_create_note(A5_sharp, T16, 50),
sound_create_note(B5, T16, 50),
sound_create_note(C6, T16, 50),
sound_create_note(C6_sharp, T16, 50),
sound_create_note(D6, T16, 50),
sound_create_note(D6_sharp, T16, 50),
sound_create_note(E6, T16, 50),
sound_create_note(F6, T16, 50),
sound_create_note(F6_sharp, T16, 50),
sound_create_note(G6, T16, 50),
sound_create_note(G6_sharp, T16, 50),
sound_create_note(A6, T16, 50),
sound_create_note(A6_sharp, T16, 50),
sound_create_note(B6, T16, 50),
sound_create_note(C7, T16, 50),
sound_create_note(C7_sharp, T16, 50),
sound_create_note(D7, T16, 50),
sound_create_note(D7_sharp, T16, 50),
sound_create_note(E7, T16, 50),
sound_create_note(F7, T16, 50),
sound_create_note(F7_sharp, T16, 50),
sound_create_note(G7, T16, 50),
sound_create_note(G7_sharp, T16, 50),
sound_create_note(A7, T16, 50),
sound_create_note(A7_sharp, T16, 50),
sound_create_note(B7, T16, 50),
sound_create_note(C8, T16, 50),
sound_create_note(C8_sharp, T16, 50),
sound_create_note(D8, T16, 50)
};
sound_play_melody(melody, sizeof(melody)/sizeof(melody), 3, 1);
while (1) {
IR_CMD_Handler();
@ -240,10 +347,6 @@ int main(void)
CDC_Transmit_FS((uint8_t*)buffer, strlen(buffer));
Note_t note = sound_create_note(NOTE_C4, DURATION_EIGHTH, 50);
sound_play_note(note, SOUND_CHANNEL_1);
}
/* USER CODE END WHILE */