Playing and Creating MIDI Songs in Debian

1 minute read

Handling midi in Debian

Playing midi can be done with timidity.

apt install timidity  # install it

timidity twelvetone1.mid  # play a midi file

Select between various midi synthesizers cards with --module=n (see man timidity for more), e.g.,

timidity --module=32 twelvetone1.mid  # emulate a sound blaster live

Convert to a wav file and then an mp3 (with ffpmeg)1.

timidity -Ow -o twelvetone1.wav twelvetone1.mid
ffmpeg -i twelvetone1.wav twelvetone1.mp3
rm twelvetone1.wav  # delete the intermediate file

Noteworthy Composer in Wine

Noteworthy Composer is a classic Windows program for writing in musical notation. Noteworthy will play these compositions in midi according to instruments selected for each staff. Download the free viewer or buy the paid version.

Noteworthy can be run with the Wine windows emulator along with timidity providing midi output.

# debian needs i386 packages for wine32
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install wine32

# install wine
sudo apt install wine wine32 winetricks cabextract

# install midi package and alsa for providing sound output
apt-get install timidity
apt-get install alsa-oss

# create a separate prefix for noteworthy if you like
export WINEPREFIX=~/.nwc

# prepare the wine config
WINEARCH=win32 winecfg 

# free viewer
wine setup_nwc275a_viewer.exe

# paid version
wine setup_nwc275a.exe

Wine should provide a desktop shortcut accessible from the application search in Gnome (you may need to check the box for the quick launcher near the end of installation). Otherwise, run the program with the following:

timidity -iA -Os  # setup the midi output

# free viewer
WINEPREFIX=~/.nwc wine ~/.wine/drive_c/Program\ Files/Noteworthy\ Software/NoteWorthy\ Composer\ 2\ Viewer/NWC2View.exe

# paid version
WINEPREFIX=~/.nwc wine ~/.wine/drive_c/Program\ Files/Noteworthy\ Software/NoteWorthy\ Composer\ 2/NWC2.exe

Select the midi output in Tools > Options > MIDI as discussed here.

  1. I’m sure there’s a more clever way to do this where timidity outputs a stream and ffmpeg reads the stream, avoiding the intermediate file.