The following schematic converts MIDI input messages from the M-Audio Keystation keyboards to something the Teensy can understand. There are many examples around how to do this, so no need to reinvent the wheel. I selected a schematic using the highly recommended 6N137 Logic Output Optoisolator chip used by many commercial products:
As I have 3 MIDI streams that I have to convert, I decided to create single input PCBs (as opposed to a single PCB with 3 MIDI inputs). The only reason I decided to do this is that OSHpark.com where I get my PCBs made, has a minimum order quantity of three.
The final PCB design:
And the finished item: