Organ Bass Pedals

You are not sending MIDI, you are printing text to a MIDI device, which is probably why it stops playing.

Take a look at my MIDI Controller library, it does all you need, you just have to tell it what pins to use.

Pieter