******************
TOMS-TIMIDITY-TIPS
rev: Oct 2006
******************

Timidity is a software synthesizer.  
It will convert a midi song into a wave/ogg/mp3 file.  
It can play just one midi song or all songs in a directory.  
It can also convert to wave/ogg/mp3 


Ubuntu/Debian users
check out this link:
https://help.ubuntu.com/community/MidiSoftwareSynthesisHowTo
download the packages timidity and freepats
sudo apt-get install timidity
sudo apt-get install freepats


or

1) Download the timidity source (timidity.sourceforge.net)

2) read the man pages "timidity.1" and "timidity.cfg.5"

3) su to root

4) To generate a makefile that will compile the command line version of timidity:

./configure --enable-audio=default  --enable-interface=vt100

5) make

6) make install


7) Download sound patches and soundfonts

For General Midi patches:
freepats: http://freepats.opensrc.org/freepats/
goemons patches: http://www.anime.net/~goemon/timidity/
ftp://ftp.gravis.com/Public/Sound/Patches/

For the Jeux organ soundfont:
created by John McCoy http://members.aol.com/realmac/jeux1.htm
he also has some excellent organ midis to try with Jeux
check out this website for excellent info on setting up timidity + jeux:
http://www.geocities.jp/midi_organ_net/timidity/



8)create /usr/local/share/timidity/timidity.cfg
this file is read at startup and identifies patch locations/parameters
here is what my timidity.cfg looks like, only 4 lines

dir /home/tom/timidity/freepats
source freepats.cfg

dir /home/tom/timidity/jeux
source jeux.cfg 



freepats.cfg
************
I store freepats.cfg in the same directory as the patches
all drum patches are in directory /Drum_000
all chromatic inst patches are in directory /Tone_000
the start of my freepats.cfg looks like this:
note bank 0 as most midis look for patches here if bank not specified

bank 0

0  Tone_000/000_Acoustic_Grand_Piano.pat amp=360 pan=center
1  Tone_000/001_Acoustic_Brite_Piano.pat
2  Tone_000/002_Electric_Grand_Piano.pat
3  Tone_000/002_Electric_Grand_Piano.pat
4  Tone_000/004_Electric_Piano_1_Rhodes.pat
5  Tone_000/005_Electric_Piano_2_Chorused_Yamaha_DX.pat
6  Tone_000/006_Harpsichord.pat
7  Tone_000/007_Clavinet.pat
8  Tone_000/008_Celesta.pat
9  Tone_000/009_Glockenspiel.pat
11 Tone_000/008_Celesta.pat
              |
              |
              V
127 Tone_000/127_gunshot.pat



drumset 0

25  Drum_000/025_Snare_Roll.pat 
26  Drum_000/026_Snap.pat 
27  Drum_000/027_High_Q.pat 
31  Drum_000/031_Sticks.pat 
32  Drum_000/032_Square_Click.pat 
33  Drum_000/033_Metronome_Click.pat 
34  Drum_000/034_Metronome_Bell.pat 
35  Drum_000/035_kick1.pat
36  Drum_000/036_basedrum.pat
37  Drum_000/037_Stick_Rim.pat 
              |
              |
              V
84     Drum_000/084_Belltree.pat




jeux.cfg
********

## here you can insert timidity command line options
opt -R 500
opt -EFresamp=1
opt -EFreverb=G,127

## use bank 42 because thats what John McCoys midis are based on
bank 42

## He calls the first bank "Grand Organ"

## I have a one to one relationship between Jeux patch number
## and the instrument number of the midi file

0  %font Jeux14.SF2 0 0
1  %font Jeux14.SF2 0 1
2  %font Jeux14.SF2 0 2
3  %font Jeux14.SF2 0 3
4  %font Jeux14.SF2 0 4
5  %font Jeux14.SF2 0 5
          |
          |
          V
127  %font Jeux14.SF2 0 127


## JEUX Romantiques
## stops of the second bank
bank 43

0  %font Jeux14.SF2 0 0
1  %font Jeux14.SF2 0 1
2  %font Jeux14.SF2 0 2
3  %font Jeux14.SF2 0 3
4  %font Jeux14.SF2 0 4
5  %font Jeux14.SF2 0 5
6  %font Jeux14.SF2 0 6
          |
          |
          V
75  %font Jeux14.SF2 0 75





9) now use Timidity
I use command line version: timidity [options] filename
see the man page timidity.1 for help
see also timidity.cfg.5


//List midi song info
-Ol 


//adjust overall volume of song at 120% (0-800 allowed, 70=default)
-A120


//left channel 300ms delay affect
--delay=l,300


//global reverb = 7% (1-127 allowed)
--reverb=g,7


//enable chorus affect = 77 (0-127 allowed)
--chorus=n,77


//simple play no options
timidity mysong.mid


//play midi with options
timidity  -A120   --delay=l,300   --reverb=g,7   --chorus=n,77   mysong.mid


//simple convert midi to wav (uncompressed RIFF, harpsi.wav is generated)
timidity -Ow  harpsi.mid  


//convert midi to wav 16bit stereo with options
timidity mysong.mid  -A120  -Ow1s  -s44100  --delay=l,300  --reverb=g,7  -o mysong.wav  


//convert .wav to ogg 
ogg is a compressed audio format similar to mp3 
download and install the oggenc package
oggenc filename.wav    (creates filename.ogg)


//force sound patch regardless of whats in midi file
//useful for listening to patches without changing midi file
//you will get seg fault if sound patch does not exist
//e.g. set inst=57 from bank 0 (default)
timidity -EI57 test.mid
//e.g. set inst=44 from bank=42
timidity -EB42 -EI44 test.mid





thats all folks !
enjoy timidity...
tatimmer


