Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const byte voicePins[] PROGMEM = {2, 3, 4, 5, 6, 7};
byte voiceEnabled[6];
byte voiceType[6];
byte states[6];
byte noiseCount[6];
unsigned long start[6];
unsigned int periods[6];
unsigned long nextFlip[6];
byte noise = 0;
unsigned long t = 0;
byte tFlip = 0;
unsigned long nextCommandTime = 0;
bool songPlaying = false;
const unsigned int frequencies[89] PROGMEM = {
0, 27, 29, 30,
33, 35, 37, 39, 41, 44, 46, 49, 52, 55, 58, 62,
65, 69, 73, 78, 82, 87, 92, 98, 104, 110, 116, 123,
131, 138, 147, 155, 165, 175, 185, 196, 208, 220, 233, 247,
262, 277, 294, 311, 330, 349, 370, 392, 415, 440, 466, 494,
523, 554, 587, 622, 659, 698, 740, 784, 831, 880, 932, 988,
1046, 1109, 1175, 1244, 1318, 1397, 1480, 1568, 1661, 1760, 1865, 1975,
2093, 2217, 2349, 2489, 2637, 2794, 2960, 3136, 3322, 3520, 3729, 3951,
4186,
};
const byte score [] PROGMEM = {
0x90,76, 0x91,66, 0x92,50, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,76, 0x91,66, 0x92,50,
0,47, 0x83, 0,47, 0x80, 0x81, 0x82, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,76, 0x91,66,
0x92,50, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0,95, 0x83, 0,95, 0x90,72, 0x91,66, 0x92,50, 0x93,127,
0,95, 0x80, 0x81, 0x82, 0x83, 0,47, 0x90,76, 0x91,66, 0x92,50, 0x93,127, 0,95, 0x80, 0x81, 0x82,
0,95, 0x83, 0,95, 0x90,79, 0x91,71, 0x92,67, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0,95, 0x83,
0,238, 0x90,127, 0,142, 0x91,67, 0x92,55, 0,47, 0x80, 0,47, 0x81, 0x82, 0,47, 0x90,127,
0,95, 0x80, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,127, 0,95, 0x80, 0,41, 0x90,125,
0,5, 0x91,72, 0x92,64, 0x93,55, 0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,190, 0x90,127, 0,95,
0x80, 0,47, 0x90,67, 0x91,60, 0x92,52, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,47, 0x83,
0x90,124, 0,184, 0x80, 0,101, 0x90,64, 0x91,55, 0x92,48, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83,
0,95, 0x90,127, 0,89, 0x91,125, 0,5, 0x80, 0,89, 0x81, 0,53, 0x90,69, 0x91,60, 0x92,53,
0,95, 0x80, 0x81, 0x82, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,71, 0x91,62, 0x92,55, 0,47,
0x93,127, 0,47, 0x80, 0x81, 0x82, 0,47, 0x83, 0x90,124, 0,142, 0x91,70, 0x92,61, 0x93,54, 0,41,
0x80, 0,53, 0x81, 0x82, 0x83, 0,47, 0x90,69, 0x91,60, 0x92,53, 0x93,127, 0,95, 0x80, 0x81, 0x82,
0x83, 0,95, 0x90,127, 0,89, 0x91,125, 0,5, 0x92,67, 0x93,60, 0x94,52, 0x80, 0,89, 0x81,
0,5, 0x82, 0x83, 0x84, 0,95, 0x90,76, 0x91,67, 0x92,60, 0,95, 0x80, 0x81, 0x82, 0x90,127, 0,95,
0x91,79, 0x92,71, 0x93,64, 0x80, 0,95, 0x81, 0x82, 0x83, 0x90,127, 0,95, 0x91,81, 0x92,72, 0x93,65,
0x80, 0x90,124, 0,95, 0x81, 0x82, 0x83, 0,89, 0x80, 0,101, 0x90,77, 0x91,69, 0x92,62, 0x93,127,
0,95, 0x80, 0x81, 0x82, 0x83, 0,47, 0x90,79, 0x91,71, 0x92,64, 0,47, 0x93,127, 0,47, 0x80,
0x81, 0x82, 0,41, 0x90,125, 0,5, 0x83, 0,89, 0x80, 0,53, 0x90,76, 0x91,69, 0x92,60, 0,95,
0x80, 0x81, 0x82, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,72, 0x91,64, 0x92,57, 0,47, 0x93,127,
0,47, 0x80, 0x81, 0x82, 0,47, 0x90,74, 0x91,65, 0x92,59, 0x83, 0x93,124, 0,95, 0x80, 0x81, 0x82,
0,47, 0x90,71, 0x91,62, 0x92,55, 0,41, 0x83, 0,53, 0x80, 0x81, 0x82, 0,47, 0x90,127, 0,95,
0x80, 0,95, 0x90,127, 0,89, 0x91,125, 0,5, 0x92,72, 0x93,64, 0x94,55, 0x80, 0,89, 0x81,
0,5, 0x82, 0x83, 0x84, 0,190, 0x90,127, 0,95, 0x80, 0,47, 0x90,67, 0x91,60, 0x92,52, 0,47,
0x93,127, 0,47, 0x80, 0x81, 0x82, 0,47, 0x83, 0x90,124, 0,184, 0x80, 0,101, 0x90,64, 0x91,55,
0x92,48, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,95, 0x90,127, 0,95, 0x80, 0x90,125, 0,89,
0x80, 0,53, 0x90,69, 0x91,60, 0x92,53, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,127, 0,95, 0x80,
0,47, 0x90,71, 0x91,62, 0x92,55, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,47, 0x83, 0x90,124,
0,142, 0x91,70, 0x92,61, 0x93,54, 0,41, 0x80, 0,53, 0x81, 0x82, 0x83, 0,47, 0x90,69, 0x91,60,
0x92,53, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,95, 0x90,127, 0,89, 0x91,125, 0,5, 0x92,67,
0x93,60, 0x94,52, 0x80, 0,89, 0x81, 0,5, 0x82, 0x83, 0x84, 0,95, 0x90,76, 0x91,67, 0x92,60,
0,95, 0x80, 0x81, 0x82, 0x90,127, 0,95, 0x91,79, 0x92,71, 0x93,64, 0x80, 0,95, 0x81, 0x82, 0x83,
0x90,127, 0,89, 0x91,124, 0,5, 0x92,81, 0x93,72, 0x94,65, 0x80, 0,95, 0x82, 0x83, 0x84, 0,89,
0x81, 0,101, 0x90,77, 0x91,69, 0x92,62, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,47, 0x90,79,
0x91,71, 0x92,64, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,41, 0x90,125, 0,5, 0x83, 0,89,
0x80, 0,53, 0x90,76, 0x91,69, 0x92,60, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,127, 0,95, 0x80,
0,47, 0x90,72, 0x91,64, 0x92,57, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,41, 0x90,124,
0,5, 0x91,74, 0x92,65, 0x94,59, 0x83, 0,95, 0x81, 0x82, 0x84, 0,47, 0x91,71, 0x92,62, 0x93,55,
0,41, 0x80, 0,53, 0x81, 0x82, 0x83, 0,47, 0x90,127, 0,95, 0x80, 0,95, 0x90,127, 0,89,
0x91,125, 0,5, 0x92,48, 0x80, 0,89, 0x81, 0,5, 0x82, 0,190, 0x90,79, 0x91,76, 0x92,127,
0,95, 0x80, 0x81, 0x82, 0,47, 0x90,78, 0x91,75, 0x92,55, 0,47, 0x93,127, 0,47, 0x80, 0x81,
0x82, 0,47, 0x90,77, 0x91,74, 0x83, 0x92,124, 0,95, 0x80, 0x81, 0,47, 0x90,75, 0x91,71, 0,41,
0x82, 0,53, 0x80, 0x81, 0,47, 0x90,60, 0x91,127, 0,95, 0x80, 0x81, 0,47, 0x90,76, 0x91,72,
0,47, 0x92,127, 0,47, 0x80, 0x81, 0,41, 0x90,125, 0,5, 0x91,53, 0x82, 0,89, 0x80, 0,5,
0x81, 0,47, 0x90,68, 0x91,64, 0,95, 0x80, 0x81, 0,47, 0x90,69, 0x91,65, 0x92,127, 0,95,
0x80, 0x81, 0x82, 0,47, 0x90,72, 0x91,67, 0x92,60, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,41,
0x90,124, 0,5, 0x91,60, 0x83, 0,95, 0x81, 0,47, 0x91,69, 0x92,60, 0,41, 0x80, 0,53,
0x81, 0x82, 0,47, 0x90,72, 0x91,64, 0x92,53, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,47, 0x90,74,
0x91,65, 0,47, 0x92,127, 0,47, 0x80, 0x81, 0,41, 0x90,125, 0,5, 0x91,48, 0x82, 0,89,
0x80, 0,5, 0x81, 0,190, 0x90,79, 0x91,76, 0x92,127, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,78,
0x91,75, 0x92,52, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,41, 0x90,124, 0,5, 0x91,77,
0x92,74, 0x83, 0,95, 0x81, 0x82, 0,47, 0x91,75, 0x92,71, 0,41, 0x80, 0,53, 0x81, 0x82, 0,47,
0x90,55, 0x91,127, 0,95, 0x80, 0x81, 0,47, 0x90,76, 0x91,72, 0x92,60, 0,47, 0x93,127, 0,47,
0x80, 0x81, 0x82, 0,41, 0x90,125, 0,5, 0x83, 0,89, 0x80, 0,53, 0x90,84, 0x91,77, 0x92,79,
0,95, 0x80, 0x81, 0x82, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,84, 0x91,77, 0x92,79, 0,47,
0x93,127, 0,47, 0x80, 0x81, 0x82, 0,41, 0x90,124, 0,5, 0x91,84, 0x92,77, 0x94,79, 0x83, 0,95,
0x81, 0x82, 0x84, 0,89, 0x80, 0,101, 0x90,55, 0x91,127, 0,95, 0x80, 0x81, 0,95, 0x90,127, 0,95,
0x91,48, 0x80, 0x90,125, 0,89, 0x80, 0,5, 0x81, 0,190, 0x90,79, 0x91,76, 0x92,127, 0,95,
0x80, 0x81, 0x82, 0,47, 0x90,78, 0x91,75, 0x92,55, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,41,
0x90,124, 0,5, 0x91,77, 0x92,74, 0x83, 0,95, 0x81, 0x82, 0,47, 0x91,75, 0x92,71, 0,41,
0x80, 0,53, 0x81, 0x82, 0,47, 0x90,60, 0x91,127, 0,95, 0x80, 0x81, 0,47, 0x90,76, 0x91,72,
0,47, 0x92,127, 0,47, 0x80, 0x81, 0,41, 0x90,125, 0,5, 0x91,53, 0x82, 0,89, 0x80, 0,5,
0x81, 0,47, 0x90,68, 0x91,64, 0,95, 0x80, 0x81, 0,47, 0x90,69, 0x91,65, 0x92,127, 0,95,
0x80, 0x81, 0x82, 0,47, 0x90,72, 0x91,67, 0x92,60, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,41,
0x90,124, 0,5, 0x91,60, 0x83, 0,95, 0x81, 0,47, 0x91,69, 0x92,60, 0,41, 0x80, 0,53,
0x81, 0x82, 0,47, 0x90,72, 0x91,64, 0x92,53, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,47, 0x90,74,
0x91,65, 0,47, 0x92,127, 0,47, 0x80, 0x81, 0,41, 0x90,125, 0,5, 0x91,48, 0x82, 0,89,
0x80, 0,5, 0x81, 0,190, 0x90,75, 0x91,68, 0x92,56, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,95,
0x90,127, 0,89, 0x91,124, 0,5, 0x80, 0,142, 0x90,74, 0x92,65, 0x93,58, 0,41, 0x81, 0,53,
0x80, 0x82, 0x83, 0,47, 0x90,127, 0,95, 0x80, 0,95, 0x90,127, 0,89, 0x91,125, 0,5, 0x92,72,
0x93,64, 0x94,60, 0x80, 0,89, 0x81, 0,5, 0x82, 0x83, 0x84, 0,190, 0x90,127, 0,95, 0x80, 0,47,
0x90,55, 0,47, 0x91,127, 0,47, 0x80, 0,47, 0x90,55, 0x81, 0x91,124, 0,95, 0x80, 0,89,
0x81, 0,101, 0x90,48, 0x91,127, 0,95, 0x80, 0x81, 0,95, 0x90,127, 0,89, 0x91,125, 0,5,
0x92,48, 0x80, 0,89, 0x81, 0,5, 0x82, 0,190, 0x90,79, 0x91,76, 0x92,127, 0,95, 0x80, 0x81,
0x82, 0,47, 0x90,78, 0x91,75, 0x92,55, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,47, 0x90,77,
0x91,74, 0x83, 0x92,124, 0,95, 0x80, 0x81, 0,47, 0x90,75, 0x91,71, 0,41, 0x82, 0,53, 0x80,
0x81, 0,47, 0x90,60, 0x91,127, 0,95, 0x80, 0x81, 0,47, 0x90,76, 0x91,72, 0,47, 0x92,127,
0,47, 0x80, 0x81, 0,41, 0x90,125, 0,5, 0x91,53, 0x82, 0,89, 0x80, 0,5, 0x81, 0,47,
0x90,68, 0x91,64, 0,95, 0x80, 0x81, 0,47, 0x90,69, 0x91,65, 0x92,127, 0,95, 0x80, 0x81, 0x82,
0,47, 0x90,72, 0x91,67, 0x92,60, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,47, 0x90,60,
0x83, 0x91,124, 0,95, 0x80, 0,47, 0x90,69, 0x92,60, 0,41, 0x81, 0,53, 0x80, 0x82, 0,47,
0x90,72, 0x91,64, 0x92,53, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,47, 0x90,74, 0x91,65, 0,47,
0x92,127, 0,47, 0x80, 0x81, 0,41, 0x90,125, 0,5, 0x91,48, 0x82, 0,89, 0x80, 0,5, 0x81,
0,190, 0x90,79, 0x91,76, 0x92,127, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,78, 0x91,75, 0x92,52,
0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,47, 0x90,77, 0x91,74, 0x83, 0x92,124, 0,95, 0x80,
0x81, 0,47, 0x90,75, 0x91,71, 0,41, 0x82, 0,53, 0x80, 0x81, 0,47, 0x90,55, 0x91,127, 0,95,
0x80, 0x81, 0,47, 0x90,76, 0x91,72, 0x92,60, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,47,
0x83, 0x90,125, 0,89, 0x80, 0,53, 0x90,84, 0x91,77, 0x92,79, 0,95, 0x80, 0x81, 0x82, 0,47,
0x90,127, 0,95, 0x80, 0,47, 0x90,84, 0x91,77, 0x92,79, 0,47, 0x93,127, 0,47, 0x80, 0x81,
0x82, 0,47, 0x90,84, 0x91,77, 0x92,79, 0x83, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,89, 0x83, 0,101,
0x90,55, 0x91,127, 0,95, 0x80, 0x81, 0,95, 0x90,127, 0,89, 0x91,125, 0,5, 0x92,48, 0x80,
0,89, 0x81, 0,5, 0x82, 0,190, 0x90,79, 0x91,76, 0x92,127, 0,95, 0x80, 0x81, 0x82, 0,47,
0x90,78, 0x91,75, 0x92,55, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,47, 0x90,77, 0x91,74,
0x83, 0x92,124, 0,95, 0x80, 0x81, 0,47, 0x90,75, 0x91,71, 0,41, 0x82, 0,53, 0x80, 0x81, 0,47,
0x90,60, 0x91,127, 0,95, 0x80, 0x81, 0,47, 0x90,76, 0x91,72, 0,47, 0x92,127, 0,47, 0x80,
0x81, 0,41, 0x90,125, 0,5, 0x91,53, 0x82, 0,89, 0x80, 0,5, 0x81, 0,47, 0x90,68, 0x91,64,
0,95, 0x80, 0x81, 0,47, 0x90,69, 0x91,65, 0x92,127, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,72,
0x91,67, 0x92,60, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,47, 0x90,60, 0x83, 0x91,124, 0,95,
0x80, 0,47, 0x90,69, 0x92,60, 0,41, 0x81, 0,53, 0x80, 0x82, 0,47, 0x90,72, 0x91,64, 0x92,53,
0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,47, 0x90,74, 0x91,65, 0,47, 0x92,127, 0,47, 0x80,
0x81, 0,41, 0x90,125, 0,5, 0x91,48, 0x82, 0,89, 0x80, 0,5, 0x81, 0,190, 0x90,75, 0x91,68,
0x92,56, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,95, 0x90,127, 0,95, 0x80, 0x90,124, 0,142,
0x91,74, 0x92,65, 0x93,58, 0,41, 0x80, 0,53, 0x81, 0x82, 0x83, 0,47, 0x90,127, 0,95, 0x80,
0,95, 0x90,127, 0,89, 0x91,125, 0,5, 0x92,72, 0x93,64, 0x94,60, 0x80, 0,89, 0x81, 0,5,
0x82, 0x83, 0x84, 0,190, 0x90,127, 0,95, 0x80, 0,47, 0x90,55, 0,47, 0x91,127, 0,47, 0x80,
0,47, 0x90,55, 0x81, 0x91,124, 0,95, 0x80, 0,89, 0x81, 0,101, 0x90,48, 0x91,127, 0,95,
0x80, 0x81, 0,95, 0x90,127, 0,95, 0x91,72, 0x92,68, 0x93,44, 0x80, 0x90,124, 0,95, 0x81, 0x82,
0x83, 0,47, 0x91,72, 0x92,68, 0,95, 0x81, 0x82, 0,17, 0x80, 0,29, 0x90,127, 0,95, 0x80,
0,47, 0x90,72, 0x91,68, 0x92,51, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,77, 0x83, 0,113, 0x90,72,
0x91,68, 0x92,127, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,74, 0x91,70, 0x92,56, 0x93,124, 0,95,
0x80, 0x81, 0x82, 0,53, 0x83, 0,136, 0x90,76, 0x91,67, 0x92,55, 0x93,124, 0,95, 0x80, 0x81, 0x82,
0,47, 0x90,72, 0x91,64, 0,29, 0x83, 0,65, 0x80, 0x81, 0,190, 0x90,69, 0x91,64, 0x92,48,
0,5, 0x93,124, 0,89, 0x80, 0x81, 0x82, 0,47, 0x90,67, 0x91,60, 0,29, 0x83, 0,65, 0x80,
0x81, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,43, 0x91,127, 0,95, 0x80, 0x81, 0,47, 0x90,127,
0,95, 0x80, 0,47, 0x90,72, 0x91,68, 0x92,44, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,72,
0x91,68, 0,95, 0x80, 0x81, 0,23, 0x83, 0,23, 0x90,127, 0,95, 0x80, 0,47, 0x90,72, 0x91,68,
0x92,51, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,71, 0x83, 0,119, 0x90,72, 0x91,68, 0x92,127, 0,95,
0x80, 0x81, 0x82, 0,47, 0x90,74, 0x91,70, 0x92,56, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,76,
0x91,67, 0,11, 0x83, 0,83, 0x80, 0x81, 0,47, 0x90,55, 0x91,124, 0,95, 0x80, 0,71, 0x81,
1,5, 0x90,48, 0x91,124, 0,95, 0x80, 0,83, 0x81, 0,107, 0x90,127, 0,95, 0x80, 0,47,
0x90,43, 0x91,127, 0,95, 0x80, 0x81, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,72, 0x91,68,
0x92,44, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,72, 0x91,68, 0,95, 0x80, 0x81, 0,23,
0x83, 0,23, 0x90,127, 0,95, 0x80, 0,47, 0x90,72, 0x91,68, 0x92,51, 0x93,124, 0,95, 0x80,
0x81, 0x82, 0,71, 0x83, 0,119, 0x90,72, 0x91,68, 0x92,127, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,74,
0x91,70, 0x92,56, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,59, 0x83, 0,130, 0x90,76, 0x91,67, 0x92,55,
0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,72, 0x91,64, 0,23, 0x83, 0,71, 0x80, 0x81, 0,190,
0x90,69, 0x91,64, 0x92,48, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,67, 0x91,60, 0,35,
0x83, 0,59, 0x80, 0x81, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,43, 0x91,127, 0,95, 0x80,
0x81, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,76, 0x91,66, 0x92,50, 0x93,124, 0,95, 0x80,
0x81, 0x82, 0,47, 0x90,76, 0x91,66, 0x92,50, 0,95, 0x80, 0x81, 0x82, 0,23, 0x83, 0,23, 0x90,127,
0,95, 0x80, 0,47, 0x90,76, 0x91,66, 0x92,50, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,71, 0x83,
0,119, 0x90,72, 0x91,66, 0x92,50, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,47, 0x90,76, 0x91,66,
0x92,50, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,59, 0x83, 0,130, 0x90,79, 0x91,71, 0x92,67, 0x93,124,
0,95, 0x80, 0x81, 0x82, 0,71, 0x83, 1,5, 0x90,124, 0,142, 0x91,67, 0x92,55, 0,35, 0x80,
0,59, 0x81, 0x82, 0,35, 0x90,127, 0,95, 0x80, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,127,
0,95, 0x80, 0,53, 0x90,125, 0,5, 0x91,72, 0x92,64, 0x93,55, 0,89, 0x80, 0,5, 0x81,
0x82, 0x83, 0,190, 0x90,127, 0,95, 0x80, 0,47, 0x90,67, 0x91,60, 0x92,52, 0,47, 0x93,127,
0,47, 0x80, 0x81, 0x82, 0,47, 0x83, 0x90,124, 0,184, 0x80, 0,101, 0x90,64, 0x91,55, 0x92,48,
0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,95, 0x90,127, 0,95, 0x80, 0x90,125, 0,89, 0x80, 0,53,
0x90,69, 0x91,60, 0x92,53, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,71,
0x91,62, 0x92,55, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,47, 0x83, 0x90,124, 0,142, 0x91,70,
0x92,61, 0x93,54, 0,41, 0x80, 0,53, 0x81, 0x82, 0x83, 0,47, 0x90,69, 0x91,60, 0x92,53, 0x93,127,
0,95, 0x80, 0x81, 0x82, 0x83, 0,95, 0x90,127, 0,89, 0x91,125, 0,5, 0x92,67, 0x93,60, 0x94,52,
0x80, 0,89, 0x81, 0,5, 0x82, 0x83, 0x84, 0,95, 0x90,76, 0x91,67, 0x92,60, 0,95, 0x80, 0x81,
0x82, 0x90,127, 0,95, 0x91,79, 0x92,71, 0x93,64, 0x80, 0,95, 0x81, 0x82, 0x83, 0x90,127, 0,95,
0x91,81, 0x92,72, 0x93,65, 0x80, 0x90,124, 0,95, 0x81, 0x82, 0x83, 0,89, 0x80, 0,101, 0x90,77,
0x91,69, 0x92,62, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,47, 0x90,79, 0x91,71, 0x92,64, 0,47,
0x93,127, 0,47, 0x80, 0x81, 0x82, 0,41, 0x90,125, 0,5, 0x83, 0,89, 0x80, 0,53, 0x90,76,
0x91,69, 0x92,60, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,72, 0x91,64,
0x92,57, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,41, 0x90,124, 0,5, 0x91,74, 0x92,65,
0x94,59, 0x83, 0,95, 0x81, 0x82, 0x84, 0,47, 0x91,71, 0x92,62, 0x93,55, 0,41, 0x80, 0,53,
0x81, 0x82, 0x83, 0,47, 0x90,127, 0,95, 0x80, 0,95, 0x90,127, 0,89, 0x91,125, 0,5, 0x92,72,
0x93,64, 0x94,55, 0x80, 0,89, 0x81, 0,5, 0x82, 0x83, 0x84, 0,190, 0x90,127, 0,95, 0x80, 0,47,
0x90,67, 0x91,60, 0x92,52, 0,47, 0x93,127, 0,47, 0x80, 0x81, 0x82, 0,47, 0x83, 0x90,124, 0,184,
0x80, 0,101, 0x90,64, 0x91,55, 0x92,48, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,95, 0x90,127,
0,89, 0x91,125, 0,5, 0x80, 0,89, 0x81, 0,53, 0x90,69, 0x91,60, 0x92,53, 0,95, 0x80,
0x81, 0x82, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,71, 0x91,62, 0x92,55, 0,47, 0x93,127,
0,47, 0x80, 0x81, 0x82, 0,41, 0x90,124, 0,5, 0x83, 0,142, 0x91,70, 0x92,61, 0x93,54, 0,41,
0x80, 0,53, 0x81, 0x82, 0x83, 0,47, 0x90,69, 0x91,60, 0x92,53, 0x93,127, 0,95, 0x80, 0x81, 0x82,
0x83, 0,95, 0x90,127, 0,89, 0x91,125, 0,5, 0x92,67, 0x93,60, 0x94,52, 0x80, 0,89, 0x81,
0,5, 0x82, 0x83, 0x84, 0,95, 0x90,76, 0x91,67, 0x92,60, 0,95, 0x80, 0x81, 0x82, 0x90,127, 0,95,
0x91,79, 0x92,71, 0x93,64, 0x80, 0,95, 0x81, 0x82, 0x83, 0x90,127, 0,89, 0x91,124, 0,5, 0x92,81,
0x93,72, 0x94,65, 0x80, 0,95, 0x82, 0x83, 0x84, 0,89, 0x81, 0,101, 0x90,77, 0x91,69, 0x92,62,
0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,47, 0x90,79, 0x91,71, 0x92,64, 0,47, 0x93,127, 0,47,
0x80, 0x81, 0x82, 0,41, 0x90,125, 0,5, 0x83, 0,89, 0x80, 0,53, 0x90,76, 0x91,69, 0x92,60,
0,95, 0x80, 0x81, 0x82, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,72, 0x91,64, 0x92,57, 0,47,
0x93,127, 0,47, 0x80, 0x81, 0x82, 0,41, 0x90,124, 0,5, 0x91,74, 0x92,65, 0x94,59, 0x83, 0,95,
0x81, 0x82, 0x84, 0,47, 0x91,71, 0x92,62, 0x93,55, 0,41, 0x80, 0,53, 0x81, 0x82, 0x83, 0,47,
0x90,127, 0,95, 0x80, 0,95, 0x90,127, 0,95, 0x91,76, 0x92,72, 0x93,48, 0x80, 0x90,125, 0,89,
0x80, 0,5, 0x81, 0x82, 0x83, 0,47, 0x90,72, 0x91,69, 0,95, 0x80, 0x81, 0,190, 0x90,67, 0x91,64,
0x92,54, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,41, 0x90,124, 0,5, 0x91,55, 0,95, 0x81,
0,89, 0x80, 0,101, 0x90,68, 0x91,64, 0x92,60, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,184,
0x90,125, 0,5, 0x91,69, 0x92,65, 0x93,53, 0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,47, 0x90,77,
0x91,72, 0,95, 0x80, 0x81, 0,47, 0x90,53, 0,95, 0x80, 0,47, 0x90,77, 0x91,72, 0x92,127,
0,95, 0x80, 0x81, 0x82, 0,41, 0x90,124, 0,5, 0x91,69, 0x92,65, 0x93,60, 0,95, 0x81, 0x82,
0x83, 0,47, 0x91,60, 0,41, 0x80, 0,53, 0x81, 0,47, 0x90,53, 0x91,127, 0,95, 0x80, 0x81,
0,184, 0x90,125, 0,5, 0x91,71, 0x92,67, 0x93,50, 0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,95,
0x90,81, 0x91,77, 0,95, 0x80, 0x81, 0,95, 0x90,81, 0x91,77, 0,47, 0x92,53, 0x93,127, 0,47,
0x80, 0x81, 0,47, 0x82, 0x83, 0,41, 0x90,124, 0,5, 0x91,81, 0x92,77, 0x93,55, 0,95, 0x81,
0x82, 0x83, 0,89, 0x80, 0,5, 0x90,79, 0x91,76, 0,95, 0x80, 0x81, 0x90,59, 0x91,127, 0,95,
0x92,77, 0x93,74, 0x80, 0x81, 0,95, 0x82, 0x83, 0,89, 0x90,125, 0,5, 0x91,76, 0x92,72, 0x93,55,
0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,47, 0x90,72, 0x91,69, 0,95, 0x80, 0x81, 0,47, 0x90,55,
0,95, 0x80, 0,47, 0x90,69, 0x91,65, 0x92,127, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,67, 0x91,64,
0x92,60, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,60, 0,41, 0x83, 0,53, 0x80, 0,47,
0x90,55, 0x91,127, 0,95, 0x80, 0x81, 0,184, 0x90,125, 0,5, 0x91,76, 0x92,72, 0x93,48, 0,89,
0x80, 0,5, 0x81, 0x82, 0x83, 0,47, 0x90,72, 0x91,69, 0,95, 0x80, 0x81, 0,190, 0x90,67, 0x91,64,
0x92,54, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,41, 0x90,124, 0,5, 0x91,55, 0,95, 0x81,
0,89, 0x80, 0,101, 0x90,68, 0x91,64, 0x92,60, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,184,
0x90,125, 0,5, 0x91,69, 0x92,65, 0x93,53, 0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,47, 0x90,77,
0x91,72, 0,95, 0x80, 0x81, 0,47, 0x90,53, 0,95, 0x80, 0,47, 0x90,77, 0x91,72, 0x92,127,
0,95, 0x80, 0x81, 0x82, 0,41, 0x90,124, 0,5, 0x91,69, 0x92,65, 0x93,60, 0,95, 0x81, 0x82,
0x83, 0,47, 0x91,60, 0,41, 0x80, 0,53, 0x81, 0,47, 0x90,53, 0x91,127, 0,95, 0x80, 0x81,
0,184, 0x90,125, 0,5, 0x91,71, 0x92,67, 0x93,55, 0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,47,
0x90,77, 0x91,74, 0x92,55, 0,95, 0x80, 0x81, 0x82, 0,190, 0x90,77, 0x91,74, 0x92,55, 0x93,127,
0,95, 0x80, 0x81, 0x82, 0x83, 0,41, 0x90,124, 0,5, 0x91,77, 0x92,74, 0x93,55, 0,95, 0x81,
0x82, 0x83, 0,89, 0x80, 0,5, 0x90,76, 0x91,72, 0x92,57, 0,95, 0x80, 0x81, 0x82, 0x90,127, 0,95,
0x91,74, 0x92,71, 0x93,59, 0x80, 0,95, 0x81, 0x82, 0x83, 0,95, 0x90,72, 0x91,67, 0x92,60, 0x93,125,
0,89, 0x83, 0,5, 0x80, 0x81, 0x82, 0,47, 0x90,64, 0,95, 0x80, 0,47, 0x90,55, 0,95,
0x80, 0,47, 0x90,64, 0x91,127, 0,95, 0x80, 0x81, 0,41, 0x90,124, 0,5, 0x91,60, 0x92,48,
0,95, 0x81, 0x82, 0,89, 0x80, 0,101, 0x90,127, 0,95, 0x80, 0,184, 0x90,125, 0,5, 0x91,76,
0x92,72, 0x93,48, 0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,47, 0x90,72, 0x91,69, 0,95, 0x80,
0x81, 0,190, 0x90,67, 0x91,64, 0x92,54, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,41, 0x90,124,
0,5, 0x91,55, 0,95, 0x81, 0,89, 0x80, 0,101, 0x90,68, 0x91,64, 0x92,60, 0x93,127, 0,95,
0x80, 0x81, 0x82, 0x83, 0,184, 0x90,125, 0,5, 0x91,69, 0x92,65, 0x93,53, 0,89, 0x80, 0,5,
0x81, 0x82, 0x83, 0,47, 0x90,77, 0x91,72, 0,95, 0x80, 0x81, 0,47, 0x90,53, 0,95, 0x80, 0,47,
0x90,77, 0x91,72, 0x92,127, 0,95, 0x80, 0x81, 0x82, 0,41, 0x90,124, 0,5, 0x91,69, 0x92,65,
0x93,60, 0,95, 0x81, 0x82, 0x83, 0,47, 0x91,60, 0,41, 0x80, 0,53, 0x81, 0,47, 0x90,53,
0x91,127, 0,95, 0x80, 0x81, 0,184, 0x90,125, 0,5, 0x91,71, 0x92,67, 0x93,50, 0,89, 0x80,
0,5, 0x81, 0x82, 0x83, 0,95, 0x90,81, 0x91,77, 0,95, 0x80, 0x81, 0,95, 0x90,81, 0x91,77,
0,47, 0x92,53, 0x93,127, 0,47, 0x80, 0x81, 0,47, 0x82, 0x83, 0,47, 0x90,81, 0x91,77, 0x92,55,
0x93,124, 0,95, 0x80, 0x81, 0x82, 0,89, 0x83, 0,5, 0x90,79, 0x91,76, 0,95, 0x80, 0x81, 0x90,59,
0x91,127, 0,95, 0x92,77, 0x93,74, 0x80, 0x81, 0,95, 0x82, 0x83, 0,89, 0x90,125, 0,5, 0x91,76,
0x92,72, 0x93,55, 0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,47, 0x90,72, 0x91,69, 0,95, 0x80,
0x81, 0,47, 0x90,55, 0,95, 0x80, 0,47, 0x90,69, 0x91,65, 0x92,127, 0,95, 0x80, 0x81, 0x82,
0,41, 0x90,124, 0,5, 0x91,67, 0x92,64, 0x93,60, 0,95, 0x81, 0x82, 0x83, 0,47, 0x91,60,
0,41, 0x80, 0,53, 0x81, 0,47, 0x90,55, 0x91,127, 0,95, 0x80, 0x81, 0,184, 0x90,125, 0,5,
0x91,76, 0x92,72, 0x93,48, 0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,47, 0x90,72, 0x91,69, 0,95,
0x80, 0x81, 0,190, 0x90,67, 0x91,64, 0x92,54, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,47, 0x90,55,
0x91,124, 0,95, 0x80, 0,89, 0x81, 0,101, 0x90,68, 0x91,64, 0x92,60, 0x93,127, 0,95, 0x80,
0x81, 0x82, 0x83, 0,184, 0x90,125, 0,5, 0x91,69, 0x92,65, 0x93,53, 0,89, 0x80, 0,5, 0x81,
0x82, 0x83, 0,47, 0x90,77, 0x91,72, 0,95, 0x80, 0x81, 0,47, 0x90,53, 0,95, 0x80, 0,47,
0x90,77, 0x91,72, 0x92,127, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,69, 0x91,65, 0x92,60, 0x93,124,
0,95, 0x80, 0x81, 0x82, 0,47, 0x90,60, 0,41, 0x83, 0,53, 0x80, 0,47, 0x90,53, 0x91,127,
0,95, 0x80, 0x81, 0,190, 0x90,71, 0x91,67, 0x92,55, 0x93,125, 0,89, 0x83, 0,5, 0x80, 0x81,
0x82, 0,47, 0x90,77, 0x91,74, 0x92,55, 0,95, 0x80, 0x81, 0x82, 0,190, 0x90,77, 0x91,74, 0x92,55,
0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,47, 0x90,77, 0x91,74, 0x92,55, 0x93,124, 0,95, 0x80,
0x81, 0x82, 0,89, 0x83, 0,5, 0x90,76, 0x91,72, 0x92,57, 0,95, 0x80, 0x81, 0x82, 0x90,127, 0,95,
0x91,74, 0x92,71, 0x93,59, 0x80, 0,95, 0x81, 0x82, 0x83, 0,89, 0x90,125, 0,5, 0x91,72, 0x92,67,
0x93,60, 0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,47, 0x90,64, 0,95, 0x80, 0,47, 0x90,55,
0,95, 0x80, 0,47, 0x90,64, 0x91,127, 0,95, 0x80, 0x81, 0,47, 0x90,60, 0x91,48, 0x92,124,
0,95, 0x80, 0x81, 0,89, 0x82, 0,101, 0x90,127, 0,95, 0x80, 0,190, 0x90,72, 0x91,68, 0x92,44,
0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,72, 0x91,68, 0,95, 0x80, 0x81, 0,23, 0x83, 0,23,
0x90,127, 0,95, 0x80, 0,47, 0x90,72, 0x91,68, 0x92,51, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,71,
0x83, 0,119, 0x90,72, 0x91,68, 0x92,127, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,74, 0x91,70, 0x92,56,
0x93,124, 0,95, 0x80, 0x81, 0x82, 0,59, 0x83, 0,130, 0x90,76, 0x91,67, 0x92,55, 0x93,124, 0,95,
0x80, 0x81, 0x82, 0,47, 0x90,72, 0x91,64, 0,23, 0x83, 0,71, 0x80, 0x81, 0,190, 0x90,69, 0x91,64,
0x92,48, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,67, 0x91,60, 0,29, 0x83, 0,65, 0x80,
0x81, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,43, 0x91,127, 0,95, 0x80, 0x81, 0,47, 0x90,127,
0,95, 0x80, 0,47, 0x90,72, 0x91,68, 0x92,44, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,72,
0x91,68, 0,95, 0x80, 0x81, 0,17, 0x83, 0,29, 0x90,127, 0,95, 0x80, 0,41, 0x90,124, 0,5,
0x91,72, 0x92,68, 0x93,51, 0,95, 0x81, 0x82, 0x83, 0,65, 0x80, 0,124, 0x90,72, 0x91,68, 0x92,127,
0,95, 0x80, 0x81, 0x82, 0,41, 0x90,124, 0,5, 0x91,74, 0x92,70, 0x93,56, 0,95, 0x81, 0x82,
0x83, 0,47, 0x91,76, 0x92,67, 0,5, 0x80, 0,89, 0x81, 0x82, 0,47, 0x90,55, 0x91,124, 0,95,
0x80, 0,65, 0x81, 1,5, 0x90,124, 0,5, 0x91,48, 0,95, 0x81, 0,71, 0x80, 0,119, 0x90,127,
0,95, 0x80, 0,47, 0x90,43, 0x91,127, 0,95, 0x80, 0x81, 0,47, 0x90,127, 0,95, 0x80, 0,47,
0x90,72, 0x91,68, 0x92,44, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,72, 0x91,68, 0,95,
0x80, 0x81, 0,11, 0x83, 0,35, 0x90,127, 0,95, 0x80, 0,35, 0x90,124, 0,11, 0x91,72, 0x92,68,
0x93,51, 0,95, 0x81, 0x82, 0x83, 0,59, 0x80, 0,130, 0x90,72, 0x91,68, 0x92,127, 0,95, 0x80,
0x81, 0x82, 0,35, 0x90,124, 0,11, 0x91,74, 0x92,70, 0x93,56, 0,95, 0x81, 0x82, 0x83, 0,47,
0x80, 0,142, 0x90,76, 0x91,67, 0x92,55, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,72, 0x91,64,
0,11, 0x83, 0,83, 0x80, 0x81, 0,178, 0x90,124, 0,11, 0x91,69, 0x92,64, 0x93,48, 0,95,
0x81, 0x82, 0x83, 0,47, 0x91,67, 0x92,60, 0,17, 0x80, 0,77, 0x81, 0x82, 0,47, 0x90,127, 0,95,
0x80, 0,47, 0x90,43, 0x91,127, 0,95, 0x80, 0x81, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,76,
0x91,66, 0x92,50, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,76, 0x91,66, 0x92,50, 0,95,
0x80, 0x81, 0x82, 0,11, 0x83, 0,35, 0x90,127, 0,95, 0x80, 0,23, 0x90,124, 0,23, 0x91,76,
0x92,66, 0x93,50, 0,95, 0x81, 0x82, 0x83, 0,47, 0x80, 0,142, 0x90,72, 0x91,66, 0x92,50, 0x93,127,
0,95, 0x80, 0x81, 0x82, 0x83, 0,23, 0x90,124, 0,23, 0x91,76, 0x92,66, 0x93,50, 0,95, 0x81,
0x82, 0x83, 0,47, 0x80, 0,130, 0x90,124, 0,11, 0x91,79, 0x92,71, 0x93,67, 0,95, 0x81, 0x82,
0x83, 0,47, 0x80, 1,5, 0x90,124, 0,166, 0x91,67, 0x92,55, 0,29, 0x80, 0,65, 0x81, 0x82,
0,47, 0x90,127, 0,83, 0x80, 0,47, 0x90,127, 0,95, 0x80, 0,47, 0x90,127, 0,101, 0x80,
0,47, 0x90,125, 0,5, 0x91,76, 0x92,72, 0x93,48, 0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,47,
0x90,72, 0x91,69, 0,95, 0x80, 0x81, 0,190, 0x90,67, 0x91,64, 0x92,54, 0x93,127, 0,95, 0x80,
0x81, 0x82, 0x83, 0,47, 0x90,55, 0x91,124, 0,95, 0x80, 0,89, 0x81, 0,101, 0x90,68, 0x91,64,
0x92,60, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,184, 0x90,125, 0,5, 0x91,69, 0x92,65, 0x93,53,
0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,47, 0x90,77, 0x91,72, 0,95, 0x80, 0x81, 0,47, 0x90,53,
0,95, 0x80, 0,47, 0x90,77, 0x91,72, 0x92,127, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,69, 0x91,65,
0x92,60, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,60, 0,41, 0x83, 0,53, 0x80, 0,47,
0x90,53, 0x91,127, 0,95, 0x80, 0x81, 0,184, 0x90,125, 0,5, 0x91,71, 0x92,67, 0x93,50, 0,89,
0x80, 0,5, 0x81, 0x82, 0x83, 0,95, 0x90,81, 0x91,77, 0,95, 0x80, 0x81, 0,95, 0x90,81, 0x91,77,
0,47, 0x92,53, 0x93,127, 0,47, 0x80, 0x81, 0,47, 0x82, 0x83, 0,47, 0x90,81, 0x91,77, 0x92,55,
0x93,124, 0,95, 0x80, 0x81, 0x82, 0,89, 0x83, 0,5, 0x90,79, 0x91,76, 0,95, 0x80, 0x81, 0x90,59,
0x91,127, 0,95, 0x92,77, 0x93,74, 0x80, 0x81, 0,95, 0x82, 0x83, 0,89, 0x90,125, 0,5, 0x91,76,
0x92,72, 0x93,55, 0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,47, 0x90,72, 0x91,69, 0,95, 0x80,
0x81, 0,47, 0x90,55, 0,95, 0x80, 0,47, 0x90,69, 0x91,65, 0x92,127, 0,95, 0x80, 0x81, 0x82,
0,47, 0x90,67, 0x91,64, 0x92,60, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,60, 0,41,
0x83, 0,53, 0x80, 0,47, 0x90,55, 0x91,127, 0,95, 0x80, 0x81, 0,190, 0x90,76, 0x91,72, 0x92,48,
0x93,125, 0,89, 0x83, 0,5, 0x80, 0x81, 0x82, 0,47, 0x90,72, 0x91,69, 0,95, 0x80, 0x81, 0,190,
0x90,67, 0x91,64, 0x92,54, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,47, 0x90,55, 0x91,124, 0,95,
0x80, 0,89, 0x81, 0,101, 0x90,68, 0x91,64, 0x92,60, 0x93,127, 0,95, 0x80, 0x81, 0x82, 0x83, 0,184,
0x90,125, 0,5, 0x91,69, 0x92,65, 0x93,53, 0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,47, 0x90,77,
0x91,72, 0,95, 0x80, 0x81, 0,47, 0x90,53, 0,95, 0x80, 0,47, 0x90,77, 0x91,72, 0x92,127,
0,95, 0x80, 0x81, 0x82, 0,47, 0x90,69, 0x91,65, 0x92,60, 0x93,124, 0,95, 0x80, 0x81, 0x82, 0,47,
0x90,60, 0,41, 0x83, 0,53, 0x80, 0,47, 0x90,53, 0x91,127, 0,95, 0x80, 0x81, 0,184, 0x90,125,
0,5, 0x91,71, 0x92,67, 0x93,55, 0x94,124, 0,89, 0x80, 0,5, 0x81, 0x82, 0x83, 0,47, 0x90,77,
0x91,74, 0x92,55, 0,29, 0x84, 0,65, 0x80, 0x81, 0x82, 0,190, 0x90,77, 0x91,74, 0x92,55, 0,95,
0x80, 0x81, 0x82, 0,47, 0x90,77, 0x91,74, 0x92,55, 0,95, 0x80, 0x81, 0x82, 0,95, 0x90,76, 0x91,72,
0x92,57, 0,95, 0x80, 0x81, 0x82, 0,95, 0x90,74, 0x91,71, 0x92,59, 0,95, 0x80, 0x81, 0x82, 0,95,
0x90,72, 0x91,67, 0x92,60, 0,95, 0x80, 0x81, 0x82, 0,47, 0x90,64, 0,95, 0x80, 0,47, 0x90,55,
0,95, 0x80, 0,47, 0x90,64, 0,95, 0x80, 0,47, 0x90,60, 0x91,48, 0,95, 0x80, 0x81, 0xf0
};
unsigned int index = sizeof(score);
void setup() {
songPlay();
songWait();
}
void songWait() {
while (songPlaying) {
delay(1);
}
}
void songStop() {
songPlaying = false;
index = sizeof(score);
for (byte i = 0; i < 6; i++) {
voiceEnabled[i] = 0;
voiceType[i] = 0;
start[i] = 0;
states[i] = 0;
periods[i] = 0;
nextFlip[i] = 0;
}
}
void songPlay() {
index = 0;
songPlaying = true;
for (byte i = 0; i < 6; i++) {
byte p = pgm_read_byte (voicePins + i);
pinMode(p, INPUT_PULLUP);
}
// TIMER 0 for interrupt frequency 1000 Hz:
cli(); // stop interrupts
TCCR0A = 0; // set entire TCCR0A register to 0
TCCR0B = 0; // same for TCCR0B
TCNT0 = 0; // initialize counter value to 0
// set compare match register for 1000 Hz increments
OCR0A = 249; // = 16000000 / (64 * 1000) - 1 (must be <256)
// turn on CTC mode
TCCR0B |= (1 << WGM01);
// Set CS02, CS01 and CS00 bits for 64 prescaler
TCCR0B |= (0 << CS02) | (1 << CS01) | (1 << CS00);
// enable timer compare interrupt
TIMSK0 |= (1 << OCIE0A);
sei(); // allow interrupts
// TIMER 1 for interrupt frequency 22050 Hz:
cli(); // stop interrupts
TCCR1A = 0; // set entire TCCR1A register to 0
TCCR1B = 0; // same for TCCR1B
TCNT1 = 0; // initialize counter value to 0
// set compare match register for 25000 Hz increments
OCR1A = 750; // = 16000000 / (1 * 22050) - 1 (must be <65536)
// turn on CTC mode
TCCR1B |= (1 << WGM12);
// Set CS12, CS11 and CS10 bits for 1 prescaler
TCCR1B |= (0 << CS12) | (0 << CS11) | (1 << CS10);
// enable timer compare interrupt
TIMSK1 |= (1 << OCIE1A);
sei(); // allow interrupts
}
byte rng() {
static unsigned int y = 0;
y += t; // seeded with changing number
y ^= y >> 7;
y ^= y << 7;
return (y);
}
void startVoice(byte voice, unsigned int frequency) {
byte p = pgm_read_byte (voicePins + voice);
pinMode(p, OUTPUT);
if (frequency < 27) { // off piano, must be percussion
voiceType[voice] = 1 + frequency;
Serial.println(voiceType[voice]);
voiceEnabled[voice] = 1;
periods[voice] = 1;
start[voice] = t;
}
else {
periods[voice] = 1000000 / frequency / 2;
nextFlip[voice] = t + periods[voice];
voiceEnabled[voice] = 1;
voiceType[voice] = 0;
}
}
ISR(TIMER0_COMPA_vect) {
if (t >= nextCommandTime) {
if (index < sizeof(score)) {
byte command = pgm_read_byte (score + index);
byte type = bitRead(command, 7);
byte val1 = 0;
for (byte i = 0; i < 4; i++) {
bitWrite(val1, i, bitRead(command, i + 4));
}
byte val2 = 0;
for (byte i = 0; i < 4; i++) {
bitWrite(val2, i, bitRead(command, i));
}
type = bitRead(command, 7);
if (type == 1) {
if (val1 == 0x9) {
byte note = pgm_read_byte (score + index + 1);
byte voice = val2;
unsigned int freq = 0;
if (note > 108) { // IF HIGHER THAN PIANO RANGE, USE PERCUSSION
freq = 127 - note; // FREQUENCY NOW DECIDES PERCUSSION TYPE
}
else { // If we're in piano range, produce the corresponding frequency
freq = pgm_read_word(frequencies + note - 20);
}
startVoice(voice, freq);
index += 2;
}
if (val1 == 0x8) {
byte voice = val2;
voiceEnabled[voice] = 0;
byte p = pgm_read_byte (voicePins + voice);
pinMode(p, INPUT_PULLUP);
index += 1;
}
if (val1 == 0xF) {
songStop();
}
if (val1 == 0xE) {
index = 0;
}
}
else if (type == 0) {
byte next = pgm_read_byte (score + index + 1);
unsigned long wait = 0;
for (byte i = 0; i < 7; i++) {
bitWrite(wait, i + 8, bitRead(command, i));
}
for (byte i = 0; i < 8; i++) {
bitWrite(wait, i, bitRead(next, i));
}
nextCommandTime = t + (wait * 965); // not an exact ms value, tuned faster to make up for some slow code
index += 2;
}
}
}
//limit hh closed and kick durations
for (byte i = 0; i < 6; i++) {
if (voiceType[i] == 1 || voiceType[i] == 2 || voiceType[i] == 3) {
if (t - start[i] >= 30000) {
voiceEnabled[i] = 0;
voiceType[i] = 0;
start[i] = 0;
byte p = pgm_read_byte (voicePins + i);
pinMode(p, INPUT_PULLUP);
}
}
// limit fast snare durations
if (voiceType[i] == 4) {
if (t - start[i] >= 80000) {
voiceEnabled[i] = 0;
voiceType[i] = 0;
start[i] = 0;
byte p = pgm_read_byte (voicePins + i);
pinMode(p, INPUT_PULLUP);
}
}
}
}
ISR(TIMER1_COMPA_vect) {
t = micros();
bool newNoise = false;
for (byte i = 0; i < 6; i++) {
if (voiceEnabled[i] == 1) {
byte p = pgm_read_byte (voicePins + i);
byte state = 0;
if (voiceType[i] == 0) {
if (t > nextFlip[i]) {
nextFlip[i] += periods[i];
states[i] = !states[i];
digitalWrite(p, states[i]);
}
}
else if (voiceType[i] == 1 || voiceType[i] == 4) {
if (newNoise == false) {
newNoise = true;
noise = bitRead(rng(), 0);
}
digitalWrite(p, noise);
}
else if (voiceType[i] == 2) {
if (noiseCount[i] == 2) {
noiseCount[i] = 0;
if (newNoise == false) {
newNoise = true;
noise = bitRead(rng(), 0);
}
digitalWrite(p, noise);
}
else {
noiseCount[i]++;
}
}
else if (voiceType[i] == 3) {
if (noiseCount[i] == 3) {
noiseCount[i] = 0;
if (newNoise == false) {
newNoise = true;
noise = bitRead(rng(), 0);
}
digitalWrite(p, noise);
}
else {
noiseCount[i]++;
}
}
}
}
}
void loop() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment