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

How to play midi files?

Tue Feb 14, 2017 3:32 pm

Hi!
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
Robotmike
Posts: 43
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.

Donut
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
OnlineSequencer.net 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 http://www.videoconverterfactory.com/ti ... layer.html if you are interested in it, you can take a look

eddiefoss
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.

Gayle_Foote
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.

retrowertz
Posts: 2
Joined: Fri Sep 21, 2018 2:38 am

Re: How to play midi files?

Fri Sep 21, 2018 4:47 am

my post has been removed, they probably dont like to know the truth.

anyways to be on topic, you CANT, not within solus reposiroty anyways unless you work your *** off compiling the required dependency that the repo does not have.

User avatar
kyrios
Posts: 2306
Joined: Thu Sep 22, 2016 4:20 pm

Re: How to play midi files?

Fri Sep 21, 2018 6:21 am

retrowertz wrote:
Fri Sep 21, 2018 4:47 am
my post has been removed, they probably dont like to know the truth.

anyways to be on topic, you CANT, not within solus reposiroty anyways unless you work your *** off compiling the required dependency that the repo does not have.
You post wasn't removed, it was waiting in the moderation queue as for any new forum user. Also there is something called "package request" that can be used instead of yelling...

By the way, welcome to this friendly community :)

retrowertz
Posts: 2
Joined: Fri Sep 21, 2018 2:38 am

Re: How to play midi files?

Fri Sep 21, 2018 7:09 am

kyrios wrote:
Fri Sep 21, 2018 6:21 am
retrowertz wrote:
Fri Sep 21, 2018 4:47 am
my post has been removed, they probably dont like to know the truth.

anyways to be on topic, you CANT, not within solus reposiroty anyways unless you work your *** off compiling the required dependency that the repo does not have.
You post wasn't removed, it was waiting in the moderation queue as for any new forum user. Also there is something called "package request" that can be used instead of yelling...

By the way, welcome to this friendly community :)



there was already a package request for that before somewhere on the build/dev page . i cant find it anymore though now so not sure what happened to it.

kiba999
Posts: 9
Joined: Mon Jul 16, 2018 3:48 am

Re: How to play midi files?

Fri Sep 21, 2018 7:16 am

There are several pieces of software in the Solus repository currently that play midis out-of-the-box. Just install MuseScore. It comes prebuilt with a soundfont. Load a midi, play. Another perhaps superior option if you wish to play and edit midi is SunVox.

Remember, midi isn't an audio format; it's audio instruction language to be interpreted by a computer that then assigns a soundfont's digital instrument samples to play it. On Windows for many years way back in the 90s and early 2000s, they'd package up loads of audio software to contain soundfonts and do all this under the hood, giving the appearance that midi is analogous to mp3 or ogg, etc. On Linux and in general nowadays, audio players typically don't come with midi support. I suggest you give SunVox a try. If the package still cannot be installed due to the migration, download SunVox from the SunVox site directly -- it's just a right-click -> properties -> 'allow app to run' deal, and it works great on Solus with absolutely no configuration, easy colorful interface. This way, you can play your midis, then export them as mp3s or whatever format you wish for your audio playing convenience on any player. Good luck.

[EDIT] lol Somehow I completely missed the content and contex of the original post and only comprehended the thread title. Yeah, getting OpenTTD to play midi is going to be a somewhat more complex problem, unless the game itself is compatible with other audio formats and you could convert the midis and drop in the replacements. Seems not, though. Basically, it looks like the Linux version relies on TiMidity++ to automatically play music in-game. I guess that'll have to be added to the repos. Till then, you'd have to compile it yourself or tell OpenTTC to use fluidsynth, as you already figured out. Maybe check the Arch wiki OpenTTC page for this and other solutions. This isn't a Solus specific problem, apart from the current lack of Timidity in the repos.

Return to “Multimedia”