MIDI rendering with soundfonts

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
vico
Prole
Posts: 21
Joined: Mon Nov 13, 2017 9:43 pm

MIDI rendering with soundfonts

Post by vico »

Hello!

I was looking through the internet about how to use soundfonts (in .sf2 format) to play MIDI files, what can greatly reduce the size of the project and add a special charm to the game since it doesn't need to rely on the OS soundbank (that in case of Windows is very terrible).

I don't know if Löve natively supports it, but i saw in the wiki something about loading C/C++ libraries (or .dll/.so) and looking through Github i saw two libraries for that: TinySoundFont, that is pretty raw since the dev need to implement all the .mid loading to pass each note through the library to be processed, if i'm not mistaken, and FluidSynth, i already knew about this library since mkxp used it internally, seems to be more easy to play midis through it.

I don't have much knowledge about working with C/C++ libraries or interacting with DLL/SOs, so does anybody here tried to work with libs like these to play mids in a pretty way using Löve?
User avatar
pgimeno
Party member
Posts: 3541
Joined: Sun Oct 18, 2015 2:58 pm

Re: MIDI rendering with soundfonts

Post by pgimeno »

Something similar is under discussion in this thread: viewtopic.php?f=4&t=94188

Read Zorg's comments on how MIDI support works with Löve and what options there are.
User avatar
zorg
Party member
Posts: 3435
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: MIDI rendering with soundfonts

Post by zorg »

To be fair, you could just use a different format that does support sound samples, like the tracker modules löve supports (mod,s3m,xm,it - midi can be converted to these relatively simply by using modplug tracker or whatever else on OSes other than windows).

...that said, i really feel like i should hurry up and make that midi parsing library and softsynth so people can just play around with midi files in löve.
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.
User avatar
vico
Prole
Posts: 21
Joined: Mon Nov 13, 2017 9:43 pm

Re: MIDI rendering with soundfonts

Post by vico »

zorg wrote: Mon Jan 16, 2023 7:03 pm ...that said, i really feel like i should hurry up and make that midi parsing library and softsynth so people can just play around with midi files in löve.
Looking forward this!
Post Reply

Who is online

Users browsing this forum: No registered users and 25 guests