works: MIDI-IN: code + schematics

How would this be wired with a 4 pin optocoupler?