PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)

Dependents:   YATTT sd_map_test cPong SnowDemo ... more

PokittoLib

Library for programming Pokitto hardware

How to Use

  1. Import this library to online compiler (see button "import" on the right hand side
  2. DO NOT import mbed-src anymore, a better version is now included inside PokittoLib
  3. Change My_settings.h according to your project
  4. Start coding!
Committer:
Pokitto
Date:
Mon Sep 18 11:47:51 2017 +0000
Revision:
0:e8b8f36b4505
Child:
2:968589ca3484
Initial;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Pokitto 0:e8b8f36b4505 1 /**************************************************************************/
Pokitto 0:e8b8f36b4505 2 /*!
Pokitto 0:e8b8f36b4505 3 @file Synth_envfuncs.cpp
Pokitto 0:e8b8f36b4505 4 @author Jonne Valola
Pokitto 0:e8b8f36b4505 5
Pokitto 0:e8b8f36b4505 6 @section LICENSE
Pokitto 0:e8b8f36b4505 7
Pokitto 0:e8b8f36b4505 8 Pokitto development stage library
Pokitto 0:e8b8f36b4505 9 Software License Agreement
Pokitto 0:e8b8f36b4505 10
Pokitto 0:e8b8f36b4505 11 Copyright (c) 2015, Jonne Valola ("Author")
Pokitto 0:e8b8f36b4505 12 All rights reserved.
Pokitto 0:e8b8f36b4505 13
Pokitto 0:e8b8f36b4505 14 This library is intended solely for the purpose of Pokitto development.
Pokitto 0:e8b8f36b4505 15
Pokitto 0:e8b8f36b4505 16 Redistribution and use in source and binary forms, with or without
Pokitto 0:e8b8f36b4505 17 modification requires written permission from Author.
Pokitto 0:e8b8f36b4505 18 */
Pokitto 0:e8b8f36b4505 19 /**************************************************************************/
Pokitto 0:e8b8f36b4505 20
Pokitto 0:e8b8f36b4505 21 #include "Pokitto.h"
Pokitto 0:e8b8f36b4505 22 #include "Synth.h"
Pokitto 0:e8b8f36b4505 23
Pokitto 0:e8b8f36b4505 24 #define PROGMEM
Pokitto 0:e8b8f36b4505 25 #define pgm_read_byte(addr) (*(const unsigned char *)(addr))
Pokitto 0:e8b8f36b4505 26 #ifndef WIN32
Pokitto 0:e8b8f36b4505 27 #define pgm_read_word(addr) (*(const unsigned short *)(addr))
Pokitto 0:e8b8f36b4505 28 #else
Pokitto 0:e8b8f36b4505 29 #define pgm_read_word(addr) (*(const unsigned int *)(addr))
Pokitto 0:e8b8f36b4505 30 #endif // WIN32
Pokitto 0:e8b8f36b4505 31
Pokitto 0:e8b8f36b4505 32 // http://www.arklyffe.com/main/2010/08/29/xorshift-pseudorandom-number-generator/
Pokitto 0:e8b8f36b4505 33 static uint8_t y8 = 1;
Pokitto 0:e8b8f36b4505 34 static uint16_t y16 = 1;
Pokitto 0:e8b8f36b4505 35
Pokitto 0:e8b8f36b4505 36 // returns values from 1 to 255 inclusive, period is 255
Pokitto 0:e8b8f36b4505 37 uint8_t xorshift8(void) {
Pokitto 0:e8b8f36b4505 38 //y8 ^= (y8 << 7);
Pokitto 0:e8b8f36b4505 39 y8 ^= (y8 * 128);
Pokitto 0:e8b8f36b4505 40 y8 ^= (y8 >> 5);
Pokitto 0:e8b8f36b4505 41 //return y8 ^= (y8 << 3);
Pokitto 0:e8b8f36b4505 42 return y8 ^= (y8 * 8);
Pokitto 0:e8b8f36b4505 43 }
Pokitto 0:e8b8f36b4505 44
Pokitto 0:e8b8f36b4505 45 // returns values from 1 to 65535 inclusive, period is 65535
Pokitto 0:e8b8f36b4505 46 uint16_t xorshift16(void) {
Pokitto 0:e8b8f36b4505 47 //y16 ^= (y16 << 13);
Pokitto 0:e8b8f36b4505 48 y16 ^= (y16 * 8192);
Pokitto 0:e8b8f36b4505 49 y16 ^= (y16 >> 9);
Pokitto 0:e8b8f36b4505 50 //return y16 ^= (y16 << 7);
Pokitto 0:e8b8f36b4505 51 return y16 ^= (y16 * 128);
Pokitto 0:e8b8f36b4505 52 }
Pokitto 0:e8b8f36b4505 53
Pokitto 0:e8b8f36b4505 54
Pokitto 0:e8b8f36b4505 55 int8_t arptable[MAX_ARPMODE][5] = {
Pokitto 0:e8b8f36b4505 56 {0,0,0,0,0}, // Off
Pokitto 0:e8b8f36b4505 57 {0,4,7,4,0}, // Major tonic, 3rd, 5th
Pokitto 0:e8b8f36b4505 58 {0,3,7,3,0}, // Minor tonic, 3rd, 5th
Pokitto 0:e8b8f36b4505 59 {0,1,0,-1,0}, // vibrato test
Pokitto 0:e8b8f36b4505 60 {0,12,0,12,0}, // octave test
Pokitto 0:e8b8f36b4505 61 {0,11,14,17,21}, // funky test
Pokitto 0:e8b8f36b4505 62 };
Pokitto 0:e8b8f36b4505 63
Pokitto 0:e8b8f36b4505 64 /** VITAL TABLES **/
Pokitto 0:e8b8f36b4505 65
Pokitto 0:e8b8f36b4505 66 uint16_t cincs[] ={
Pokitto 0:e8b8f36b4505 67 36, // 0 - NOTE_B0
Pokitto 0:e8b8f36b4505 68 38, // 1 - NOTE_C1
Pokitto 0:e8b8f36b4505 69 40, // 2 - NOTE_CS1
Pokitto 0:e8b8f36b4505 70 43, // 3 - NOTE_D1
Pokitto 0:e8b8f36b4505 71 45, // 4 - NOTE_DS1
Pokitto 0:e8b8f36b4505 72 47, // 5 - NOTE_E1
Pokitto 0:e8b8f36b4505 73 51, // 6 - NOTE_F1
Pokitto 0:e8b8f36b4505 74 53, // 7 - NOTE_FS1
Pokitto 0:e8b8f36b4505 75 56, // 8 - NOTE_G1
Pokitto 0:e8b8f36b4505 76 60, // 9 - NOTE_GS1
Pokitto 0:e8b8f36b4505 77 63, // 10 - NOTE_A1
Pokitto 0:e8b8f36b4505 78 67, // 11 - NOTE_AS1
Pokitto 0:e8b8f36b4505 79 71, // 12 - NOTE_B1
Pokitto 0:e8b8f36b4505 80 75, // 13 - NOTE_C2
Pokitto 0:e8b8f36b4505 81 79, // 14 - NOTE_CS2
Pokitto 0:e8b8f36b4505 82 84, // 15 - NOTE_D2
Pokitto 0:e8b8f36b4505 83 90, // 16 - NOTE_DS2
Pokitto 0:e8b8f36b4505 84 94, // 17 - NOTE_E2
Pokitto 0:e8b8f36b4505 85 100, // 18 - NOTE_F2
Pokitto 0:e8b8f36b4505 86 107, // 19 - NOTE_FS2
Pokitto 0:e8b8f36b4505 87 113, // 20 - NOTE_G2
Pokitto 0:e8b8f36b4505 88 120, // 21 - NOTE_GS2
Pokitto 0:e8b8f36b4505 89 127, // 22 - NOTE_A2
Pokitto 0:e8b8f36b4505 90 135, // 23 - NOTE_AS2
Pokitto 0:e8b8f36b4505 91 142, // 24 - NOTE_B2
Pokitto 0:e8b8f36b4505 92 151, // 25 - NOTE_C3
Pokitto 0:e8b8f36b4505 93 160, // 26 - NOTE_CS3
Pokitto 0:e8b8f36b4505 94 169, // 27 - NOTE_D3
Pokitto 0:e8b8f36b4505 95 180, // 28 - NOTE_DS3
Pokitto 0:e8b8f36b4505 96 190, // 29 - NOTE_E3
Pokitto 0:e8b8f36b4505 97 201, // 30 - NOTE_F3
Pokitto 0:e8b8f36b4505 98 213, // 31 - NOTE_FS3
Pokitto 0:e8b8f36b4505 99 225, // 32 - NOTE_G3
Pokitto 0:e8b8f36b4505 100 239, //239, // 33 - NOTE_GS3
Pokitto 0:e8b8f36b4505 101 253, // 34 - NOTE_A3
Pokitto 0:e8b8f36b4505 102 267, // 35 - NOTE_AS3
Pokitto 0:e8b8f36b4505 103 284, // 36 - NOTE_B3
Pokitto 0:e8b8f36b4505 104 301, // 37 - NOTE_C4
Pokitto 0:e8b8f36b4505 105 318, // 38 - NOTE_CS4
Pokitto 0:e8b8f36b4505 106 338, // 39 - NOTE_D4
Pokitto 0:e8b8f36b4505 107 358, // 40 - NOTE_DS4
Pokitto 0:e8b8f36b4505 108 379, // 41 - NOTE_E4
Pokitto 0:e8b8f36b4505 109 402, // 42 - NOTE_F4
Pokitto 0:e8b8f36b4505 110 426, // 43 - NOTE_FS4
Pokitto 0:e8b8f36b4505 111 452, // 44 - NOTE_G4
Pokitto 0:e8b8f36b4505 112 478, // 45 - NOTE_GS4
Pokitto 0:e8b8f36b4505 113 504, // 46 - NOTE_A4 // 440Hz
Pokitto 0:e8b8f36b4505 114 537, // 47 - NOTE_AS4
Pokitto 0:e8b8f36b4505 115 570, // 48 - NOTE_B4
Pokitto 0:e8b8f36b4505 116 601, // 49 - NOTE_C5
Pokitto 0:e8b8f36b4505 117 636, // 50 - NOTE_CS5
Pokitto 0:e8b8f36b4505 118 676, // 51 - NOTE_D5
Pokitto 0:e8b8f36b4505 119 712, // 52 - NOTE_DS5
Pokitto 0:e8b8f36b4505 120 762, // 53 - NOTE_E5
Pokitto 0:e8b8f36b4505 121 799, // 54 - NOTE_F5
Pokitto 0:e8b8f36b4505 122 851, // 55 - NOTE_FS5
Pokitto 0:e8b8f36b4505 123 898, // 56 - NOTE_G5
Pokitto 0:e8b8f36b4505 124 950, // 57 - NOTE_GS5
Pokitto 0:e8b8f36b4505 125 1008, // 58 - NOTE_A5
Pokitto 0:e8b8f36b4505 126 1074, // 59 - NOTE_AS5
Pokitto 0:e8b8f36b4505 127 1130, // 60 - NOTE_B5
Pokitto 0:e8b8f36b4505 128 1214, // 61 - NOTE_C6
Pokitto 0:e8b8f36b4505 129 1285, // 62 - NOTE_CS6
Pokitto 0:e8b8f36b4505 130 1337, // 63 - NOTE_D6
Pokitto 0:e8b8f36b4505 131 1425, // 64 - NOTE_DS6
Pokitto 0:e8b8f36b4505 132 1524, // 65 - NOTE_E6
Pokitto 0:e8b8f36b4505 133 1598, // 66 - NOTE_F6
Pokitto 0:e8b8f36b4505 134 1680, // 67 - NOTE_FS6
Pokitto 0:e8b8f36b4505 135 1820, // 68 - NOTE_G6
Pokitto 0:e8b8f36b4505 136 1928, // 69 - NOTE_GS6
Pokitto 0:e8b8f36b4505 137 2048, // 70 - NOTE_A6
Pokitto 0:e8b8f36b4505 138 2114, // 71 - NOTE_AS6
Pokitto 0:e8b8f36b4505 139 2260, // 72 - NOTE_B6
Pokitto 0:e8b8f36b4505 140 2427, // 73 - NOTE_C7
Pokitto 0:e8b8f36b4505 141 2521, // 74 - NOTE_CS7
Pokitto 0:e8b8f36b4505 142 2731, // 75 - NOTE_D7
Pokitto 0:e8b8f36b4505 143 2849, // 76 - NOTE_DS7
Pokitto 0:e8b8f36b4505 144 2979, // 77 - NOTE_E7
Pokitto 0:e8b8f36b4505 145 3277, // 78 - NOTE_F7
Pokitto 0:e8b8f36b4505 146 3449, // 79 - NOTE_FS7
Pokitto 0:e8b8f36b4505 147 3641, // 80 - NOTE_G7
Pokitto 0:e8b8f36b4505 148 3855, // 81 - NOTE_GS7
Pokitto 0:e8b8f36b4505 149 4096, // 82 - NOTE_A7
Pokitto 0:e8b8f36b4505 150 4369, // 83 - NOTE_AS7
Pokitto 0:e8b8f36b4505 151 4681, // 84 - NOTE_B7
Pokitto 0:e8b8f36b4505 152 4681, // 85 - NOTE_C8
Pokitto 0:e8b8f36b4505 153 5041, // 86 - NOTE_CS8
Pokitto 0:e8b8f36b4505 154 5461, // 87 - NOTE_D8
Pokitto 0:e8b8f36b4505 155 5958, // 88 - NOTE_DS8
Pokitto 0:e8b8f36b4505 156 };
Pokitto 0:e8b8f36b4505 157
Pokitto 0:e8b8f36b4505 158
Pokitto 0:e8b8f36b4505 159 /** NOTE TO TEXT TABLES **/
Pokitto 0:e8b8f36b4505 160
Pokitto 0:e8b8f36b4505 161 const char note_0[] PROGMEM = "B-0"; // 0 - NOTE_B0
Pokitto 0:e8b8f36b4505 162 const char note_1[] PROGMEM = "C-1"; // 1 - NOTE_C1
Pokitto 0:e8b8f36b4505 163 const char note_2[] PROGMEM = "C#1"; // 2 - NOTE_CS1
Pokitto 0:e8b8f36b4505 164 const char note_3[] PROGMEM = "D-1"; // 3 - NOTE_D1
Pokitto 0:e8b8f36b4505 165 const char note_4[] PROGMEM = "D#1"; // 4 - NOTE_DS1
Pokitto 0:e8b8f36b4505 166 const char note_5[] PROGMEM = "E-1"; // 5 - NOTE_E1
Pokitto 0:e8b8f36b4505 167 const char note_6[] PROGMEM = "F-1"; // 6 - NOTE_F1
Pokitto 0:e8b8f36b4505 168 const char note_7[] PROGMEM = "F#1"; // 7 - NOTE_FS1
Pokitto 0:e8b8f36b4505 169 const char note_8[] PROGMEM = "G-1"; // 8 - NOTE_G1
Pokitto 0:e8b8f36b4505 170 const char note_9[] PROGMEM = "G#1"; // 9 - NOTE_GS1
Pokitto 0:e8b8f36b4505 171 const char note_10[] PROGMEM = "A-1"; // 10 - NOTE_A1
Pokitto 0:e8b8f36b4505 172 const char note_11[] PROGMEM = "A#1"; // 11 - NOTE_AS1
Pokitto 0:e8b8f36b4505 173 const char note_12[] PROGMEM = "B-1"; // 12 - NOTE_B1
Pokitto 0:e8b8f36b4505 174 const char note_13[] PROGMEM = "C-2"; // 2 - NOTE_C2
Pokitto 0:e8b8f36b4505 175 const char note_14[] PROGMEM = "C#2"; // 2 - NOTE_CS2
Pokitto 0:e8b8f36b4505 176 const char note_15[] PROGMEM = "D-2"; // 3 - NOTE_D2
Pokitto 0:e8b8f36b4505 177 const char note_16[] PROGMEM = "D#2"; // 4 - NOTE_DS2
Pokitto 0:e8b8f36b4505 178 const char note_17[] PROGMEM = "E-2"; // 5 - NOTE_E2
Pokitto 0:e8b8f36b4505 179 const char note_18[] PROGMEM = "F-2"; // 6 - NOTE_F2
Pokitto 0:e8b8f36b4505 180 const char note_19[] PROGMEM = "F#2"; // 7 - NOTE_FS2
Pokitto 0:e8b8f36b4505 181 const char note_20[] PROGMEM = "G-2"; // 8 - NOTE_G2
Pokitto 0:e8b8f36b4505 182 const char note_21[] PROGMEM = "G#2"; // 9 - NOTE_GS2
Pokitto 0:e8b8f36b4505 183 const char note_22[] PROGMEM = "A-2"; // 20 - NOTE_A2
Pokitto 0:e8b8f36b4505 184 const char note_23[] PROGMEM = "A#2"; // 22 - NOTE_AS2
Pokitto 0:e8b8f36b4505 185 const char note_24[] PROGMEM = "B-2"; // 22 - NOTE_B2
Pokitto 0:e8b8f36b4505 186 const char note_25[] PROGMEM = "C-3"; // 3 - NOTE_C3
Pokitto 0:e8b8f36b4505 187 const char note_26[] PROGMEM = "C#3"; // 3 - NOTE_CS3
Pokitto 0:e8b8f36b4505 188 const char note_27[] PROGMEM = "D-3"; // 3 - NOTE_D3
Pokitto 0:e8b8f36b4505 189 const char note_28[] PROGMEM = "D#3"; // 4 - NOTE_DS3
Pokitto 0:e8b8f36b4505 190 const char note_29[] PROGMEM = "E-3"; // 5 - NOTE_E3
Pokitto 0:e8b8f36b4505 191 const char note_30[] PROGMEM = "F-3"; // 6 - NOTE_F3
Pokitto 0:e8b8f36b4505 192 const char note_31[] PROGMEM = "F#3"; // 7 - NOTE_FS3
Pokitto 0:e8b8f36b4505 193 const char note_32[] PROGMEM = "G-3"; // 8 - NOTE_G3
Pokitto 0:e8b8f36b4505 194 const char note_33[] PROGMEM = "G#3"; // 9 - NOTE_GS3
Pokitto 0:e8b8f36b4505 195 const char note_34[] PROGMEM = "A-3"; // 30 - NOTE_A3
Pokitto 0:e8b8f36b4505 196 const char note_35[] PROGMEM = "A#3"; // 33 - NOTE_AS3
Pokitto 0:e8b8f36b4505 197 const char note_36[] PROGMEM = "B-3"; // 33 - NOTE_B3
Pokitto 0:e8b8f36b4505 198 const char note_37[] PROGMEM = "C-4"; // 4 - NOTE_C4
Pokitto 0:e8b8f36b4505 199 const char note_38[] PROGMEM = "C#4"; // 4 - NOTE_CS4
Pokitto 0:e8b8f36b4505 200 const char note_39[] PROGMEM = "D-4"; // 3 - NOTE_D4
Pokitto 0:e8b8f36b4505 201 const char note_40[] PROGMEM = "D#4"; // 4 - NOTE_DS4
Pokitto 0:e8b8f36b4505 202 const char note_41[] PROGMEM = "E-4"; // 5 - NOTE_E4
Pokitto 0:e8b8f36b4505 203 const char note_42[] PROGMEM = "F-4"; // 6 - NOTE_F4
Pokitto 0:e8b8f36b4505 204 const char note_43[] PROGMEM = "F#4"; // 7 - NOTE_FS4
Pokitto 0:e8b8f36b4505 205 const char note_44[] PROGMEM = "G-4"; // 8 - NOTE_G4
Pokitto 0:e8b8f36b4505 206 const char note_45[] PROGMEM = "G#4"; // 9 - NOTE_GS4
Pokitto 0:e8b8f36b4505 207 const char note_46[] PROGMEM = "A-4"; // 40 - NOTE_A4
Pokitto 0:e8b8f36b4505 208 const char note_47[] PROGMEM = "A#4"; // 44 - NOTE_AS4
Pokitto 0:e8b8f36b4505 209 const char note_48[] PROGMEM = "B-4"; // 44 - NOTE_B4
Pokitto 0:e8b8f36b4505 210 const char note_49[] PROGMEM = "C-5"; // 5 - NOTE_C5
Pokitto 0:e8b8f36b4505 211 const char note_50[] PROGMEM = "C#5"; // 5 - NOTE_CS5
Pokitto 0:e8b8f36b4505 212 const char note_51[] PROGMEM = "D-5"; // 3 - NOTE_D5
Pokitto 0:e8b8f36b4505 213 const char note_52[] PROGMEM = "D#5"; // 4 - NOTE_DS5
Pokitto 0:e8b8f36b4505 214 const char note_53[] PROGMEM = "E-5"; // 5 - NOTE_E5
Pokitto 0:e8b8f36b4505 215 const char note_54[] PROGMEM = "F-5"; // 6 - NOTE_F5
Pokitto 0:e8b8f36b4505 216 const char note_55[] PROGMEM = "F#5"; // 7 - NOTE_FS5
Pokitto 0:e8b8f36b4505 217 const char note_56[] PROGMEM = "G-5"; // 8 - NOTE_G5
Pokitto 0:e8b8f36b4505 218 const char note_57[] PROGMEM = "G#5"; // 9 - NOTE_GS5
Pokitto 0:e8b8f36b4505 219 const char note_58[] PROGMEM = "A-5"; // 50 - NOTE_A5
Pokitto 0:e8b8f36b4505 220 const char note_59[] PROGMEM = "A#5"; // 55 - NOTE_AS5
Pokitto 0:e8b8f36b4505 221 const char note_60[] PROGMEM = "B-5"; // 55 - NOTE_B5
Pokitto 0:e8b8f36b4505 222 const char note_61[] PROGMEM = "C-6"; // 6 - NOTE_C6
Pokitto 0:e8b8f36b4505 223 const char note_62[] PROGMEM = "C#6"; // 6 - NOTE_CS6
Pokitto 0:e8b8f36b4505 224 const char note_63[] PROGMEM = "D-6"; // 3 - NOTE_D6
Pokitto 0:e8b8f36b4505 225 const char note_64[] PROGMEM = "D#6"; // 4 - NOTE_DS6
Pokitto 0:e8b8f36b4505 226 const char note_65[] PROGMEM = "E-6"; // 5 - NOTE_E6
Pokitto 0:e8b8f36b4505 227 const char note_66[] PROGMEM = "F-6"; // 6 - NOTE_F6
Pokitto 0:e8b8f36b4505 228 const char note_67[] PROGMEM = "F#6"; // 7 - NOTE_FS6
Pokitto 0:e8b8f36b4505 229 const char note_68[] PROGMEM = "G-6"; // 8 - NOTE_G6
Pokitto 0:e8b8f36b4505 230 const char note_69[] PROGMEM = "G#6"; // 9 - NOTE_GS6
Pokitto 0:e8b8f36b4505 231 const char note_70[] PROGMEM = "A-6"; // 60 - NOTE_A6
Pokitto 0:e8b8f36b4505 232 const char note_71[] PROGMEM = "A#6"; // 66 - NOTE_AS6
Pokitto 0:e8b8f36b4505 233 const char note_72[] PROGMEM = "B-6"; // 66 - NOTE_B6
Pokitto 0:e8b8f36b4505 234 const char note_73[] PROGMEM = "C-7"; // 7 - NOTE_C7
Pokitto 0:e8b8f36b4505 235 const char note_74[] PROGMEM = "C#7"; // 7 - NOTE_CS7
Pokitto 0:e8b8f36b4505 236 const char note_75[] PROGMEM = "D-7"; // 3 - NOTE_D7
Pokitto 0:e8b8f36b4505 237 const char note_76[] PROGMEM = "D#7"; // 4 - NOTE_DS7
Pokitto 0:e8b8f36b4505 238 const char note_77[] PROGMEM = "E-7"; // 5 - NOTE_E7
Pokitto 0:e8b8f36b4505 239 const char note_78[] PROGMEM = "F-7"; // 6 - NOTE_F7
Pokitto 0:e8b8f36b4505 240 const char note_79[] PROGMEM = "F#7"; // 7 - NOTE_FS7
Pokitto 0:e8b8f36b4505 241 const char note_80[] PROGMEM = "G-7"; // 8 - NOTE_G7
Pokitto 0:e8b8f36b4505 242 const char note_81[] PROGMEM = "G#7"; // 9 - NOTE_GS7
Pokitto 0:e8b8f36b4505 243 const char note_82[] PROGMEM = "A-7"; // 70 - NOTE_A7
Pokitto 0:e8b8f36b4505 244 const char note_83[] PROGMEM = "A#7"; // 77 - NOTE_AS7
Pokitto 0:e8b8f36b4505 245 const char note_84[] PROGMEM = "B-7"; // 77 - NOTE_B7
Pokitto 0:e8b8f36b4505 246 const char note_85[] PROGMEM = "C-8"; // 8 - NOTE_C8
Pokitto 0:e8b8f36b4505 247 const char note_86[] PROGMEM = "C#8"; // 8 - NOTE_CS8
Pokitto 0:e8b8f36b4505 248 const char note_87[] PROGMEM = "D-8"; // 3 - NOTE_D8
Pokitto 0:e8b8f36b4505 249 const char note_88[] PROGMEM = "D#8"; // 4 - NOTE_DS8
Pokitto 0:e8b8f36b4505 250
Pokitto 0:e8b8f36b4505 251 const char* note_table[] PROGMEM = {
Pokitto 0:e8b8f36b4505 252 note_0,
Pokitto 0:e8b8f36b4505 253 note_1,
Pokitto 0:e8b8f36b4505 254 note_2,
Pokitto 0:e8b8f36b4505 255 note_3,
Pokitto 0:e8b8f36b4505 256 note_4,
Pokitto 0:e8b8f36b4505 257 note_5,
Pokitto 0:e8b8f36b4505 258 note_6,
Pokitto 0:e8b8f36b4505 259 note_7,
Pokitto 0:e8b8f36b4505 260 note_8,
Pokitto 0:e8b8f36b4505 261 note_9,
Pokitto 0:e8b8f36b4505 262 note_10,
Pokitto 0:e8b8f36b4505 263 note_11,
Pokitto 0:e8b8f36b4505 264 note_12,
Pokitto 0:e8b8f36b4505 265 note_13,
Pokitto 0:e8b8f36b4505 266 note_14,
Pokitto 0:e8b8f36b4505 267 note_15,
Pokitto 0:e8b8f36b4505 268 note_16,
Pokitto 0:e8b8f36b4505 269 note_17,
Pokitto 0:e8b8f36b4505 270 note_18,
Pokitto 0:e8b8f36b4505 271 note_19,
Pokitto 0:e8b8f36b4505 272 note_20,
Pokitto 0:e8b8f36b4505 273 note_21,
Pokitto 0:e8b8f36b4505 274 note_22,
Pokitto 0:e8b8f36b4505 275 note_23,
Pokitto 0:e8b8f36b4505 276 note_24,
Pokitto 0:e8b8f36b4505 277 note_25,
Pokitto 0:e8b8f36b4505 278 note_26,
Pokitto 0:e8b8f36b4505 279 note_27,
Pokitto 0:e8b8f36b4505 280 note_28,
Pokitto 0:e8b8f36b4505 281 note_29,
Pokitto 0:e8b8f36b4505 282 note_30,
Pokitto 0:e8b8f36b4505 283 note_31,
Pokitto 0:e8b8f36b4505 284 note_32,
Pokitto 0:e8b8f36b4505 285 note_33,
Pokitto 0:e8b8f36b4505 286 note_34,
Pokitto 0:e8b8f36b4505 287 note_35,
Pokitto 0:e8b8f36b4505 288 note_36,
Pokitto 0:e8b8f36b4505 289 note_37,
Pokitto 0:e8b8f36b4505 290 note_38,
Pokitto 0:e8b8f36b4505 291 note_39,
Pokitto 0:e8b8f36b4505 292 note_40,
Pokitto 0:e8b8f36b4505 293 note_41,
Pokitto 0:e8b8f36b4505 294 note_42,
Pokitto 0:e8b8f36b4505 295 note_43,
Pokitto 0:e8b8f36b4505 296 note_44,
Pokitto 0:e8b8f36b4505 297 note_45,
Pokitto 0:e8b8f36b4505 298 note_46,
Pokitto 0:e8b8f36b4505 299 note_47,
Pokitto 0:e8b8f36b4505 300 note_48,
Pokitto 0:e8b8f36b4505 301 note_49,
Pokitto 0:e8b8f36b4505 302 note_50,
Pokitto 0:e8b8f36b4505 303 note_51,
Pokitto 0:e8b8f36b4505 304 note_52,
Pokitto 0:e8b8f36b4505 305 note_53,
Pokitto 0:e8b8f36b4505 306 note_54,
Pokitto 0:e8b8f36b4505 307 note_55,
Pokitto 0:e8b8f36b4505 308 note_56,
Pokitto 0:e8b8f36b4505 309 note_57,
Pokitto 0:e8b8f36b4505 310 note_58,
Pokitto 0:e8b8f36b4505 311 note_59,
Pokitto 0:e8b8f36b4505 312 note_60,
Pokitto 0:e8b8f36b4505 313 note_61,
Pokitto 0:e8b8f36b4505 314 note_62,
Pokitto 0:e8b8f36b4505 315 note_63,
Pokitto 0:e8b8f36b4505 316 note_64,
Pokitto 0:e8b8f36b4505 317 note_65,
Pokitto 0:e8b8f36b4505 318 note_66,
Pokitto 0:e8b8f36b4505 319 note_67,
Pokitto 0:e8b8f36b4505 320 note_68,
Pokitto 0:e8b8f36b4505 321 note_69,
Pokitto 0:e8b8f36b4505 322 note_70,
Pokitto 0:e8b8f36b4505 323 note_71,
Pokitto 0:e8b8f36b4505 324 note_72,
Pokitto 0:e8b8f36b4505 325 note_73,
Pokitto 0:e8b8f36b4505 326 note_74,
Pokitto 0:e8b8f36b4505 327 note_75,
Pokitto 0:e8b8f36b4505 328 note_76,
Pokitto 0:e8b8f36b4505 329 note_77,
Pokitto 0:e8b8f36b4505 330 note_78,
Pokitto 0:e8b8f36b4505 331 note_79,
Pokitto 0:e8b8f36b4505 332 note_80,
Pokitto 0:e8b8f36b4505 333 note_81,
Pokitto 0:e8b8f36b4505 334 note_82,
Pokitto 0:e8b8f36b4505 335 note_83,
Pokitto 0:e8b8f36b4505 336 note_84,
Pokitto 0:e8b8f36b4505 337 note_85,
Pokitto 0:e8b8f36b4505 338 note_86,
Pokitto 0:e8b8f36b4505 339 note_87,
Pokitto 0:e8b8f36b4505 340 note_88,
Pokitto 0:e8b8f36b4505 341 };
Pokitto 0:e8b8f36b4505 342
Pokitto 0:e8b8f36b4505 343 void getNoteString(char * buffer, uint8_t i) {
Pokitto 0:e8b8f36b4505 344 if (i>88) strcpy(buffer,"@@@");
Pokitto 0:e8b8f36b4505 345 else strcpy(buffer, note_table[i]);
Pokitto 0:e8b8f36b4505 346 }
Pokitto 0:e8b8f36b4505 347