Muffled percussion instruments in DOSBox

Developer's Forum for discussion of bugs, code, and other developmental aspects of the Munt Project.

Muffled percussion instruments in DOSBox

Postby marooned_on_mars » 2014-11-17 @ 00:11

I've previously stated that I can hear muffled instruments (esp. percussion) here, but this time I tried it outside of DOSBox and found out it doesn't sound exactly the same:

DOSBox SVN r3871 + munt GIT 16-11-2014 (48000Hz) - Linux (CrunchBang 11 + Unstable Debian repos)
munt Qt GIT 16-11-2014 (library and GUI from the same version - 48000Hz) - Linux (CrunchBang 11 + Unstable Debian repos)
HooT + munt GIT 09-11-2014 - stand-alone library available here (48000Hz) - Windows
HooT + munt GIT 09-11-2014 (32000Hz) - Windows

The crispest sound I get out of HooT (but unfortunately it causes cutoffs/overdrive in some games, not in the recordings above though), the munt GUI sounds close to that, and the DOSBox version sounds the worst, even though it uses the same sampling rate as the GUI/HooT. I've also recorded the same piece on HooT on 32000Hz, and it sounds very similar to how DOSBox sounds at 48000Hz. So my question is, is this some issue with how DOSBox handles audio or is it some other issue?

Also please note, DOSBox + munt ≠ DOSBox + munt Qt GUI
Last edited by marooned_on_mars on 2014-11-17 @ 01:20, edited 1 time in total.
I support Universal Basic Income, and so should you, here's why. Another reason why.
Commonly asked questions about UBI
Spread the word!
User avatar
marooned_on_mars
Member
 
Posts: 361
Joined: 2006-1-23 @ 18:47
Location: MoonBase2

Re: Muffled percussion instruments in DOSBox

Postby truth_deleted » 2014-11-17 @ 01:12

On typical Windows, I believe dosbox+mt32emu routes through directsound, whereas the other method may rely on waveout. However, I don't see any description above on which OS is even used, or whether these tests were done on different operating systems. It's difficult to replicate an audio issue if the test conditions are missing.

I don't know why there is no recording from real hardware above. Other users cannot replicate which sounds "worst" without hearing the expected sound, and even better if more than one recording is included (from different versions of the MT32 device).
truth_deleted
 

Re: Muffled percussion instruments in DOSBox

Postby marooned_on_mars » 2014-11-17 @ 01:30

truth5678 wrote:On typical Windows, I believe dosbox+mt32emu routes through directsound, whereas the other method may rely on waveout. However, I don't see any description above on which OS is even used, or whether these tests were done on different operating systems. It's difficult to replicate an audio issue if the test conditions are missing.


Fixed that, basically DOSBox + munt GUI recordings were done on Linux, with HooT was done on Windows. (don't think there would be much of a difference if I were to record under wine)

I cannot test DOSBox + munt on Windows since ATM I don't have any environment for compiling set up, but I will work on it if it helps.

Also attached the DOSBox config file and hoot.ini, in case anyone wants to test out with the same settings I used. On munt GUI, I used the default settings with the CM-32L ROM, v1.02.

Sorry for leaving out details

truth5678 wrote:I don't know why there is no recording from real hardware above. Other users cannot replicate which sounds "worst" without hearing the expected sound, and even better if more than one recording is included (from different versions of the MT32 device).


Because I don't have the real hardware? Unfortunately I don't have any real MT-32/CM-32L devices to test against, but I've heard quite a few recordings of real MT-32s and the percussion shouldn't sound like that. If anyone has any device free for testing I can give the midi file, otherwise I can't help with that.
Basically I'm here to ask about the DOSBox part of munt or the patches, not exactly about the accuracy compared to the real hardware (as I stated above, I cannot prove this or that sounds inaccurate since I don't have the real hardware)
You do not have the required permissions to view the files attached to this post.
I support Universal Basic Income, and so should you, here's why. Another reason why.
Commonly asked questions about UBI
Spread the word!
User avatar
marooned_on_mars
Member
 
Posts: 361
Joined: 2006-1-23 @ 18:47
Location: MoonBase2

Re: Muffled percussion instruments in DOSBox

Postby truth_deleted » 2014-11-17 @ 01:54

If you are to answer your original question, it is ideal to have a test against real hardware. That way it can be determined which sounds "worst". It would allow others to hear the result, too.

The munt author also previously explained the likely cause of "muffled percussion" in the thread you referenced. Perhaps you missed his post in that thread, but that is an obvious starting place to test the issue, especially since he has written a significant portion of the emulator.
truth_deleted
 

Re: Muffled percussion instruments in DOSBox

Postby marooned_on_mars » 2014-11-17 @ 02:07

truth5678 wrote:If you are to answer your original question, it is ideal to have a test against real hardware. That way it can be determined which sounds "worst". It would allow others to hear the result, too.


Sure it is, but again, it's not strictly about accuracy in this case. As I said I suspect it might be with the way DOSBox resamples/handles audio (if it is about resampling) or something about the DOSBox mt32emu patch.

truth5678 wrote:The munt author also previously explained the likely cause of "muffled percussion" in the thread you referenced. Perhaps you missed his post in that thread, but that is an obvious starting place to test the issue, especially since he has written a significant portion of the emulator.


I did see sergm's replies in that thread, and I replied to what he said as well. It still doesn't explain why things sound differently between applications when using the same sampling rate. And why DOSBox @ 48000Hz sounds (almost) the same as HooT @ 32000Hz
I support Universal Basic Income, and so should you, here's why. Another reason why.
Commonly asked questions about UBI
Spread the word!
User avatar
marooned_on_mars
Member
 
Posts: 361
Joined: 2006-1-23 @ 18:47
Location: MoonBase2

Re: Muffled percussion instruments in DOSBox

Postby truth_deleted » 2014-11-17 @ 02:13

Those recordings were all done on developmental versions of the MT32 emulation? It may be worthwhile to test with the official version 1.40, instead of code which has been undergoing modification daily.
truth_deleted
 

Re: Muffled percussion instruments in DOSBox

Postby sergm » 2014-11-17 @ 07:56

Good catch, marooned_on_mars!

As I mentioned in http://www.vogons.org/viewtopic.php?p=387863#p387863, DOSBox patch cannot use 'accurate' emulation of analogue LPF, so it always runs the emulation @ 32kHz. Even if you set DOSBox mixer to 48kHz output rate. DOSBox mixer simply does resampling (well, linear interpolation is a way of resampling too, heh). So, the high frequency spectra boosted in the default 'coarse' mode is further attenuated by the linear interpolator of DOSBox. I assume, you are probably aware of why people bother with filters, sincs and so forth instead... This is basically the main reason I always suggest to avoid resampling if it is possible.

In contrast, mt32emu-qt thing has fully incorporated analogue emulation stuff, so you can play with the analog mode switch and hear the difference. You can even play with quality settings of the resampler you use (it's hard-coded to the fastest sinc-based interpolation by now, though). The Windows driver has been also updated but it sucks to have no UI.

I don't forget about the DOSBox patch, and I plan to update it soon. Moreover, I also plan to add an optimised sinc-based resampler that is to be bit-accurate yet not to eat memory like libsamplerate nor to waste time with FFT (there is really really no need for it in munt case) like libsoxr. Especially, no reason to rush so you're able to do proper comparisons. ;)

However, it seems munt suffers a lot more of lack of proper MIDI parser. So, I put this issue to a higher priority. At the end, sending multiple/fragmented sysexes should no longer be a problem on Windows (and perhaps with OSS raw MIDI ports).
sergm
Oldbie
 
Posts: 744
Joined: 2011-2-23 @ 16:37

Re: Muffled percussion instruments in DOSBox

Postby marooned_on_mars » 2014-11-17 @ 18:04

sergm wrote:As I mentioned in http://www.vogons.org/viewtopic.php?p=387863#p387863, DOSBox patch cannot use 'accurate' emulation of analogue LPF, so it always runs the emulation @ 32kHz. Even if you set DOSBox mixer to 48kHz output rate.


That explains it.
LPF = Low Pass Filter?
Also I'm curios now in which way HooT uses the munt library, as it sounds very crisp, and doesn't have the problems DOSBox has. I'll ask on the HooT thread above :D

sergm wrote:DOSBox mixer simply does resampling (well, linear interpolation is a way of resampling too, heh).


A little bit off-topic but do you know if this happens with the other sound modules provided by DOSBox? (OPL*, internal MIDI like Gravis, Tandy, etc.)
In that case it would make very little sense in changing the sampling rate to 49716Hz when using OPL.

sergm wrote:In contrast, mt32emu-qt thing has fully incorporated analogue emulation stuff, so you can play with the analog mode switch and hear the difference. You can even play with quality settings of the resampler you use (it's hard-coded to the fastest sinc-based interpolation by now, though). The Windows driver has been also updated but it sucks to have no UI.


Alright, I'll make sure to use the GUI emulator for the time being :)

sergm wrote:I don't forget about the DOSBox patch, and I plan to update it soon. Moreover, I also plan to add an optimised sinc-based resampler that is to be bit-accurate yet not to eat memory like libsamplerate nor to waste time with FFT (there is really really no need for it in munt case) like libsoxr.


Sounds good :D

sergm wrote:Especially, no reason to rush so you're able to do proper comparisons. ;)


?

sergm wrote:However, it seems munt suffers a lot more of lack of proper MIDI parser. So, I put this issue to a higher priority. At the end, sending multiple/fragmented sysexes should no longer be a problem on Windows (and perhaps with OSS raw MIDI ports).


Awesome, looking forward for it :D
Thanks for your contributions to the project sergm :)
I support Universal Basic Income, and so should you, here's why. Another reason why.
Commonly asked questions about UBI
Spread the word!
User avatar
marooned_on_mars
Member
 
Posts: 361
Joined: 2006-1-23 @ 18:47
Location: MoonBase2

Re: Muffled percussion instruments in DOSBox

Postby sergm » 2014-11-18 @ 08:03

marooned_on_mars wrote:LPF = Low Pass Filter?


True.

Also I'm curios now in which way HooT uses the munt library, as it sounds very crisp, and doesn't have the problems DOSBox has. I'll ask on the HooT thread above :D


Also, the most correct way to get it clear. Unfortunately, I barely find time for munt itself :(

A little bit off-topic but do you know if this happens with the other sound modules provided by DOSBox? (OPL*, internal MIDI like Gravis, Tandy, etc.)
In that case it would make very little sense in changing the sampling rate to 49716Hz when using OPL.


The correct way is to ask somewhere in DOSBox threads. AFAIK, the mixer is an optimised fixed-point-math linear interpolator. Perhaps, it was improved recently, didn't look. But the true is, this kind of resampling affects the signal in an _audible_ way.

Alright, I'll make sure to use the GUI emulator for the time being :)


No need, in fact. Use the tooling most suited your needs. As I noted before, the output you get can be post-processed. This includes high-quality resampling, applying the LPF emulation, equalising, etc. The analogue emulation implemented is nothing more then applying the theoretical response of analogue LPF used in real modules. But it is necessary to note, analogue circuits rarely perform in a perfect way. Besides, the properties of electronic parts degrade with time... KingGuppy proposed me once to add emulation of the time effects :D

Awesome, looking forward for it :D
Thanks for your contributions to the project sergm :)


I hope it'll help at least one guy :)
sergm
Oldbie
 
Posts: 744
Joined: 2011-2-23 @ 16:37

Re: Muffled percussion instruments in DOSBox

Postby Mok » 2014-11-18 @ 16:44

marooned_on_mars wrote:Also I'm curios now in which way HooT uses the munt library, as it sounds very crisp, and doesn't have the problems DOSBox has. I'll ask on the HooT thread above :D

Hoot uses munt directly without any changes, there's a simple resampling bridge (the source code is included with hoot, as they cannot include dll binary, it's a closed source project). The reason for the overdrive is their internal volume settings for mt32 emulator dating from very old versions of munt, ie. they amplify the output from munt which causes distortion. A simple workaround is to modify munt library to decrease the output by 40-60% and the distortions will most likely disappear.

The difference is sound is harder to explain, it might be simply because dosbox emulates the whole game while hoot only emulates the sound code alone. There might be a bug in the game or in the hoot driver (many hoot bridges/drivers do not use code taken directly from the emulated game but a generic one from the soundsystem used by the game) etc. So you really should be comparing against a real synth.
User avatar
Mok
Newbie
 
Posts: 69
Joined: 2003-1-11 @ 11:59

Re: Muffled percussion instruments in DOSBox

Postby sergm » 2014-11-18 @ 17:08

@Mok
Thanks for the clarification. I believe 'a simple resampling bridge' may appear a source of enough change in the frequency spectra. And the overdrive distortions as well. But the real issue with the 'muffled' sounding which MoM doesn't really want to hear is exactly the imperfection of the implementation in the real hardware analogue path. So, the worse it sounds, the better for MoM. :D
sergm
Oldbie
 
Posts: 744
Joined: 2011-2-23 @ 16:37

Re: Muffled percussion instruments in DOSBox

Postby marooned_on_mars » 2014-11-18 @ 17:34

sergm wrote:So, the worse it sounds, the better for MoM. :D


That really depends on (perhaps) subjective preferences. I for one don't want my recordings to sound like they were downsampled or the MT-32 "orchestra" put towels and clothes over their rhythm sections. I won't pretend to know much about how any of the LA synths work (that's why you're contributing to this project and not me) but I did hear a lot of recordings from real hardware (mainly on YouTube and CVGM but also from QuestStudios) and I can tell that the "muffled sound" problem is not present.
I support Universal Basic Income, and so should you, here's why. Another reason why.
Commonly asked questions about UBI
Spread the word!
User avatar
marooned_on_mars
Member
 
Posts: 361
Joined: 2006-1-23 @ 18:47
Location: MoonBase2

Re: Muffled percussion instruments in DOSBox

Postby Mok » 2014-11-18 @ 17:41

sergm wrote:@Mok
Thanks for the clarification. I believe 'a simple resampling bridge' may appear a source of enough change in the frequency spectra. And the overdrive distortions as well. But the real issue with the 'muffled' sounding which MoM doesn't really want to hear is exactly the imperfection of the implementation in the real hardware analogue path. So, the worse it sounds, the better for MoM. :D

The resampler in hoot was added only recently (relatively speaking, a few months after you forced the output to be always at 32k), and the overdrives were present waaay before that (it's been years since I started lowering munt output volume when compiling the bridge). It's just hoot is closed source so it's not possible to disable it's internal amplifying, and the devs are japanese which makes "contributing" hard (I tried once, years ago, won't try again). Anyway it's a hoot problem and not a munt one, so no need to discuss here :)
User avatar
Mok
Newbie
 
Posts: 69
Joined: 2003-1-11 @ 11:59

Re: Muffled percussion instruments in DOSBox

Postby truth_deleted » 2014-11-18 @ 18:10

marooned_on_mars wrote:
sergm wrote:So, the worse it sounds, the better for MoM. :D

That really depends on (perhaps) subjective preferences.

It's not subjective, it's based on comparing real hardware to emulation. This comparison may even be done with equipment to measure the sound properties, although even a verified recording is insightful. However, it is better than we make conclusions based on recordings we have done rather than referencing youtube samples from unknown sources and unknown test conditions.
truth_deleted
 

Re: Muffled percussion instruments in DOSBox

Postby sergm » 2014-11-18 @ 18:12

@marooned_on_mars
Well, ignoring Hoot existence, what do you feel comparing the output of mt32emu_qt when you change "Analog emulation mode" setting (note: it requires saving the synth profile and restarting the synth to take effect)?
sergm
Oldbie
 
Posts: 744
Joined: 2011-2-23 @ 16:37

Re: Muffled percussion instruments in DOSBox

Postby sergm » 2014-11-18 @ 18:22

You're right, truth5678. This should be done properly this way. Unfortunately, DSP doesn't operate with such categories like "muffled" and "crisp". Only with impulse / frequency responses. :)
On the other hand, even real hardware units do sound differently due to burned resistors, leaking capacitors, dust, etc. My own RA-50 even doesn't sound at all :D
sergm
Oldbie
 
Posts: 744
Joined: 2011-2-23 @ 16:37

Re: Muffled percussion instruments in DOSBox

Postby marooned_on_mars » 2014-11-18 @ 18:59

truth5678 wrote:It's not subjective, it's based on comparing real hardware to emulation.


I think you might have misunderstood what I said, I wasn't calling sergm's "opinion" as subjective (as I said, sergm clearly has a better idea of how the MT-32 & co. function/process signals than me), but I was calling out that just because I prefer munt to sound a certain way does not mean I prefer things to sound "worse".

truth5678 wrote:This comparison may even be done with equipment to measure the sound properties, although even a verified recording is insightful. However, it is better than we make conclusions based on recordings we have done rather than referencing youtube samples from unknown sources and unknown test conditions.


I won't argue with you on this one, I'd be happy to provide recordings from real hardware together with the test conditions, or anything else that is required (IIRC sergm required FFT scans as well some time ago) to test but as I stated earlier I cannot provide those. It wasn't just YouTube I was "referencing" earlier, there's also RMLA that states on which exact model they recorded their stuff, but even that's not enough to be able to test accurately.

sergm wrote:@marooned_on_mars
Well, ignoring Hoot existence, what do you feel comparing the output of mt32emu_qt when you change "Analog emulation mode" setting (note: it requires saving the synth profile and restarting the synth to take effect)?


Will test that out in the following days.
I support Universal Basic Income, and so should you, here's why. Another reason why.
Commonly asked questions about UBI
Spread the word!
User avatar
marooned_on_mars
Member
 
Posts: 361
Joined: 2006-1-23 @ 18:47
Location: MoonBase2

Re: Muffled percussion instruments in DOSBox

Postby marooned_on_mars » 2014-11-23 @ 06:04

Okay, so I've tried all three modes, coarse analogue path emulation is inbetween digital and accurate sound-wise. Also apparently it still plays/exports @ 32000Hz, and I assume that's expected. Coarse sounds a tad bit better than what I've got out of DOSBox, so I assume this is what you wanted to hear? :)
I support Universal Basic Income, and so should you, here's why. Another reason why.
Commonly asked questions about UBI
Spread the word!
User avatar
marooned_on_mars
Member
 
Posts: 361
Joined: 2006-1-23 @ 18:47
Location: MoonBase2

Re: Muffled percussion instruments in DOSBox

Postby sergm » 2014-11-23 @ 17:47

Basically. Thanks, glad to hear your opinion. :)
sergm
Oldbie
 
Posts: 744
Joined: 2011-2-23 @ 16:37

Re: Muffled percussion instruments in DOSBox

Postby NewRisingSun » 2014-12-06 @ 21:21

I love the analogue sound emulation, and want to encourage you to keep updating smf2wav and release one with that feature as well for people like me who hate GUIs. :)

Normally, I would compile it myself, but it uses glib, which seems to be a real pain to compile under MingW.
NewRisingSun
Oldbie
 
Posts: 811
Joined: 2005-9-02 @ 02:26

Next

Return to MT-32 Development

Who is online

Users browsing this forum: No registered users and 1 guest