Implementing MIDI In function