Delete RSlatch and key check code.
And start writing MIDI RX