Midi format music distortion

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
pgimeno
Party member
Posts: 2566
Joined: Sun Oct 18, 2015 2:58 pm

Re: Midi format music distortion

Post by pgimeno »

I guess the real question is, is there a real use case for MIDI in videogames these days?
User avatar
zorg
Party member
Posts: 3074
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Midi format music distortion

Post by zorg »

pgimeno wrote: Fri Feb 19, 2021 5:34 pm I guess the real question is, is there a real use case for MIDI in videogames these days?
Who knows, if someone doesn't want to bother with middleware like... what was it called, fmod?
It might be useful; can still be used to control, time, crossfade, whatever- high quality sound bites for a dynamic music experience... though i'll admit i haven't seen too much of this kind of thing; people tend to go ham with graphics rather than make truly spectacular complexities on the sound side of things.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
eliddell
Prole
Posts: 20
Joined: Sat Dec 10, 2016 6:38 pm

Re: Midi format music distortion

Post by eliddell »

If you've got music in the game already, adding one more MIDI using the existing set of instruments should increase the size of the game less than adding one more MP3 would. The location of the break-even point where MIDI takes up less space for all the music in the game is going to depend on the file size of your soundfont. In most cases, how many MB or GB a game takes up isn't all that important these days, but trimming it down might theoretically mean the difference between, say, just squeaking in under the default upload size limit at itch.io and having to ask for more space.
User avatar
Pajo
Prole
Posts: 6
Joined: Tue Dec 22, 2020 4:19 pm

Re: Midi format music distortion

Post by Pajo »

One could also reuse instruments by putting several songs within the same module, but Love can't be easily made to play just certain patterns from a module and stop. The main advantage of using MIDI is that if you're used to making music in MIDI format, e.g. with MIDI keyboard, you wouldn't have to convert it to modules, which is somewhat hard and lossy.

When playing MIDI in Love, SF2 should be converted to (several) PATs, which are bigger than SF2. The samples aren't reused between instruments, I don't know if that's the main reason. However, with individual PATs, you can delete the instruments you don't use.

The main problem is that MIDI still doesn't play well in Windows. It works on Linux, and Android, so that's some kind of a bug. It definitely doesn't just do beeps, it tries to play the instruments but somehow fails and loops them oddly. Maybe it should be tried with some other soundfont, I didn't check, and I don't have the Windows machine at hand.
User avatar
zorg
Party member
Posts: 3074
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Midi format music distortion

Post by zorg »

Pajo wrote: Wed Mar 10, 2021 3:45 pm One could also reuse instruments by putting several songs within the same module, but Love can't be easily made to play just certain patterns from a module and stop.
This is correct, unfortunately; the only solution would be a library that implements parsing modules and all the "advanced" functionality as well.
Pajo wrote: Wed Mar 10, 2021 3:45 pm The main advantage of using MIDI is that if you're used to making music in MIDI format, e.g. with MIDI keyboard, you wouldn't have to convert it to modules, which is somewhat hard and lossy.
The disadvantage is that MIDI doesn't supply the actual instrument sounds; what fonts your hardware/software synth has is what it'll use to play back the notation with. (E.g. check out the Transport Tycoon Deluxe OST-s on youtube, there are lots of versions of it exactly because it's midi - AdLib, SoundBlaster, Gravis Ultrasound, Roland SC-88, etc.) - Unless you can distribute the sounds, it may sound inconsistent.
Pajo wrote: Wed Mar 10, 2021 3:45 pm When playing MIDI in Love, SF2 should be converted to (several) PATs, which are bigger than SF2. The samples aren't reused between instruments, I don't know if that's the main reason. However, with individual PATs, you can delete the instruments you don't use.
Probably an artefact of timidity being old that it (only?) supports PAT patches... not sure though.
Pajo wrote: Wed Mar 10, 2021 3:45 pm The main problem is that MIDI still doesn't play well in Windows. It works on Linux, and Android, so that's some kind of a bug. It definitely doesn't just do beeps, it tries to play the instruments but somehow fails and loops them oddly. Maybe it should be tried with some other soundfont, I didn't check, and I don't have the Windows machine at hand.
On windows, it does do beeps only, on my end at least; no timidity config file, no patches -> everything's a simple waveform, don't remember whether sine or square or whatever. If you did manage to put the config file where it "needs to be" and converted instruments from a soundfont to the necessary format, then maybe the conversion process is what failed.



Anyway, regarding what i said about a library providing advanced playback for module files, something like that can also work with MIDI as well, and it wouldn't need to rely on timidity either.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests