Did similar stuff on Atari & Amiga. We actually had an app that could create SMPTE timecode on a pin of a printer port. Then we could read the timecode back (on an interrupt) and synchronize a MIDI score to a multi-track tape recorder. Oh and we used another pin to output MIDI...
I used to run my printer off my Apple II using the same kind of trick. Instead of having a separate card, I used the game IO socket and some machine code.
Had no idea that MIDI recommended/required (?) an opto-isolator as part of the spec. Makes a ton of sense given the range (& expense!) of supporting devices and the intended use.
I just had a flashback to the challenge of finding 150ohm dual axis variable pots to have a joystick for an apple ][ because the ones that they sold at Radio Shack were 100ohm.
fun times