The Windows MIDI monitoring and mapping tool
MIDI-OX includes a scripting interface. I wrote the attached JavaScript file. When you open this script in Windows, the script runs in Windows Script Host. The script opens MIDI-OX (if it's not already open), intercepts the MIDI messages coming in MIDI-OX's input port, and then sends desired messages to MIDI-OX's output port. The script keeps track of which pitch is currently sounding. If another note begins while a pitch is already sounding, the script will end the first note, pause for a small amount of time, then begin the new note.
Download: monophonic-gap-enforcer.zip