Q:

Bash - How to iterate over all files in a folder and wait for completion

I have a little cmd program that records a video, and waits like so taking one argument for the filename:
START /WAIT "" "C:\Program Files (x86)\Synthesia\Synthesia.exe" --on- 
startup Play  --on-song-end Quit 
"DirectoryHere\%~1"
exit

What I cannot figure out is how to loop over all files in a specific folder, and run this program while waiting for it to exit. 
This is my current attempt in bash:
for filename in /ToBeRendered/*.mid; do
  ./1Processor.cmd $filename
done

This gives the error, line1: syntax error near unexpected token '$'do/r

A:

why mixed batch/bash code?  Better to use either the one or the other. 
For pure batch, this would be something like:
for %%a in (\ToBeRendered\*.mid) do (
    START /WAIT "" "C:\Program Files (x86)\Synthesia\Synthesia.exe" --on-startup Play --on-song-end Quit "DirectoryHere\%%~nxa"
)

