alinebee / Boxer

The DOS game emulator that's fit for your Mac.
http://boxerapp.com/
773 stars 139 forks source link

Make Emulated MT32 louder #12

Closed t3rminus closed 11 years ago

t3rminus commented 11 years ago

Emulated MT32 is way too quiet when played with SoundBlaster SFX, and there's no way to change it independently. This will increase the output gain so that it's about the same as the SoundBlaster levels.

alinebee commented 11 years ago

Hi t3rminus, could you provide some examples of games that demonstrate the balance problem? The volume issues may be game-specific: some games adjust the MT-32's volume themselves using master volume MIDI signals, while others do not. Uniformly raising the output gain for all games is not necessarily a good idea, if the underlying issue is that the emulated device's master volume is too low by default or is deliberately being set too low by particular games.

alinebee commented 11 years ago

Furthermore, it's worth testing if the same imbalance is present in the same games when playing music through General MIDI instead (where supported). This uses a completely different emulation pathway: if the General MIDI music is also too quiet, this would indicate that the game itself is responsible for playing MIDI at too low a volume (or digital effects at too high a volume) rather than that the MT-32 output is being mixed too quiet by Boxer.

Boxer already corrects this in the case of The 7th Guest, whose speech was way too loud compared to the MIDI music (be it General MIDI or MT-32). The solution was not to boost the MIDI volume, but to disable the game's control over the sound blaster mixer levels, so that both digital audio and MIDI remained at their default volumes.

alinebee commented 11 years ago

Last but not least, please test with Boxer's standalone branch - all recent development work has been done on that branch instead of master, and it includes an update to the munt emulation library that (among other things) affects the emulated volume behaviour.

I should note that a preliminary test with an output gain of 5.0 resulted in very ugly clipping in X-Wing, which would be an unacceptable price to pay for balanced audio otherwise. A better solution would be to lower the volume of the soundblaster for affected games, rather than crank up the volume of the MIDI, as that's inherently nondestructive.

t3rminus commented 11 years ago

Hi alunbestor,

The problem was most pronounced in Lucas Arts adventure games (Monkey Island 1/2, Indiana Jones, Day of the Tentacle), but I did experience it in several others as well.

After doing some more testing, it does seem to be game-specific (general midi is also too quiet, but still louder than MT32 emulation), and several games I tried exhibited the clipping issue with an output gain of 5.0.

I have been unable to get Roland or General MIDI emulation working in the standalone branch. It produces silence, crackle, noise or pops instead of music, but it's possible I've misconfigured something.

Honestly, I didn't actually think of trying to make SB quieter. It seems to me that by default it's playing at the right levels (relative to system volume) and the MT32 emulation is too quiet.

I decided to try patching boxer myself after being unable to find any configuration for mixer levels in either DOSBox or Boxer. Setting [sblaster] mixer=false (which seems to be the fix for The 7th Guest) doesn't seem to have any effect.

After hearing the clipping issues, I can agree it's definitely not a working solution, though...

alinebee commented 11 years ago

I have been unable to get Roland or General MIDI emulation working in the standalone branch. It produces silence, crackle, noise or pops instead of music, but it's possible I've misconfigured something.

There was a regression last week to the MIDI emulation in the standalone branch (caused by stray parts of the printer patch) but I fixed this today. Try it again with the latest code - it's likely that you caught it while it was still broken.

Honestly, I didn't actually think of trying to make SB quieter. It seems to me that by default it's playing at the right levels (relative to system volume) and the MT32 emulation is too quiet.

The sound blaster is almost certainly at the appropriate volume as it is, and the MIDI output is just naturally softer. So, it wouldn't normally be appropriate for Boxer to soften the SB audio to bring out the MIDI; but boosting the MIDI volume in the mix would inherently be lossy, because it's already being rendered at full volume (and the emulated master volume on the MT-32 defaults to 100%, so there's no space to boost it there either).

Bear in mind that in the DOS days, MIDI and SB audio were completely separate outputs that had to be routed to the speakers/amp by the user, who had to get the volumes right themselves - most games probably didn't take that much care in setting up the relative volume levels. I plan to add a UI for controlling individual audio levels in a later release, and ultimately that would be the proper solution to the problem: that way the user can settle on a mix that sounds right for that particular game, for when Boxer (and the game itself) don't have enough info to make the right call.

In the meantime, lowering the relative volume of the sound blaster can be done with the DOSBox MIXER command, which could be added to the [autoexec] section of the gamebox conf file. For instance, the following line will set the SB to 50% volume:

MIXER SB 50:50

t3rminus commented 11 years ago

Bear in mind that in the DOS days, MIDI and SB audio were completely separate outputs that had to be routed to the speakers/amp by the user, who had to get the volumes right themselves - most games probably didn't take that much care in setting up the relative volume levels.

Yeah. Which is why I was pulling my hair out trying to figure out how to properly set the levels. I would never have guessed there was a utility program to do it-- I was looking for a configuration setting. Oh well.

There was a regression last week to the MIDI emulation in the standalone branch (caused by stray parts of the printer patch) but I fixed this today. Try it again with the latest code - it's likely that you caught it while it was still broken.

That sounds like my luck... Thanks for the head's up. I'll let you know.

t3rminus commented 11 years ago

The volume is still the same in the latest standalone code. For a game like Day of the Tentacle, I had to drop the SB volume to ~ 10% and max out MASTER, and turn up my system volume before it sounds alright, but at least it sounds alright.