VOGONS


More accurate MUNT (MT32 emulation) patch

Topic actions

Reply 40 of 78, by Malignant Manor

User metadata
Rank Newbie
Rank
Newbie
Dominus wrote:

the bird chirping is very muted and not the right sound

I found an option to enable more accurate pitch in mt32emu.h which may fix this.

#define MT32EMU_ACCURATENOTES 0

Change to:

#define MT32EMU_ACCURATENOTES 1

It has a note that it could be very slow. I'm not sure about the speed because it doesn't compile.

partial.cpp: In member function 'void MT32Emu::Partial::initKeyFollow(int)':
partial.cpp:145:68: error: invalid types 'MT32Emu::Bit32s [217][float]' for array subscript
partial.cpp: In member function 'void MT32Emu::Partial::startPartial(MT32Emu::dpoly*, const MT32Emu::PatchCache*, MT32Emu::Partial*)':
partial.cpp:171:128: error: cannot call member function 'MT32Emu::File* MT32Emu::Tables::initNote(MT32Emu::Synth*, MT32Emu::NoteLookup*, float, float, float, MT32Emu::PCMWaveEntry*, MT32Emu::File*)' without object

Reply 41 of 78, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie

Check these and try compiling again.
line 145 of partial.cpp

realVal = synth->tables.tvfKeyfollowMult[((int)noteVal - MIDDLEC) + 108];

line 171 of partial.cpp

synth->tables.initNote(synth, &noteLookupStorage, noteVal, (float)synth->myProp.sampleRate, synth->masterTune, synth->pcmWaves, NULL);

Reply 43 of 78, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie
Malignant Manor wrote:

That allows it to compile. It cause stuttering for me (some bottleneck probably). Unfortunately, it didn't seem to do anything to help the intro sound.

Yes, that might cause stuttering as it involves more calculations for accuracy. I noticed tiny differences in some games.

Dominus, what if you change "asm volatile" to "__asm__ __volatile__" in a function 'void cpuID()'? Does it compile for MacOS?

Another thing... I need some sample musics of MegaMan X playing in real MT-32. (menu and level 1 music)

Reply 44 of 78, by TeaRex

User metadata
Rank Member
Rank
Member
ykhwong wrote:

Another thing... I need some sample musics of MegaMan X playing in real MT-32. (menu and level 1 music)

Here you go. Recorded via DOSBox and a MIDIMATE-II USB-to-MIDI interface from a real first-generation MT-32. The level1 music has a few seconds of the title music in front, but I was too lazy to edit that out.

PS: Moderators, is it OK to post files of this size here? If not, feel free to delete them. In that case, can you, ykhwong, give me a mail address to send them to, or a place to upload them?

Attachments

  • Filename
    megamanx-title.ogg
    File size
    1.12 MiB
    Downloads
    389 downloads
    File license
    Fair use/fair dealing exception
  • Filename
    megamanx-level1.ogg
    File size
    1.18 MiB
    Downloads
    434 downloads
    File license
    Fair use/fair dealing exception

tearex

Reply 45 of 78, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

TeaRex: Attachment size and type is under Snover's purview, as he is both the forum admin and site host. I assume he has set limits that he is comfortable with, so you should have nothing to worry about.

Reply 46 of 78, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie
TeaRex wrote:

Here you go. Recorded via DOSBox and a MIDIMATE-II USB-to-MIDI interface from a real first-generation MT-32. The level1 music has a few seconds of the title music in front, but I was too lazy to edit that out.

Thanks for the files, TeaRex. 😀 After hearing your oggs, I decided to get rid of a hack that I have added since v2 right now.

Attachments

  • Filename
    mt32.diff
    File size
    213.18 KiB
    Downloads
    348 downloads
    File license
    Fair use/fair dealing exception

Reply 47 of 78, by HunterZ

User metadata
Rank l33t++
Rank
l33t++

I tried Mega Man X on MT-32, OPL and GM out of curiosity, and it sounds completely awful to me on all but GM. I'd have expected the OPL music to be awesome since it's a Capcom game, but this is what happens with PC games when they use sound drivers that treat OPL chips like MIDI synths 🙁

Reply 48 of 78, by kode54

User metadata
Rank Member
Rank
Member

You can solve the clipping issue with i386_mixBuffers, i386_mixBuffersRingMix, and i386_produceOutput1, by using paddsw instead of paddw. I don't know what's up with i386_partialProductOutput, though.

Reply 49 of 78, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie
kode54 wrote:

You can solve the clipping issue with i386_mixBuffers, i386_mixBuffersRingMix, and i386_produceOutput1, by using paddsw instead of paddw. I don't know what's up with i386_partialProductOutput, though.

Awesome, it fixes the issue indeed. 😀

Reply 50 of 78, by Shock

User metadata
Rank Newbie
Rank
Newbie

Hey guys and especially ykhwong, I just registered to thank-you for your work on getting MT-32 emulation to work better with DOSBox. It's always given me a headache and I've never been able to get Munt to work. This package seems to make it work.

I have a big program though, I've just tried it with Police Quest II (from the original floppies 🤣!) as that is a game whose soundtrack was designed from the beginning for Roland MT-32 but it sounds terrible on my machine. The lead instruments are all out of pitch and tune and velocity. Is there something wrong with my install or is it just the nature of the current implementation? I'm using the test version 5 from the first page in this thread. I threw the MT-32 roms in the Dosbox folder.

Here is how it sounds on my computer, with many instruments out of tune:
http://members.shaw.ca/snk/pq2mt32emu.mp3

And here is how it sounds on a real Roland MT-32
http://www.youtube.com/watch?v=0dcRmvNYp4s

Any ideas? Thanks!

Reply 51 of 78, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie
Shock wrote:
Hey guys and especially ykhwong, I just registered to thank-you for your work on getting MT-32 emulation to work better with DOS […]
Show full quote

Hey guys and especially ykhwong, I just registered to thank-you for your work on getting MT-32 emulation to work better with DOSBox. It's always given me a headache and I've never been able to get Munt to work. This package seems to make it work.

I have a big program though, I've just tried it with Police Quest II (from the original floppies 🤣!) as that is a game whose soundtrack was designed from the beginning for Roland MT-32 but it sounds terrible on my machine. The lead instruments are all out of pitch and tune and velocity. Is there something wrong with my install or is it just the nature of the current implementation? I'm using the test version 5 from the first page in this thread. I threw the MT-32 roms in the Dosbox folder.

Here is how it sounds on my computer, with many instruments out of tune:
http://members.shaw.ca/snk/pq2mt32emu.mp3

And here is how it sounds on a real Roland MT-32
http://www.youtube.com/watch?v=0dcRmvNYp4s

Any ideas? Thanks!

Don't use it. Try this one.

Attachments

  • Filename
    test6.7z
    File size
    1.34 MiB
    Downloads
    470 downloads
    File comment
    v6 (binary + patch)
    File license
    Fair use/fair dealing exception

Reply 52 of 78, by Shock

User metadata
Rank Newbie
Rank
Newbie
ykhwong wrote:
Shock wrote:
Hey guys and especially ykhwong, I just registered to thank-you for your work on getting MT-32 emulation to work better with DOS […]
Show full quote

Hey guys and especially ykhwong, I just registered to thank-you for your work on getting MT-32 emulation to work better with DOSBox. It's always given me a headache and I've never been able to get Munt to work. This package seems to make it work.

I have a big program though, I've just tried it with Police Quest II (from the original floppies 🤣!) as that is a game whose soundtrack was designed from the beginning for Roland MT-32 but it sounds terrible on my machine. The lead instruments are all out of pitch and tune and velocity. Is there something wrong with my install or is it just the nature of the current implementation? I'm using the test version 5 from the first page in this thread. I threw the MT-32 roms in the Dosbox folder.

Here is how it sounds on my computer, with many instruments out of tune:
http://members.shaw.ca/snk/pq2mt32emu.mp3

And here is how it sounds on a real Roland MT-32
http://www.youtube.com/watch?v=0dcRmvNYp4s

Any ideas? Thanks!

Don't use it. Try this one.

It actually sounds the same with version 6.7, the intruments are still out of tune or sometimes don't even reach the right notes. Listen to the two version. Other games sound decent though so I'm guessing it's just the strange use of chimes and brass modulated through pitch changes in PQ2 that might be causing it to be all out of tune in the emulated version.

Reply 53 of 78, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie

MT-32 manual claims that standard pitch is 442Hz (0x4a), but I set masterTune to 0x40 here (check attachment) since it sounds a bit better when playing Police Quest II.

Attachments

  • Filename
    another_test.7z
    File size
    1.1 MiB
    Downloads
    495 downloads
    File license
    Fair use/fair dealing exception

Reply 56 of 78, by sergm

User metadata
Rank Oldbie
Rank
Oldbie

Hi!

It is very sad that nobody seems to continue developing of Munt, and even that CVS code never been released since 2009.

Of course, there is gulikoza's build already, but in terms of performance and some sort of "thin" sound, it cannot be compared with 0.1.3 release, even for correctness of pitch.

Surprisingly, Ykhwong and me catch with the same opinion that something should be done... While he returns to wavecached ScummVM code, I was continued struggling...

Last times, I've managed to screw through the code, painfully compile the CVS code with WinMM/DM driver, and even do some work on optimize this stuff.

Finally, I've decided to release at last my work and started "Munt Reloaded" 😀 project on sf.net.

So, everyone is invited to looking at my work here: https://sourceforge.net/projects/muntreloaded/files/

Last edited by sergm on 2011-02-23, 18:46. Edited 1 time in total.

Reply 57 of 78, by sergm

User metadata
Rank Oldbie
Rank
Oldbie

P.S.
In short, v. 0.9.1 released 2011-02-23 features:

* It's Based on latest CVS code from Munt. This means precise pitch and modulation of MIDI playback.

* I've overlooked using the complicated and performance unfriendly Blit algorithm for Wave Generation. Instead, i've used fast band-limited WG, that produces more realistic and bright sound.

* Performance optimizations made (besides WG algo, introduced LUTs and fast float calculations for critical sections). Now it can play MIDIs even on 800 MHz Celeron.

* External Interface code synced with the CVS code. We can again have some fun of looking at that MT-32 Front Panel etc... 😎

* There is win32 app available for use in conjunction with MIDI thru, e.g. MIDI Yoke port. It compiled with correct sample rate (32 KHz) and do not require any installing (not counting installing of MIDI Yoke itself).

Reply 58 of 78, by Reckless

User metadata
Rank Oldbie
Rank
Oldbie

Good to see someone willing/able to work on the driver.

A [very] small point - within the readme there's the following:

In the window that pops up, click "Browse..." and choose the directory to which you unpacked the oemsetup.inf and mt32emu.dll files. Click "OK".

That should obviously refer to mt32emu.inf

Will test out how it sounds later tonight.

Reply 59 of 78, by sergm

User metadata
Rank Oldbie
Rank
Oldbie
Reckless wrote:
Good to see someone willing/able to work on the driver. […]
Show full quote

Good to see someone willing/able to work on the driver.

A [very] small point - within the readme there's the following:

In the window that pops up, click "Browse..." and choose the directory to which you unpacked the oemsetup.inf and mt32emu.dll files. Click "OK".

That should obviously refer to mt32emu.inf

Will test out how it sounds later tonight.

O, of course, you're right, Reckless. There is no much time to fully update all docs for now... Let's see how interesting this attempt will be... May be it needs to create another thread/topic for this...