Page 1 of 1

Custom soundfont/sample library for MIDI playback

Posted: Sat Mar 24, 2018 4:10 pm
by heilkitty
Is it possible to use a custom soundfont for MIDI playback in DFU, as of now? The default one (provided by Unity, I assume) is kinda bad (or, at least, not suitable for Daggerfall soundtrack). Or, maybe, an option to output through a MIDI device.

Re: Custom soundfont/sample library for MIDI playback

Posted: Sat Mar 24, 2018 10:06 pm
by Interkarma
Unity has no MIDI support. The chosen default SoundFont was very carefully selected to provide the right balance of file size and baseline quality, and has a clear-cut open license. If you can find a higher quality open license SoundFont that is around 30MB, I'd be interested in a link. :)

But to answer your question, Daggerfall Unity can use any compatible SF2 format SoundFont. At this time, this is not exposed to end user by mod system. This is something we need to make available at some point so end users can drop in whatever SoundFont they want to use.

Re: Custom soundfont/sample library for MIDI playback

Posted: Sun Mar 25, 2018 4:43 am
by heilkitty
OK, I've found the soundfont in the source tree and played several soundtrack files with it. My initial consclusion seems too harsh now, sorry. However there are still some objective problems.
Some instruments are out of balance, so in some of the songs the accompaniment is much louder than the melody (e.g. FM_SQR2, SQUARE_2, GRUINS).
Some instruments are not played by DFU, as it seems. I've "rendered" the main theme using Audacious and DFU's soundfont, and here's the result: https://soundcloud.com/akakij-bzdrishch ... i-5-strong Skip to 0:27 to hear the piece I'm talking about.
As for alternate soundfonts, TimGM6mb from MuseScore 1.3 weights about 6Mb, and the instruments are balanced well. On the other hand, it tends to sound more "natural" than Chorium, so if your goal is to provide "old school" sound out of the box, it's not quite suitable.

Re: Custom soundfont/sample library for MIDI playback

Posted: Sun Mar 25, 2018 4:54 am
by Interkarma
Thanks! That isn't an SF I came across earlier and the license and size are both great.

I'll have a play with it and see how it sounds. :)

Re: Custom soundfont/sample library for MIDI playback

Posted: Sun Mar 25, 2018 5:00 am
by heilkitty
Is this project: https://github.com/n-yoda/unity-midi used for MIDI playback?

Re: Custom soundfont/sample library for MIDI playback

Posted: Sun Mar 25, 2018 5:36 am
by Interkarma
No, but I also use C# Synth Project as the base. It can be adapted to Unity without many troubles and I've made some minor Daggerfall Unity specific changes as well. See the "Licenses" folder for where I've used other open source code in this project.

It's been a while now (I added MIDI synth around 2014/2015) but I believe this is the information I followed to make Unity-specific changes and went from there.

Re: Custom soundfont/sample library for MIDI playback

Posted: Tue Mar 27, 2018 3:30 pm
by King of Worms
Just a sidenote.. i feel that if the sound font is 30 or 300 mb does not matter that much, if the music quality is improved. Ppl are used to 10s of gb in size when we talk games.

That soundcloud demo sounded nice, the vocal-like sound after 27s made it epic ,)

Re: Custom soundfont/sample library for MIDI playback

Posted: Tue Mar 27, 2018 3:49 pm
by heilkitty
King of Worms wrote: Tue Mar 27, 2018 3:30 pm i feel that if the sound font is 30 or 300 mb does not matter that much
The idea is to make the DFU "vanilla" package compact, I guess, so 150+Mb soundfont is too much.
King of Worms wrote: Tue Mar 27, 2018 3:30 pm That soundcloud demo sounded nice, the vocal-like sound after 27s made it epic ,)
That's what it's supposed to sound with DFU's soundfont, but it currently don't, because of imperfections in that C# MIDI library (unfortunately, we don't have a choice, as I understand).

Re: Custom soundfont/sample library for MIDI playback

Posted: Fri Apr 27, 2018 1:46 pm
by Interkarma
heilkitty wrote: Sun Mar 25, 2018 4:43 am As for alternate soundfonts, TimGM6mb from MuseScore 1.3 weights about 6Mb, and the instruments are balanced well. On the other hand, it tends to sound more "natural" than Chorium, so if your goal is to provide "old school" sound out of the box, it's not quite suitable.
I've had a play with TimGM6mb. It sounds great and it's around 4.5x smaller than chorium. I've switched over to this now, which should cut around 20MB from distribution size. I'll see what feedback I get once next round of builds are up. Thanks for the suggestion. :)