EIE4-FYP/demo/note

113 lines
2 KiB
Plaintext
Raw Permalink Normal View History

#include <stdint.h>
#pragma once
// Function Definition
#ifdef CSR_AUDIO_BASE
void note(uint32_t frequency, unsigned int duration_ms);
void wave(uint32_t wave);
#endif
// Notes
#define NOTE_NONE 0
2023-06-04 12:11:45 +00:00
#define NOTE_C1 33
#define NOTE_C1S 35
#define NOTE_D1 37
#define NOTE_D1S 39
#define NOTE_E1 41
#define NOTE_F1 44
#define NOTE_F1S 46
#define NOTE_G1 49
#define NOTE_G1S 52
#define NOTE_A1 55
#define NOTE_A1S 58
#define NOTE_B1 62
#define NOTE_C2 65
#define NOTE_C2S 69
#define NOTE_D2 73
#define NOTE_D2S 78
#define NOTE_E2 82
#define NOTE_F2 87
#define NOTE_F2S 93
#define NOTE_G2 98
#define NOTE_G2S 104
#define NOTE_A2 110
#define NOTE_A2S 117
#define NOTE_B2 123
#define NOTE_C3 131
#define NOTE_C3S 139
#define NOTE_D3 147
#define NOTE_D3S 156
#define NOTE_E3 165
#define NOTE_F3 175
#define NOTE_F3S 185
#define NOTE_G3 196
#define NOTE_G3S 208
#define NOTE_A3 220
#define NOTE_A3S 233
#define NOTE_B3 247
#define NOTE_C4 262
#define NOTE_C4S 277
#define NOTE_D4 294
#define NOTE_D4S 311
#define NOTE_E4 330
#define NOTE_F4 349
#define NOTE_F4S 370
#define NOTE_G4 392
#define NOTE_G4S 415
#define NOTE_A4 440
#define NOTE_A4S 466
#define NOTE_B4 494
#define NOTE_C5 523
#define NOTE_C5S 554
#define NOTE_D5 587
#define NOTE_D5S 622
#define NOTE_E5 659
#define NOTE_F5 698
#define NOTE_F5S 740
#define NOTE_G5 784
#define NOTE_G5S 831
#define NOTE_A5 880
#define NOTE_A5S 932
#define NOTE_B5 988
#define NOTE_C6 1047
#define NOTE_C6S 1109
#define NOTE_D6 1175
#define NOTE_D6S 1245
#define NOTE_E6 1319
#define NOTE_F6 1397
#define NOTE_F6S 1480
#define NOTE_G6 1568
#define NOTE_G6S 1661
#define NOTE_A6 1760
#define NOTE_A6S 1865
#define NOTE_B6 1976
#define NOTE_C7 2093
2023-06-04 12:11:45 +00:00
#define NOTE_C7S 2217
#define NOTE_D7 2349
#define NOTE_D7S 2489
#define NOTE_E7 2637
#define NOTE_F7 2794
#define NOTE_F7S 2960
#define NOTE_G7 3136
#define NOTE_G7S 3322
#define NOTE_A7 3520
#define NOTE_A7S 3729
#define NOTE_B7 3951
// Waves
#define WAVE_SAW 0
#define WAVE_SQUARE 1
#define WAVE_TRIANGLE 2
#define WAVE_SINE 3