The midi over USB is common these days but patchy cables between devices are still mostly the DIN jacks.
How are you connecting to your MIDI device?
Desktop with Windows 7 <=> USB <=> Arduino UNO
Arduino UNO <=> Breadboard Wiring <=> Midi Jack
Midi Jack <=>MIDI to USB cable <=>Micro USB otg cable <=>Nexus 7 <=>Grand Piano pro version (supports Midi via USB)
So why again is there a Midi Jack in this schematic
Unless you have a proper circuit your digital input will 'float' and switch between high and low randomly. This is your third situation. The others produce a circuit that is the inverse of the other as far as the sensor is concerned, hence e the difference in whether you see a midi message or not.