MIDI Retro-fitting a Kawai SX-210 :)

Hey Everyone!

I have been learning about keyboard matrices because I want to add MIDI to my Kawai SX-210. So I understand that basically there are 8 output pins and 8 input pins. The output pins cycle at a certain frequency one at a time sending out a pulse, which depending one what keys are pressed, will let that pulse travel to the input pins.

But I’m unclear on how how the input knows which group of keys the pulse is coming from. Is it synced with the frequency of the output pulses and then depending on the timing knows from which group of keys the pulse is coming from? If so, how would I sync of an arduino with the clock of the output pulses?

Surely it’s just a bitmask?

00000000 = No note pressed
00000001 = Lowest note
111111111 = Highest note

00000001
00000010
00000011
00000100

and so on.

Article here may be of use.