plays a fucking annoying sound for 10 seconds and loops.

Dependencies:   mbed

Fork of song_demo_PWM by jim hamblen

Committer:
mganseij
Date:
Thu Oct 29 10:34:57 2015 +0000
Revision:
7:29dd200668db
Parent:
6:ce3c3d9c96e9
newest version thingy

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mganseij 3:89b8dea1cf17 1 #define rest 0.0
mganseij 2:2cca82c058fc 2 #define NOTE_B0 31.0
mganseij 2:2cca82c058fc 3 #define NOTE_C1 33.0
mganseij 2:2cca82c058fc 4 #define NOTE_CS1 35.0
mganseij 2:2cca82c058fc 5 #define NOTE_D1 37.0
mganseij 2:2cca82c058fc 6 #define NOTE_DS1 39.0
mganseij 2:2cca82c058fc 7 #define NOTE_E1 41.0
mganseij 2:2cca82c058fc 8 #define NOTE_F1 44.0
mganseij 2:2cca82c058fc 9 #define NOTE_FS1 46.0
mganseij 2:2cca82c058fc 10 #define NOTE_G1 49.0
mganseij 2:2cca82c058fc 11 #define NOTE_GS1 52.0
mganseij 2:2cca82c058fc 12 #define NOTE_A1 55.0
mganseij 2:2cca82c058fc 13 #define NOTE_AS1 58.0
mganseij 2:2cca82c058fc 14 #define NOTE_B1 62.0
mganseij 2:2cca82c058fc 15 #define NOTE_C2 65.0
mganseij 2:2cca82c058fc 16 #define NOTE_CS2 69.0
mganseij 2:2cca82c058fc 17 #define NOTE_D2 73.0
mganseij 2:2cca82c058fc 18 #define NOTE_DS2 78.0
mganseij 2:2cca82c058fc 19 #define NOTE_E2 82.0
mganseij 2:2cca82c058fc 20 #define NOTE_F2 87.0
mganseij 2:2cca82c058fc 21 #define NOTE_FS2 93.0
mganseij 2:2cca82c058fc 22 #define NOTE_G2 98.0
mganseij 2:2cca82c058fc 23 #define NOTE_GS2 104.0
mganseij 2:2cca82c058fc 24 #define NOTE_A2 110.0
mganseij 2:2cca82c058fc 25 #define NOTE_AS2 117.0
mganseij 2:2cca82c058fc 26 #define NOTE_B2 123.0
mganseij 2:2cca82c058fc 27 #define NOTE_C3 131.0
mganseij 2:2cca82c058fc 28 #define NOTE_CS3 139.0
mganseij 2:2cca82c058fc 29 #define NOTE_D3 147.0
mganseij 2:2cca82c058fc 30 #define NOTE_DS3 156.0
mganseij 2:2cca82c058fc 31 #define NOTE_E3 165.0
mganseij 2:2cca82c058fc 32 #define NOTE_F3 175.0
mganseij 2:2cca82c058fc 33 #define NOTE_FS3 185.0
mganseij 2:2cca82c058fc 34 #define NOTE_G3 196.0
mganseij 2:2cca82c058fc 35 #define NOTE_GS3 208.0
mganseij 2:2cca82c058fc 36 #define NOTE_A3 220.0
mganseij 2:2cca82c058fc 37 #define NOTE_AS3 233.0
mganseij 2:2cca82c058fc 38 #define NOTE_B3 247.0
mganseij 2:2cca82c058fc 39 #define NOTE_C4 262.0
mganseij 2:2cca82c058fc 40 #define NOTE_CS4 277.0
mganseij 2:2cca82c058fc 41 #define NOTE_D4 294.0
mganseij 2:2cca82c058fc 42 #define NOTE_DS4 311.0
mganseij 2:2cca82c058fc 43 #define NOTE_E4 330.0
mganseij 2:2cca82c058fc 44 #define NOTE_F4 349.0
mganseij 2:2cca82c058fc 45 #define NOTE_FS4 370.0
mganseij 2:2cca82c058fc 46 #define NOTE_G4 392.0
mganseij 2:2cca82c058fc 47 #define NOTE_GS4 415.0
mganseij 2:2cca82c058fc 48 #define NOTE_A4 440.0
mganseij 2:2cca82c058fc 49 #define NOTE_AS4 466.0
mganseij 2:2cca82c058fc 50 #define NOTE_B4 494.0
mganseij 2:2cca82c058fc 51 #define NOTE_C5 523.0
mganseij 2:2cca82c058fc 52 #define NOTE_CS5 554.0
mganseij 2:2cca82c058fc 53 #define NOTE_D5 587.0
mganseij 2:2cca82c058fc 54 #define NOTE_DS5 622.0
mganseij 2:2cca82c058fc 55 #define NOTE_E5 659.0
mganseij 2:2cca82c058fc 56 #define NOTE_F5 698.0
mganseij 2:2cca82c058fc 57 #define NOTE_FS5 740.0
mganseij 2:2cca82c058fc 58 #define NOTE_G5 784.0
mganseij 2:2cca82c058fc 59 #define NOTE_GS5 831.0
mganseij 2:2cca82c058fc 60 #define NOTE_A5 880.0
mganseij 2:2cca82c058fc 61 #define NOTE_AS5 932.0
mganseij 2:2cca82c058fc 62 #define NOTE_B5 988.0
mganseij 2:2cca82c058fc 63 #define NOTE_C6 1047.0
mganseij 2:2cca82c058fc 64 #define NOTE_CS6 1109.0
mganseij 2:2cca82c058fc 65 #define NOTE_D6 1175.0
mganseij 2:2cca82c058fc 66 #define NOTE_DS6 1245.0
mganseij 2:2cca82c058fc 67 #define NOTE_E6 1319.0
mganseij 2:2cca82c058fc 68 #define NOTE_F6 1397.0
mganseij 2:2cca82c058fc 69 #define NOTE_FS6 1480.0
mganseij 2:2cca82c058fc 70 #define NOTE_G6 1568.0
mganseij 2:2cca82c058fc 71 #define NOTE_GS6 1661.0
mganseij 2:2cca82c058fc 72 #define NOTE_A6 1760.0
mganseij 2:2cca82c058fc 73 #define NOTE_AS6 1865.0
mganseij 2:2cca82c058fc 74 #define NOTE_B6 1976.0
mganseij 2:2cca82c058fc 75 #define NOTE_C7 2093.0
mganseij 2:2cca82c058fc 76 #define NOTE_CS7 2217.0
mganseij 2:2cca82c058fc 77 #define NOTE_D7 2349.0
mganseij 2:2cca82c058fc 78 #define NOTE_DS7 2489.0
mganseij 2:2cca82c058fc 79 #define NOTE_E7 2637.0
mganseij 2:2cca82c058fc 80 #define NOTE_F7 2794.0
mganseij 2:2cca82c058fc 81 #define NOTE_FS7 2960.0
mganseij 2:2cca82c058fc 82 #define NOTE_G7 3136.0
mganseij 2:2cca82c058fc 83 #define NOTE_GS7 3322.0
mganseij 2:2cca82c058fc 84 #define NOTE_A7 3520.0
mganseij 2:2cca82c058fc 85 #define NOTE_AS7 3729.0
mganseij 2:2cca82c058fc 86 #define NOTE_B7 3951.0
mganseij 2:2cca82c058fc 87 #define NOTE_C8 4186.0
mganseij 2:2cca82c058fc 88 #define NOTE_CS8 4435.0
mganseij 2:2cca82c058fc 89 #define NOTE_D8 4699.0
mganseij 2:2cca82c058fc 90 #define NOTE_DS8 4978.0
mganseij 4:64c31855f0be 91 #define notet 0.175
mganseij 2:2cca82c058fc 92
mganseij 2:2cca82c058fc 93 //Mario main theme melody
mganseij 4:64c31855f0be 94 float note[] = {
mganseij 2:2cca82c058fc 95 NOTE_E7, NOTE_E7, 0.0, NOTE_E7,
mganseij 2:2cca82c058fc 96 0.0, NOTE_C7, NOTE_E7, 0.0,
mganseij 2:2cca82c058fc 97 NOTE_G7, 0.0, 0.0, 0.0,
mganseij 2:2cca82c058fc 98 NOTE_G6, 0.0, 0.0, 0.0,
mganseij 2:2cca82c058fc 99
mganseij 2:2cca82c058fc 100 NOTE_C7, 0, 0, NOTE_G6,
mganseij 2:2cca82c058fc 101 0, 0, NOTE_E6, 0,
mganseij 2:2cca82c058fc 102 0, NOTE_A6, 0, NOTE_B6,
mganseij 2:2cca82c058fc 103 0, NOTE_AS6, NOTE_A6, 0,
mganseij 2:2cca82c058fc 104
mganseij 2:2cca82c058fc 105 NOTE_G6, NOTE_E7, NOTE_G7,
mganseij 2:2cca82c058fc 106 NOTE_A7, 0, NOTE_F7, NOTE_G7,
mganseij 2:2cca82c058fc 107 0, NOTE_E7, 0, NOTE_C7,
mganseij 2:2cca82c058fc 108 NOTE_D7, NOTE_B6, 0, 0,
mganseij 2:2cca82c058fc 109
mganseij 2:2cca82c058fc 110 NOTE_C7, 0, 0, NOTE_G6,
mganseij 2:2cca82c058fc 111 0, 0, NOTE_E6, 0,
mganseij 2:2cca82c058fc 112 0, NOTE_A6, 0, NOTE_B6,
mganseij 2:2cca82c058fc 113 0, NOTE_AS6, NOTE_A6, 0,
mganseij 2:2cca82c058fc 114
mganseij 2:2cca82c058fc 115 NOTE_G6, NOTE_E7, NOTE_G7,
mganseij 2:2cca82c058fc 116 NOTE_A7, 0, NOTE_F7, NOTE_G7,
mganseij 2:2cca82c058fc 117 0, NOTE_E7, 0, NOTE_C7,
DennisNiehoff 5:54dda16baec4 118 NOTE_D7, NOTE_B6, 0, 0,
DennisNiehoff 5:54dda16baec4 119
DennisNiehoff 5:54dda16baec4 120 NOTE_G7, NOTE_FS7, NOTE_F7, NOTE_DS7,
DennisNiehoff 5:54dda16baec4 121 0.0, NOTE_E7, 0.0, NOTE_GS6,
DennisNiehoff 5:54dda16baec4 122 NOTE_A6, NOTE_C7, 0.0,
DennisNiehoff 5:54dda16baec4 123 NOTE_A6, NOTE_C7, NOTE_D7,
DennisNiehoff 5:54dda16baec4 124
DennisNiehoff 5:54dda16baec4 125 NOTE_G7, NOTE_FS7, NOTE_F7, NOTE_DS7,
DennisNiehoff 5:54dda16baec4 126 0.0, NOTE_E7, 0.0, NOTE_C8,
DennisNiehoff 5:54dda16baec4 127 0.0, NOTE_C8, NOTE_C8, 0.0,
DennisNiehoff 5:54dda16baec4 128
DennisNiehoff 5:54dda16baec4 129 NOTE_G7, NOTE_FS7, NOTE_F7, NOTE_DS7,
DennisNiehoff 5:54dda16baec4 130 0.0, NOTE_E7, 0.0, NOTE_GS6,
DennisNiehoff 5:54dda16baec4 131 NOTE_A6, NOTE_C7, 0.0,
DennisNiehoff 5:54dda16baec4 132 NOTE_A6, NOTE_C7, NOTE_D7,
DennisNiehoff 5:54dda16baec4 133
DennisNiehoff 5:54dda16baec4 134 NOTE_DS7, 0.0, 0.0, NOTE_D7,
DennisNiehoff 5:54dda16baec4 135 NOTE_C7, 0.0,
DennisNiehoff 5:54dda16baec4 136
mganseij 2:2cca82c058fc 137 };
mganseij 2:2cca82c058fc 138 //Mario main them tempo
mganseij 2:2cca82c058fc 139 float duration[] = {
mganseij 2:2cca82c058fc 140 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 141 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 142 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 143 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 144
mganseij 2:2cca82c058fc 145 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 146 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 147 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 148 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 149
mganseij 2:2cca82c058fc 150
mganseij 2:2cca82c058fc 151
mganseij 2:2cca82c058fc 152 0.09,0.09,0.09,
mganseij 2:2cca82c058fc 153 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 154 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 155 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 156
mganseij 2:2cca82c058fc 157 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 158 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 159 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 160 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 161
mganseij 2:2cca82c058fc 162
mganseij 2:2cca82c058fc 163 0.09,0.09,0.09,
mganseij 2:2cca82c058fc 164 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 165 0.12,0.12,0.12,0.12,
mganseij 2:2cca82c058fc 166 0.12,0.12,0.12,0.12,
DennisNiehoff 5:54dda16baec4 167
DennisNiehoff 5:54dda16baec4 168
DennisNiehoff 5:54dda16baec4 169 0.12,0.12,0.12,0.12,
DennisNiehoff 5:54dda16baec4 170 0.12,0.12,0.12,0.12,
DennisNiehoff 5:54dda16baec4 171 0.12,0.12,0.12,
DennisNiehoff 5:54dda16baec4 172 0.12,0.12,0.12,
DennisNiehoff 5:54dda16baec4 173
DennisNiehoff 5:54dda16baec4 174 0.12,0.12,0.12,0.12,
DennisNiehoff 5:54dda16baec4 175 0.12,0.12,0.12,0.12,
DennisNiehoff 5:54dda16baec4 176 0.12,0.12,0.12,0.12,
DennisNiehoff 5:54dda16baec4 177
DennisNiehoff 5:54dda16baec4 178 0.12,0.12,0.12,0.12,
DennisNiehoff 5:54dda16baec4 179 0.12,0.12,0.12,0.12,
DennisNiehoff 5:54dda16baec4 180 0.12,0.12,0.12,
DennisNiehoff 5:54dda16baec4 181 0.12,0.12,0.12,
DennisNiehoff 5:54dda16baec4 182
DennisNiehoff 5:54dda16baec4 183 0.12,0.12,0.12,0.12,
DennisNiehoff 5:54dda16baec4 184 0.12,0.12,
mganseij 3:89b8dea1cf17 185 };
mganseij 3:89b8dea1cf17 186
DennisNiehoff 5:54dda16baec4 187 //failure sound and failure durations
DennisNiehoff 5:54dda16baec4 188 float note_death[] = {
DennisNiehoff 6:ce3c3d9c96e9 189 NOTE_B6, NOTE_F7, 0.0, NOTE_F7,
DennisNiehoff 6:ce3c3d9c96e9 190 NOTE_F7, NOTE_E7, NOTE_D7,
DennisNiehoff 6:ce3c3d9c96e9 191 NOTE_C7, NOTE_E6, 0.0,
DennisNiehoff 6:ce3c3d9c96e9 192 NOTE_E6, NOTE_C6, 0.0,
mganseij 3:89b8dea1cf17 193 };
DennisNiehoff 5:54dda16baec4 194
DennisNiehoff 5:54dda16baec4 195 float duration_death[] = {
DennisNiehoff 5:54dda16baec4 196 0.12, 0.12, 0.12, 0.12,
DennisNiehoff 5:54dda16baec4 197 0.09, 0.09, 0.09,
DennisNiehoff 5:54dda16baec4 198 0.12, 0.12, 0.12,
DennisNiehoff 5:54dda16baec4 199 0.12, 0.12, 0.12,
DennisNiehoff 5:54dda16baec4 200 };