Posts: 1
Joined: Tue Feb 14, 2017 3:27 pm

How to play midi files?

Tue Feb 14, 2017 3:32 pm

I installed OpenTTD (software center) and there is no music. I trying to play the downloaded midi files in Rythmbox, Audacious and VLC but no luck. Seems the OS doesn't decode this type of files.
I installed fluidsynth but no luck.
Any idea pls? Thanks.

User avatar
Posts: 40
Joined: Mon Oct 10, 2016 12:40 pm

Re: How to play midi files?

Tue Feb 14, 2017 10:55 pm

Generally and afaik (not an expert for this), the OS isn't responsible for "decoding". The intention was to load a soundfont into the soundcard, and a midi command executes something on the soundcard hardware to play a note. In early days you have had a hardware midi port on each soundcard, something similar to a serial interface with a sub-d connector.
Windows always did an emulation when playing midi, from the earliest beginning. So it was relatively simple for the user to play midi files. But in Linux you have to do the soundfont thing. FluidSynth is a software synthesizer, so I guess it does the emulation part. Sound processing works different today.
I downloaded a *.sf2-file (a soundfont) and placed it in .local/share/soundfonts, and started fluidsynth from commandline, with the soundfont as parameter, and passed a MIDI-File directly to fluidsynth successfully:
fluidsynth .local/share/soundfonts/mysoundfont.sf2 mymidi.mid
and that worked fine.
But I was unable to use a graphical interface for fluidsynth so far. Some hints are highly appreciated.

Posts: 1
Joined: Thu Feb 01, 2018 4:33 am

Re: How to play midi files?

Fri Feb 02, 2018 3:51 am

There are many ways can play midi files? don't you know? for example is an online music sequencer that allows you to play midi files online.
Step 1: Click “Import MIDI” button on the top menu to load your MIDI file into the online MIDI player.
Step 2: After choosing MIDI file and then click “continue” to enter a new interface. Next, choose different instruments for tracks.
Step 3: Click “Previewing/Import” and then you will see the detailed MIDI data.
Step 4: Click the yellow button to start to play MIDI file.
Well, these words are copied from ... layer.html if you are interested in it, you can take a look

Posts: 11
Joined: Fri Jun 08, 2018 11:17 pm

Re: How to play midi files?

Tue Jun 12, 2018 12:50 pm

First thing first, with fluidsynth package installed you need to download a soundfont to fluidsynth use to play as fluidsynth package doesn't come with any and there is none in repos, googling keyword soundfont you will find one that you like.
The concept behind MIDI files is something like a musician get an instrument then the score, in gnu/linux case the musician can be timidity++ or fluidsynth but in our case we have only fluidsynth available. Now we must give instruments to the musician and the instruments comes in form of soundfonts so the score will be the midi file.
Required steps:
1 - Find and download a soundfont
2 - Put the soundfont in a place accessible and won't be deleted by accident e.g. mine I put in .local/share/soundfont/
3 - Open VLC go to "Preferences > Al l> Inpu/Codecs > Audio codecs" collapse and select FluidSynth, locate your soundfont then save.

Posts: 2
Joined: Tue May 29, 2018 12:24 pm

Re: How to play midi files?

Tue Jul 03, 2018 7:28 am

Thanks for the suggestion buddy its really knowledgeable.

Return to “Multimedia”