Oh sorry - didn't read about your specific pain. Well, I never heard of that - but there's a first for everything.
I don't know how technically savvy you are, but a typical script would look like this:
midi2csv yourFile | sed 's/some regex with note_on 0/result with note_off/' | csv2midi.exe resultfile
where sed is a unix tool that is available in various Windows utilities. If this is too vague for you (which I'd suspect), I can look into a more concrete solution.
// Edit:
Ok - here is a solution that worked for a test file for me. You need the following 4 files all in the same directory:
(a) midicsv.exe and csvmidi.exe - I assume you have them both.
(b) The following VBS script in a file NoteOn0ToNoteOff.vbs:
Set rxp = new RegExp
rxp.Multiline = False
rxp.Pattern = "Note_on_c, (.*), 0"
Do While Not WScript.StdIn.AtEndOfStream
inp = WScript.StdIn.ReadLine()
WScript.Echo rxp.Replace(inp, "Note_off_c, $1, 0")
Loop
(c) The following small batch file, e.g. as NoteOn0ToNoteOff.bat:
@midicsv %1 | cscript //NoLogo NoteOn0ToNoteOff.vbs | csvmidi - %2
Now you can e.g. do
NoteOn0ToNoteOff.bat Test.mid TestOff.mid
on the command line, and then TestOff.mid will be the same as Test.mid, except that Note-On-Zeros are replaced with Note-Offs.
Caveats:
- There is no error handling in my script, e.g. if you forget to mention one of the two files or if you specify the same filename twice.
- I think the tool does not handle non-ASCII characters (e.g. in titles or copyrights) correctly, because these are UTF-8 in the MIDI file (I think), but VBScript does not know this, or it does know it and outputs them in some other code ...
Maybe this helps as a starting point.
If someone is interested, the midicsv/csvmidi file format is documented at https://www.fourmilab.ch/webtools/midicsv/.
H.M.