27 May 2008

Play MIDI under GNU/Linux with ALSA

There is lots of articles on the subject but it is not so trivial to get needed information to use ALSA tools to play MIDI files.

This is some quick information:
- the first is obviously to have a working ALSA installation,
- if you have several sound cards, ensure the default is well the wanted one (for instance using system-config-soundcard under Fedora),
- then it is important to ensure not having mute channel(s), you can use alsamixer for this,
- then ensure to have a way to load soundfonts into the wavetable of the sound card; for instance of sound card managed AWE32/Emu10k1 sound driver, you can install the awesfx package
yum install awesfx
- get a soundfonts to load, for instance this one,
- at any moment, to check if there is a loaded soundfonts:
cat /proc/asound/card?/wavetableD?
- you can clear currently loaded soundfounts but you want to keep it:
/bin/asfxload -i
- then load it:
/bin/asfxload "soundfonts file path"
- find the "addresses" into the "/proc/asound/card?/wavetableD?" file (for instance: 17:0 17:1 17:2 17:3),
- finally test installation using aplaymidi to play a MIDI file
aplaymidi -p "addresses"* "MIDI file path"
* addresses must be coma separated, 17:0,17:1,17:2,17:3 for instance.

1 comment:

  1. To get information and free soundfonts :
    http://fr.wikipedia.org/wiki/Soundfont

    ReplyDelete

Thank you for your visit, let's share your point of view: