+#include <midi_Defs.h>
+#include <midi_Namespace.h>
+#include <midi_Settings.h>
+#include <midi_Message.h>
+#include <MIDI.h>
 /*
- Test pseudo-MIDI commands from a 3x2 key matrix.
+ Test pseudo-MIDI commands from a 61-key keyboard.
 
  Turns on a LED when at least one key is pressed.
 
  The circuit:
- * OrganDuino PCB shield, populated with diodes
- * First two octaves (24 keys) soldered in
- * Rank 0 jumper bridged on reverse side
+ * Single OrganDuino 2.0 PCB shield, populated with diodes
+ * Solder jumper on back for rank 0 bridged
+ * 61-key organ manual soldered in with buss soldered to a Drive Pin thru-hole
 
  created 2016 by @JDWarner
 */

    state = not value;

    // If there is a state change, send a MIDI event
    Serial.write(channel);
    Serial.write(stateMIDIvalue(state));
    Serial.write(midiNoteNames[key]);
  }
}


*/

// define how large some things are (matrix size)
const int numKeys = 61;  // full organ manual, also length of keyPins and midiKeyNotes
const int numRanks = 1;  // only one rank for now, also length of rankPins

const unsigned char midiKeyNotes[numKeys] = {36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, };
const unsigned char midiChannels[numRanks] = {0x90, }; // 0x91, 0x92, 0x93, 0x94, 0x95};  // Five manuals plus pedals

// State of all keys in a 2D multidimensional array
bool keyStates[numRanks][numKeys] = {
  {false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, },
};


