Page 1 of 1

MIDI rendering with soundfonts

Posted: Mon Jan 16, 2023 3:37 pm
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?

Re: MIDI rendering with soundfonts

Posted: Mon Jan 16, 2023 6:30 pm
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.

Re: MIDI rendering with soundfonts

Posted: Mon Jan 16, 2023 7:03 pm
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.

Re: MIDI rendering with soundfonts

Posted: Tue Jan 17, 2023 7:49 am
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!