Why Doesn't MIDI Work On My PC?

MIDI stands for Mu­si­cal In­stru­ment Dig­i­tal In­ter­face, a stan­dard adopted by the elec­tronic mu­sic in­dus­try for con­trol­ling de­vices such as syn­the­sis­ers and sound cards that emit mu­sic. This ar­ti­cle helps read­ers to solve the prob­lem of MIDI files not playi

OpenSource For You - - OPEN GURUS LET'S TRY - By: Nan­daku­mar Edamana The au­thor is a free soft­ware user, de­vel­oper, hacker and ac­tivist, now in higher sec­ondary school. He is the cre­ator of pack­ages like Cha­lanam (an­i­ma­tion soft­ware), Sam­maty (to con­duct com­puter-aided elec­tion, now used in more than

MIDI is a won­der­ful stan­dard that de­fines the pro­to­cols and in­ter­faces for elec­tronic mu­si­cal in­stru­ments and com­put­ers. Nowa­days, it is pos­si­ble to cre­ate even large-scale or­ches­tral pieces us­ing just a per­sonal com­puter. This ar­ti­cle cov­ers only stan­dard MIDI files (. smf or .midi or .mid), which con­tain de­tails like no­ta­tions for dif­fer­ent in­stru­ments and act like an au­dio file when played us­ing a MIDI player. You are prob­a­bly fa­mil­iar with MIDI files, since many ring tones and Web mu­sic clips come in that for­mat.

What makes MIDI files dis­tin­guish­able is that their sound is not pre-recorded. The file con­tains just some no­ta­tions for dif­fer­ent in­stru­ments used in that par­tic­u­lar piece of mu­sic. It is played with the help of a soundfont, which con­tains pre-recorded sounds for those in­stru­ments. This makes MIDI files ex­tremely small. An­other ad­van­tage of MIDI files is that you can study a piece of mu­sic and mod­ify it. There are many pro­grams like Muses­core, which can con­vert a given MIDI file to a score sheet and vice versa.

GNU/Linux users do run into dif­fi­cul­ties with MIDI files and pro­grams. But many users live with them, be­liev­ing that the prob­lems can never be solved un­til a new ver­sion is re­leased. Ac­tu­ally, they can be solved in a few very sim­ple steps. You should try them so you can ex­pe­ri­ence a lot of won­der­ful MIDI ap­pli­ca­tions in GNU/Linux.

Pro­grams and ports

MIDI is a built-in fa­cil­ity with al­most all GNU/Linux dis­tros. But do en­sure that you have the TiMid­ity++ MIDI Se­quencer in­stalled in your sys­tem (we are not con­sid­er­ing other se­quencers now). So let us solve some MIDI prob­lems.


Most users find it dif­fi­cult to open a MIDI files. Some play­ers don't sup­port them. For ex­am­ple, VLC needs an additional Flu­idSynth plugin to read them. You can solve this prob­lem by in­stalling ap­pro­pri­ate plug­ins us­ing the Synap­tic Pack­age Man­ager, the apt-get in­stall com­mand or any other pack­age man­ager.

Some play­ers won't play MIDI files prop­erly. For ex­am­ple, Totem plays MIDI files in a dis­crete man­ner. TiMid­ity++ is a bet­ter op­tion. Al­ways right click on a MIDI file and se­lect TiMid­ity++ from the Open With sub-menu op­tions.

The com­mand line pro­gram timid­ity also of­fers many fea­tures. See the com­mand be­low, which plays a MIDI file with 200 per cent vol­ume and 150 per cent tempo.

-----CMD----timid­ity Fan­fare.mid --vol­ume 200 -T 150 ----/CMD-----

Ports and con­nec­tions

When pro­grams like vir­tual pianos and mu­sic cre­ators do not pro­duce sound, you have to change their con­nec­tion by choos­ing the ap­pro­pri­ate MIDI port. It has been ob­served that the Midi Through port doesn't play sound while Timid­ity ports work well. As an ex­am­ple, take the VMPK vir­tual piano. When it doesn't play sounds, you have to change its con­nec­tions at Edit→Con­nec­tions.

You can use con­nec­tion pro­grams like the Jack Au­dio Con­nec­tion Kit to han­dle ad­vanced au­dio con­nec­tions in­clud­ing that of MIDI. They of­fer many com­plex fa­cil­i­ties.

Some­times the pro­gram shows that ‘…an in­stru­ment is not found.’ This is not a prob­lem of the pro­gram, but of the soundfont.


We are fa­mil­iar with text fonts. The text of a doc­u­ment is al­ways the same, but the ap­pear­ance de­pends on the fonts used while ren­der­ing (dis­play­ing). You might have no­ticed that the text of some web­sites ap­pears dif­fer­ently in dif­fer­ent browsers/de­vices. This is be­cause they ren­der those web­sites dif­fer­ently even though the con­tent re­mains the same. As I men­tioned ear­lier, MIDI files con­tain no­ta­tions only. They might sound dif­fer­ent in dif­fer­ent plat­forms since the sound­fonts used for ren­der­ing may be dif­fer­ent.

An­other prob­lem with text fonts is that some re­gional lan­guage/spe­cial char­ac­ters in documents can­not be dis­played since the cur­rent font doesn't con­tain those char­ac­ters. The same is­sue ex­ists for sound­fonts also. Some in­stru­ments are not avail­able in some sound­fonts, so a MIDI file con­tain­ing parts for those in­stru­ments can't be played prop­erly. Just as we solve the text font prob­lem by us­ing fonts with max­i­mum lan­guages/char­ac­ters, we can use heavy sound­fonts like Fluid, or com­bi­na­tions of dif­fer­ent sound­fonts to solve this MIDI prob­lem.

By de­fault, FreePats comes with TiMid­ity++ as the soundfont. Un­for­tu­nately, it is cur­rently in­com­plete. So we have to in­stall some other soundfont to en­joy MIDI files in clar­ity. Let us learn more about the in­stal­la­tion and con­fig­u­ra­tion.


Sound­fonts come with the ex­ten­sion .sf2. They can be stored in any di­rec­tory and used with suit­able pro­grams. But in or­der to use them with TiMid­ity++ (i.e., usual MIDI play­back), we should have their con­fig­u­ra­tion files in /etc/ timid­ity. For­tu­nately, we have got ready-to-in­stall pack­ages of some fa­mous sound­fonts. You may use a pack­age man­ager to in­stall them. The pack­ages are fluid-soundfont-gm, flu­id­sound­font-gs and muses­core-soundfont-gm. The first two are very large, while the sec­ond one is light­weight.


Even af­ter in­stalling a new soundfont, TiMid­ity++ uses the older one. We have to edit its con­fig­u­ra­tion file to en­able the new soundfont. Let us look at the Fluid GM soundfont as an ex­am­ple. First en­sure that its con­fig­u­ra­tion file is in /etc/timid­ity.

For this, try the fol­low­ing com­mand at the ter­mi­nal:

ls /etc/timid­ity flu­idr3_gm.cfg freepats.cfg timid­i­ty_a.cfg flu­idr3_gs.cfg timg­m6mb.cfg timid­ity.cfg

The out­put shows we have flu­id3_gm.cfg, which is the con­fig­u­ra­tion file of the Fluid GM soundfont. Now we have to add this into timid­ity.cfg, which is the con­fig­u­ra­tion file of TiMid­ity++. Be­fore do­ing that, keep a back-up copy of it in your home folder:

sudo cp /etc/timid­ity/timid­ity.cfg ~/timid­ity.cfg

Try the com­mand given be­low to open the file:

sudo gedit /etc/timid­ity/timid­ity.cfg

Note: You can use other text ed­i­tors like gvim in­stead of gedit, depend­ing on your dis­tro.

We have to add this line at the end of the file:

source /etc/timid­ity/flu­idr3_gm.cfg

But the file prob­a­bly con­tains that line al­ready, in a com­mented state. All you have to do is un­com­ment it (by re­mov­ing the hash (#) in front of it). Now you may com­ment the line of the cur­rent soundfont by adding a # be­fore it.

The con­fig­u­ra­tion is com­plete and TiMid­ity++ starts to use the new soundfont.

Note: You can use mul­ti­ple sound­fonts at a time by keep­ing their con­fig­u­ra­tion lines un­com­mented. When both sound­fonts con­tain the same in­stru­ment, the last soundfont is used. For ad­vanced mix­ing of sound­fonts, you have to edit their con­fig­u­ra­tion files (e.g., /etc/timid­ity/flu­idr3_gm.cfg) or cre­ate a new soundfont us­ing pro­grams like Swami.

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.