@Echo OFF IF "%~1"=="" GOTO :Stop REM _mixer file.mscz OR file.mscx REM _mixer_Clear.awk resets all mixer setting by deleting them REM _mixer_Set.awk inserts updated mixer settings (midi channel, visibility etc.) REM based on the editable instrument name as it appears in the mixer REM (.; note this is not ..) REM .awk files should reside in the same folder REM and have the same name as the .bat file (%0) followed by _Clear/_Set IF "%~x1"==".mscx" GOTO :MSCX IF "%~x1"==".mscz" GOTO :MSCZ GOTO :Stop :MSCX gawk -f "%~dpn0_Clear.awk" "%~1" | gawk -f "%~dpn0_Set.awk" | sed -b -e "s/\r//g" > "%~dp1.$msc$tmp%~x1" touch --reference="%~1" "%~dp1.$msc$tmp%~x1" REN "%~1" ".%~nx1," REN "%~dp1.$msc$tmp%~x1" "%~nx1" GOTO :Stop :MSCZ IF NOT EXIST "%TEMP%\.$msc$tmp\*" MD "%TEMP%\.$msc$tmp\" > NUL IF EXIST "%TEMP%\.$msc$tmp\*.mscx*" DEL "%TEMP%\.$msc$tmp\*.mscx*" /Q /S > NUL call winrar X "%~1" *.mscx "%TEMP%\.$msc$tmp\" COPY "%~1" "%~dp1.%~nx1," /Y > NUL FOR %%f in ("%TEMP%\.$msc$tmp\*.mscx") DO ( gawk -f "%~dpn0_Clear.awk" "%%~f" | gawk -f "%~dpn0_Set.awk" | sed -b -e "s/\r//g" > "%%~dpf.$msc$tmp%%~xf" touch --reference="%%~f" "%%~dpf.$msc$tmp%%~xf" REN "%%~f" ".%%~nxf," REN "%%~dpf.$msc$tmp%%~xf" "%%~nxf" call winrar A -tk -ep -m5 "%~1" "%%~f" ) DEL "%TEMP%\.$msc$tmp\*.mscx*" /Q /S > NUL RD "%TEMP%\.$msc$tmp\" /Q /S GOTO Stop :STOP