void noteOn(byte channel, byte note, byte velocity)
{
midiMsg(channel+0x90, note, velocity);
}
void midiMsg(byte cmd, byte data1, byte data2)
{
Serial.write(cmd);
Serial.write(data1);
Serial.write(data2);
}
const int numSnareReadings = 10;
const int numHighHatReadings = 2;
const int numKickReadings = 5;
const int numCrashReadings = 10;
int snareReadings[numSnareReadings];
int snareIndex = 0;
int snareTotal = 0;
int snareAverage = 0;
int currentSnareState;
int switchSnareState = 0;
int highHatReadings[numHighHatReadings];
int highHatIndex = 0;
int highHatTotal = 0;
int highHatAverage = 0;
int currentHighHatState;
int switchHighHatState = 0;
int crashReadin