Repository navigation
Restore built-in FluidSynth effects - #1814
Conversation
|
Trying to get a handle on context.. The SF2 specification came out in 1998, essentially post-dating the DOS General MIDI era (http://www.synthfont.com/SFSPEC21.PDF); which explains why mid-90's DOS-era soundfont rips sound rather antiseptic and flat -- because the hardware didn't have these effect-filters available. That said, we certainly want modern-era soundfont instruments to be constructed as accurately as possible per the SF2's authors specification, and if FluidSynth can do it, let's not get in the way of that (it makes sense, a piano's size and material will give it its own inherent reverb and chorus behavior). In parallel to per-instrument internal reverb and chorus, at the game-level, users might still want ambient reverb for the "game space" in which the music is played (say, in a cathedral or cavern), which only the GM2 specification (circa 1998) offered at the system-level (which I suppose post-1998 GM2-based games could programmatically control): The GM1 specifcation, when DOS reigned, only offered simpler effects, without system-level reverb or chorus: And summarized here http://www.stevenestrella.com/midi/, But users with external gear could still add these effects to old DOS games - so I think we still want Some examples using Heretic: staging-pr-fsynth_reverb-on.mp4staging-main-reverb-huge.mp4staging-main-reverb-off.mp4 |
|
Good job unearthing those specs, @kcgen, I've learned a few new things about the GM standard! In a nutshell, you've convinced me that the user should have the option to turn off the onboard FluidSynth reverb completely, and opt for the new mixer-level reverb instead. The jury is still out whether it is desirable to add the two on top of each other, but yeah, by giving the user complete control over the two reverbs, this would be a possibility. In the spirit of furthering our knowledge about all things DOS-audio, here's a few remarks.
It was actually introduced much earlier. From Wikipedia: "The original SoundFont file format was developed in the early 1990s by E-mu Systems and Creative Labs. A specification for this version was never released to the public. The first and only major device to utilize this version was Creative's Sound Blaster AWE32 in 1994." "SoundFont 2.0 was developed in 1996. This file format generalized the data representation using perceptually additive real world units, redefined some of the instrument layering features within the format, added true stereo sample support and removed some obscure features of the first version whose behavior was difficult to specify." So we can conclude that the SoundFont format was effectively introduced to the DOS-gaming world in 1994 with the release of the AWE32.
It doesn't quite explain it the way you're suggesting, as the AWE32 has onboard reverb and chorus, so those effects were available for SoundFont authors from the moment the SF2 format became available. I think it's more down to individual taste — some SoundFont authors just don't like reverb, apparently. From Wikipedia again: "The synthesizer section consisted of the EMU8000 synthesizer and effects processor chip, 1 MB EMU8011 sample ROM, and a variable amount of RAM (none on the SB32, 512 KB on the AWE32; RAM was expandable to 28 MB on both cards). These chips comprised a powerful and flexible sample-based synthesis system, based on E-mu's high-end sampler systems such as the E-mu Emulator III and E-mu Proteus. The effects processor generated various effects (i.e. reverb and chorus) and environments on MIDI output, similar to the later EAX standard on Live! and newer cards. It can also add effects to the output from the Yamaha OPL3's FM synthesis. The AWE32 was the first sampler to support E-Mu's SoundFont standard, which allowed users to build custom sound sets using their own samples, the samples included in ROM, or both. The card was sold with software for building custom SoundFonts. All of Creative's subsequent cards, other than the Sound Blaster PCI64/128 series, support SoundFonts. " So it's pretty clear from this that the SoundFont format started to conquer the world from 1994 onwards, with reverb and chorus support from the moment it was introduced. So let's have a look at Creative_1mgm.sf2, which is supposed to be the official SoundFont 2 version of the original AWE32 ROM soundset released later by Emu/Creative Labs themselves (btw, you can find all important DOS-gaming related SF2 files on this page). I loaded it into the Polyphone SF2 editor, and as you can see, while the reverb is fixed on all instruments in this particular soundfont, the chorus settings vary per instrument (chorus & reverb send percentages ordered by descending order): But then some SF2 files are authored quite dry and upfront, I think that's what you're referring to. But that was an authoring choice, they could have cranked up the reverb to 100 on all instruments if they wanted. This is from Creative's own Creative Labs 2M GM_2gmgsmt.sf2: Okay, let's look at something more modern, the popular Timbres Of Heaven GM_GS_XG_SFX V 3.4 Final.sf2: Now we're talking, there's a good amount of reverb on many of the instruments. If you scroll down to the bottom, some instrument have little or even zero reverb. So clearly, the author made some decisions on what should sound upfront and dry, and what should be drenched in reverb. A popular SC-55 recreation just uses 50% for everything: I could go on, but it's easy to see a pattern — it's all over the place. It's also important to realise that the SF2 file only specifies per-instrument reverb and chorus send levels as percentages, but says absolutely nothing about the specifics of the reverb itself — not even its relative volume in relation to the samples. I guess the assumption is to use "sensible" levels, comparable to the level of the samples, then the user could adjust the reverb room size preset according to taste. So by choosing a short room, medium room, or large cathedral room size preset in the SF2 player itself, or adjusting the master level reverb volume, one could coax quite different sounds out of the exact same SF2 file. Our default FluidSynth settings just happen to be some kind of middle-of-the-road settings we've taked fromt the ScummVM project — probably not particularly suited to any SF2 file, but sounds OK with most of them, but probably not spectacular with any of them. So given all of the above, by enabling
I still think that 1) is the best option for SoundFonts, but the current very generic reverb & chorus presets taken from ScummVM sound a bit anemic with many SF2 files, I agree. The current ability to fully customise the FS reverb & chorus is good, but I think we also need to introduce presets, similar to the global reverb. Then one could simply just say So, what I'm proposing is to enable global reverb sends to the FluidSynth channel. The FluidSynth reverb would be restored and turned on by default, and the new global reverb would be off, so existing users wouldn't notice any change in behaviour. I'll include a short notice in the description of the And for completeness' sake, I still want to leave MT-32 completely alone — no global reverb & chorus sends for that channel. How does this sound? |
|
Sounds great - and thank you for the clarifications regarding SF2 spec and how DOS era hardware /did/ have access to reverb and chorus! Given hardware reverb and chorus were available, it's actually unfortunate the GM 1.0 spec didn't include handling for system-level reverb, which no doubt lead to some SF2 authors over-soaking their instruments with reverb to try to compensate; your handful of SF2 examples is very interesting! With SF2's all over the board reverb-wise, I fully agree with your proposal to allow toggling both the SF2-specific reverb level (via FluidSynth) and the mixer-level reverb, given it's the only way to handle the combinations you've nicely described.
Makes sense!
Sound like an ideal way forward - thanks for sharing all your findings, @johnnovak! |
Yeah, and we need to make sure to document it adequately but succinctly so non-technical users who are disinterested in all this historical context can get the most out of their SF2 files. ...in the new upcoming documentation project 🎉 |
33a24da to
04b7935
Compare
|
Made the changes as discussed @kcgen. |
|
Looks good, @johnnovak ! |








In the SF2 SoundFont format, different chorus and reverb settings can be assigned to individual instruments layers. The creators of such SoundFonts can (and do) tweak the effect levels of different instruments to achieve the desired outcome. Therefore, removing the FluidSynth chorus and reverb and replacing them with global effect processing at the audio channel level is just not feasible.
I've tried a few different SF2 files with the new global processing, and compared them to the old behaviour, and unsurprisingly, everything sounds way off with the global effects. It's just not possible to find a single global preset that would work well — that's easy to understand conceptually, e.g. some instruments in any given SF2 file might have 0% reverb applied to them, while some other instruments might have 100% reverb, etc. Apart from the samples used, the per-instrument chorus & reverb choices give all the different SoundFonts their sonic character — we definitely don't want to alter or remove that!
The situation is similar to the MT-32 emulation; there the reverb & chorus levels are being controlled dynamically by the MIDI data, therefore we can't just replace those effects with some fixed global processing either.
Really, FluidSynth and MT-32 must be treated as hardware-synthesizers that do their own instrument-level effect processing and/or dynamic processing based on MIDI data, therefore mixer level effects should always be disabled for them.
Sorry, @kcgen that I missed this when you raised your first PR for removing the FluidSynth reverb; somehow I forgot about this...