@echo off

for %%a in (*.mid) do (call :FixMid %%a)
goto :theEnd

:FixMid
  set midiFile=%*
  set txtFile=%midiFile:.mid=.txt%
  set txtFileTemp=%midiFile:.mid=-temp.txt%

  mf2tXP.exe "%midiFile%" "%txtFileTemp%"
  REM Instead of removing maybe I should comment out instead
  findstr /I /V "c=10[8,9]" %txtFileTemp%> %txtFile%
  sed-4.8-x64.exe -i -E "s/c=110 v=([0-9]+)/c=110 v=0/g";"s/c=111 v=([0-9]+)/c=111 v=0/g" %txtFile%
  t2mfXP.exe "%txtFile%" "%midiFile%"
  REM del /q /f "%~dp0*-temp.txt"
goto :eof

:theEnd

Echo Bye
pause
