Page 1 of 1

MIDI music support

PostPosted: Mon Jun 23, 2014 12:22
by MirceaKitsune
Thread for issue #1409:

Followup to a discussion on IRC and a hint on the forums. I believe Minetest should add support for midi and / or mod music. There are primarily two reasons:

Firstly, this would allow adding simple music to Minetest without increased file size. Songs in ogg format are large enough to make connecting to a server take a lot of time. Midi music is very small instead, and would make music support very cheap.

Second, it would perfectly fit Minetest's theme. Like Minecraft, we use blocky voxels and x16 textures by default, which has a nice 16-bit era feel. Midi music would add to this.

Re: MIDI music support

PostPosted: Mon Jun 23, 2014 13:22
by TenPlus1
Duplicate of this forum entry: viewtopic.php?f=5&t=8763&hilit=mod+music

Re: MIDI music support

PostPosted: Mon Jun 23, 2014 14:51
by MirceaKitsune
TenPlus1 wrote:Duplicate of this forum entry: viewtopic.php?f=5&t=8763&hilit=mod+music


Ah... I thought I saw that. Oh well.

Re: MIDI music support

PostPosted: Sun Jul 06, 2014 14:11
by MirceaKitsune
I'm not sure if this is going to make the request of any higher priority. But just letting everyone know I have actual plans to include midi music in the game I will be making. So there is now an actual use case for which this is necessary, rather than a feature we could add and it might be useful someday.

If this isn't implemented until I get to that stage with my project, I'll convert the midi files to ogg, so it's not such a big problem. But apart from removing the ability for the user to choose their own sound fonts, it also means throwing a lot of useless file size down the drain (or rather into the drain).

Re: MIDI music support

PostPosted: Sun Jul 06, 2014 17:58
by stu
For what it's worth, I have long since been a fan of midi and would also love to see support for it added to minetest, however, I would like it to be more than just a simple midi file player. I can image building a programmable sequencer from mesecons, for example.

I hope this can become a reality someday.

Re: MIDI music support

PostPosted: Sun Jul 06, 2014 19:31
by MirceaKitsune
stu wrote:For what it's worth, I have long since been a fan of midi and would also love to see support for it added to minetest, however, I would like it to be more than just a simple midi file player. I can image building a programmable sequencer from mesecons, for example.

I hope this can become a reality someday.


As far as I'm concerned personally, the engine simply needs to know how to play a midi file in minetest.play_sound. More complex things like that are probably a different matter, and difficult to do really... dunno there.

Re: MIDI music support

PostPosted: Sun Jul 06, 2014 20:02
by stu
MirceaKitsune wrote:As far as I'm concerned personally, the engine simply needs to know how to play a midi file in minetest.play_sound. More complex things like that are probably a different matter, and difficult to do really... dunno there.

For sure I get a little carried away but I honestly don't think it should be that difficult, midi is a fairly simple format, irrc, heck, you could probably even do it with Lua, see MIDI.lua or LuaMIDI, although a C++ lib is likely a much better way to go.

Either way just the ability to use midi files (as opposed to ogg) would still be a very nice option, entire symphonies can be compressed into trivial file sizes allowing servers to offer a lot more variety without sacrificing bandwidth.

Re: MIDI music support

PostPosted: Tue Jul 08, 2014 02:52
by spootonium
stu wrote:For what it's worth, I have long since been a fan of midi and would also love to see support for it added to minetest, however, I would like it to be more than just a simple midi file player. I can image building a programmable sequencer from mesecons, for example.

I hope this can become a reality someday.


In this thread, I posted an overview design for a biome-/position- based generative tracker. Frankly, though, I've neither the time nor patience to develop it further by myself. If anyone out there is keen to take over, there's clearly a "market" for the feature.

Of course, as MirceaKitsune has indicated, the first real step would be adding client-side MIDI support, then server-side support and streaming.

Re: MIDI music support

PostPosted: Tue Jul 08, 2014 10:19
by MirceaKitsune
spootonium wrote:In this thread, I posted an overview design for a biome-/position- based generative tracker. Frankly, though, I've neither the time nor patience to develop it further by myself. If anyone out there is keen to take over, there's clearly a "market" for the feature.

Of course, as MirceaKitsune has indicated, the first real step would be adding client-side MIDI support, then server-side support and streaming.


Streaming is easy, just include the *.mid extension among *.ogg / *.png / *.x / etc. Client-side part is a little more tricky, since we likely need to integrate a MIDI library. I think Timidity is the answer, which is actually what you install on Linux to get MIDI support at all. If it's license compatible and reliable though, we could easily add it as an optional dependency in cmake, and teach minetest.sound_play to use it when Minetest is compiled with it.