From Sabayon Wiki
Jump to: navigation, search

Procedure to get audio output from the Midi/karaoke player KMid if you don't have an external Midi device or sound card with Midi hardware synthesizer

KMid now supports international characters and diacritics (accents), so it is now a viable alternative to PyKaraoke if you have MIDI tracks with lyrics in Arabic, Chinese, Cyrillic, French, Greek, Japanese, Portuguese, Spanish and so on.

The following procedure works on an Acer TravelMate 8215WLMi laptop PC running Sabayon x86-64 3.3 and should work on all PCs that can play Midi files using the TiMidity++ Midi player but do not produce sound when Midi files are played using the KMid Midi/karaoke player. Both TiMidity++ and KMid are installed on the Sabayon 3.3 LiveDVD and will be installed by default onto your HDD if you perform a full installation of Sabayon 3.3.

What is KMid?

Unlike the Midi player TiMidity++, which is an ALSA sequencer and Midi to PCM (Wave) converter with its own built-in software Midi synthesizer, KMid requires either external Midi hardware or a PC sound card which has a hardware Midi synthesizer. If you only want to play Midi files you could therefore consider using TiMidity++ instead of KMid. However, unlike TiMidity++, KMid can display song lyrics if they have been embedded in Midi files (.mid and .kar) for the purpose of karaoke. So, if it is a karaoke Midi player you want, KMid rather than TiMidity++ will be the player you want to use.

Now, TiMidity++ can also be used as an ALSA sequencer and Midi to PCM (WAV) converter by external programs, so it is possible to use TiMidity++ to drive your sound card by converting the output from KMid, i.e. KMid plays the Midi file and sends the output to TiMidity++ which converts it to PCM (WAV) and sends it to the sound card. To do this, carry out the following steps in the order given:


Open a Terminal and type:

$ timidity -iA -Os

The -iA selects TiMidity's ALSA sequencer interface, and the -Os (that's the letter O, not the number zero) sets the TiMidity output mode to 'ALSA pcm device'


Launch KMid


Settings > MIDI Setup..., select 'TiMidity TiMidity port 0 - ALSA device' and click OK.


File > Open, enter the file name of the .mid or .kar file that you would like to play and then click Open. If the file contains lyrics, these will appear in the grey KMid window.


Click on the Play button to listen to the Midi file playing. If the Midi file contains embedded lyrics then you will see the words of the lyrics turn yellow in time to the music so that you can sing along.


The Midi instruments are defined in so-called Midi 'sound font' files. The use of TiMidity++ to sequence and output the Midi files played by KMid means that the Midi sound fonts supplied with TiMidity++ are used.

The procedure given above is probably not the only way to get KMid to produce sound, and there may be ways of getting the output from KMid to sound better. The sound quality of some Midi files played using TiMidity++ are reasonable, while others are distorted even though they sound fine when played using a Midi player under Windows XP. Thus it may be worthwhile experimenting with TiMidity++ settings (type "timidity -h" without the quotes in Terminal to see the list of available TiMidity++ parameters) or with other Midi sound fonts if you can get hold of them.

PyKaraoke is a good alternative to KMid (see the Sabayon Linux Wiki article HOWTO: PyKaraoke).

Authored by Fitzcarraldo, 06.04.07