I have Timidity++ installed with FluidSynth soundfonts. How do I make Timidity play back any MIDI, mapping all instruments to a sine wave instrument (patch 81, bank 2, according to General MIDI Level 2)?

I've tried, e.g., this in the Timidity config file:

map gm2 0 19 2 81

But it didn't use the sine wave instrument for the particular MIDI file I was playing back (bank 0, patch 19 = "church organ" instrument in that particular file).


Hmm, I cannot get map to do anything, so without diving through the source code, who knows. However! If you have a soundfont file, the bank and number configuration entries appear to do the trick via the following in ~/share/timidity/timidity.cfg:

dir /home/jdoe/share/timidity/inst
bank 0
0 %font tabla_drums.sf2 0 0
1 %font tabla_drums.sf2 0 0
127 %font tabla_drums.sf2 0 0

Where the /home/jdoe/share/timitidy/inst directory contains for this example a tabla_drums.sf2 SoundFont file. This maps test MIDI files to use the tabla drums via:

% timidity --config-file=~/share/timidity/timidity.cfg foo.midi

However, via the lspatch.pl script under the timidity source tree, and the sf_list script of the MIDI::SoundFont perl module, I can find no bank 2 patch 81 patterns nor soundfont entries, so I'm not sure what would provide it, as it does not appear to be present in timidity 2.13.2 nor via the GeneralUser_GS_1.43-FluidSynth soundfont... (if there is a pattern file with a sine wave, then the number configuration would run something like 0 blah.pat and so forth for all the patch numbers.)

Another option would be to edit the MIDI and alter any patch_change events to use a particular instrument, but that's more work, and there may also be bank select events that also need filtering.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.