To start off, let's ask a question. How many wires do you need between a CPU and keyboard to read keys being played? If you guessed at least one for every key, hello from the future. If you guessed one, to transmit serial data, slow down. The keyboard only has simple switches and components. We need to read the keyboard before we can transmit note data by MIDI or other means. Luckily smart people have already found the answer. We can use a switch matrix with inputs and outputs instead of individual inputs for all the keys. A switch matrix is used in all sorts of devices with keypads, buttons, or switches to scan . Using this method we need at least 2x the square root of the number of keys. For a 61 key synth that would be 2 x sqrt(61) = 15.6 or 16 data lines. Below is a schematic from the Jupiter-6 Service Manual.

The only components in this keyboard other than wires and switches are diodes for every key. Why do they need to be there? Let's imagine they aren't there. You play F1 and G#1 simultaneously. The CPU is outputting 01000000. The 5V from the F1 will go to the buss bar 3rd from the left and be read by the CPU. There's a problem though. Without the diodes, the 5V at the buss bar also goes back through the G#1 and back to that note's CPU output, which is 0V. A 5V and 0V output get shorted together which may or may not make sparks, let out smoke, and ruin the CPU.
