It is currently Wed 14 Nov, 2018 3:26 am • View unanswered postsView active topics

MIDI to WAVE - Windows Edition


MIDI to WAVE - Windows Edition

Postby qazxsw21000 » Thu 11 Jul, 2013 9:10 pm

I have made a Linux script that'd convert MIDI to WAVE using Zenity and Timidity. I have decided to port the script to Windows' BASH. You still need Zenity and Timidity. The script requires two files: the script, and a configuration file.
Code: Select all
@echo off
if exist timidity.txt GOTO get_tdir
zenity --file-selection --directory --title="Directory for timidity.exe" > timidity.txt

:get_tdir
set /p tdir=<timidity.txt

for /f "delims=" %%a in ('zenity --file-selection') do @set midi=%%a
start /wait zenity.exe
IF [%midi%] == [] GOTO cancelled

for /f "delims=" %%a in ('zenity --file-selection --save --confirm-overwrite') do @set save=%%a
start /wait zenity.exe
IF [%save%] == [] GOTO cancelled

cd %tdir%

timidity "%midi%" -Ow -o "%save%.wav" | zenity --progress --pulsate
start /wait timidity.exe

zenity --alert --text="Finished Conversion"
EXIT

:cancelled
zenity --info --text="Cancelled the Conversion"


When you run the script for the first time, it will ask for the directory to Timidity. It will save this path to a text file, so I recommend putting the script in its own folder. If you need to change this path, you can either delete the text file, or edit it. It will then ask for a MIDI file followed by a save path/name. The ".wav" extension is appended automatically.
"Analogies are like sandwiches in that I'm making one now."
Does a set of all sets contain itself?
This statement is false!
Your next task: Refuse this task
User avatar
qazxsw21000
 
Posts: 1501
Images: 18
Joined: Sat 06 Aug, 2011 10:37 pm
Location: London, KY


  • Advertisement

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests

cron