VOGONS


Yamaha XG emulation at last

Topic actions

First post, by mattw

User metadata
Rank Oldbie
Rank
Oldbie

hi All, I just want to give you heads-up that MAME almost completed the full emulation of "Yamaha SWP00" chip:

https://github.com/mamedev/mame/blob/master/s … sound/swp00.cpp

that's the chip marked as "XQ036A00" on your Yamaha DB50XG, DB60XG (NEC XR385 OEM board), SW60XG ISA card and inside units like MU-10 and MU-50.

that opens up a lot of new possibilities for people that are interested in the subject, for example:

* emulation of Yamaha SW60XG card in projects like 86box
* new standalone (open-source) MUNT-like or VSTi for Yamaha XG, replacement for 'S-YXG50'
* making Yamaha SOL VSTi using the WaveROMs from the real hardware [EDIT] (because now how the samples are compressed is known, as I read in one online article "Yamaha are truly masters at sound design and compression" - that's now clear to be true)[/EDIT] , i.e. the effort I started here:

Re: Yamaha Sequence Object Linking (SOL) 2

and subsequently abandoned unfinished. Please, note that SOL VSTi is not crippled like most SoftSynths - indeed it uses very crippled 8-bit samples, but it can be patched to unlock 16-bit, plus internally it uses 44.1kHz sample-rate, etc. So, with a little patching it gives real high-res audio output. it's probably the most powerful SoftSynth ever released after those patches are applied and probably that is, because Yamaha were using it for internal testing of their hardware disabling the high-res for the public releases.

* hacking Yamaha WaveROMs to include GS sounds from the Roland ROMs (still it's an open question how exactly Roland compressed the samples in their WaveROMs - in fact if you look at 'swp00.cpp' source code you will see the Yamaha way is pretty sophisticated)

etc etc etc.

So, a lot of new possibilities for anyone interested in preserving the old Yamaha synths.

Last edited by mattw on 2023-10-24, 03:22. Edited 3 times in total.

Reply 1 of 54, by mattw

User metadata
Rank Oldbie
Rank
Oldbie

I've just built the latest MAME from source code and indeed "Yamaha MU-50" is loading and playing its Demo Song in the Emulator:

mu50_01.jpg
Filename
mu50_01.jpg
File size
48.63 KiB
Views
3657 views
File comment
MU-50 Emulation in MAME
File license
Public domain
mu50_02.jpg
Filename
mu50_02.jpg
File size
36.93 KiB
Views
3657 views
File comment
MU-50 loading its demo song in MAME Emulator
File license
Public domain
mu50_03.jpg
Filename
mu50_03.jpg
File size
54.63 KiB
Views
3657 views
File comment
MU-50 Playing its demo song in MAME Emulator
File license
Public domain

So, yeah, what an achievement - Kudos to MAME !

However, for regular users you will need to wait for the next official MAME release, because building from the source code as I did and setting it up at the moment, I think is not that easy as when MAME release it officially.

Reply 2 of 54, by mattw

User metadata
Rank Oldbie
Rank
Oldbie

This thing is really rocking, especially for an initial release, compared to the current Yamaha SoftSynths with crippled 8-bit samples, MAME sounds much much better with the high-end WaveROMs, I played XG file:

mame mu50 -midiin myxg.mid

and it's detecting it with flashing "XG" on the MAME Emulated LCD of the MU-50 unit just before starts playing it:

mame_mu50_xg_midi.png
Filename
mame_mu50_xg_midi.png
File size
75.11 KiB
Views
3613 views
File license
Public domain

Reply 3 of 54, by Thermalwrong

User metadata
Rank Oldbie
Rank
Oldbie

Thanks for sharing this - it looks pretty interesting 😀
I have an MU10 but comparing this with the emulated version would be fun and it's an interesting way to get sound. Isn't the MU-50 functionally equivalent to the DG50XG?
Will there be a way to send MIDI data to it over a USB midi adapter?

Reply 4 of 54, by mattw

User metadata
Rank Oldbie
Rank
Oldbie
Thermalwrong wrote on 2023-10-24, 17:03:

I have an MU10 but comparing this with the emulated version would be fun and it's an interesting way to get sound.

if you look at the source code:

https://github.com/mamedev/mame/blob/master/s … sound/swp00.cpp

the only thing currently mentioned as "slightly inexact" are 2 tables, but they can be made exact with further testing with the real hardware.

Thermalwrong wrote on 2023-10-24, 17:03:

Isn't the MU-50 functionally equivalent to the DG50XG?

I don't have DG50XG card - I have XR385 (DB60XG OEM version for NEC) and I can tell you it's 100% the same as MU-50 and even give you details to prove that:

1) the WaveROMs are the same (including the DG50XG card), as chips on the board those are:

(MU50) XQ057C0.IC18 = (DB50XG/DB60XG/XR385) XQ730B0.IC6
SHA1: 32f653c7644d060f5a6d63a435ae3a7412386d92

(MU50) XQ058C0.IC19 = (DB50XG/DB60XG/XR385) XQ731B0.IC7
SHA1: adf68689b4842ec5bc9b0ea1bb99cf66d2dec4de

2) as I don't have DG50XG card, I don't have its Control ROM dump to say more about that, but Control ROM dump from MU-50 and one from XR385 show, the "Wave Data Tables" (which gives where each Sound is located in the WaveROMs and its basic parameters) are located respectively at file offset 0x4631C and at file offset 0x707E6, both with size of 18 192 bytes and between the 2 they are byte-by-byte Identical, which means with absolute certainty MU-50 is just the stand-alone unit of DB60XG/XR385 and of SW60XG ISA card (which essentially is DB60XG on ISA interface).

Thermalwrong wrote on 2023-10-24, 17:03:

Will there be a way to send MIDI data to it over a USB midi adapter?

yes, on MAME command line to deal with that you're using "-midiout", "-midiin" (it takes either MIDI device including USB one or MIDI file as I showed in my previous post). Also, you can use "-wavwrite" to write to WAV file the same time you're listening and even the more cooler "-aviwrite" to write to AVI video file (on that video is everything happens on the LCD display of the emulated MU-50 unit).

[EDIT] and forgot to mention, you can use "-listmidi" to list the MIDI devices in your system and see how MAME sees your USB MIDI adapter, in order to know which one to pass to MAME to use it on the command line .

Reply 5 of 54, by gerwin

User metadata
Rank l33t
Rank
l33t

Good to see this.
It is now in the 0.260 release, with only one binary package: mame0260b_64bit.exe
Release note snippet quoted below.
Hope that this synthesizer code also appears elsewhere in a .. more portable way.

New systems marked not working ------------------------------ -mu50: Add the db50xg roms. They may even be the correct ones swp […]
Show full quote

New systems marked not working
------------------------------
-mu50: Add the db50xg roms. They may even be the correct ones swp00: Add most of the AWM. Missing the lpf and the meg.
[Olivier Galibert]

--> ISA Soundcard Overview // Doom MBF 2.04 // SetMul

Reply 6 of 54, by mattw

User metadata
Rank Oldbie
Rank
Oldbie
gerwin wrote on 2023-10-25, 02:55:

Hope that this synthesizer code also appears elsewhere in a .. more portable way.

I hope the same, but I am not optimistic, because MAME made us Intelligent mode MPU-401 emulator and even dumped the real Roland ROM over 10 years ago:

MAME Roland MPU-401 Emulator

and yet the other projects instead to use that - decided to reinvent the wheel...

gerwin wrote on 2023-10-25, 02:55:

Add the db50xg roms. They may even be the correct ones swp00: Add most of the AWM. Missing the lpf and the meg.

that's now like over 1 month old note, LPF and the MEG are added, you can read as comments in the current source:

https://github.com/mamedev/mame/blob/master/s … sound/swp00.cpp

even with significant details what AWM(2) and MEG are and how they work. Plus about the "correct" ROM: me and another member here @jwt27 (through me) personally participated in clarifying the ROMs, few other people not members here (at least AFAIK) also helped and so the ROMs are now fully cleared. It's really now more or less like in fully completed state, waiting next official MAME 0.260 (or 0.261) release to hit the public.

Reply 7 of 54, by APN_K

User metadata
Rank Newbie
Rank
Newbie
mattw wrote on 2023-10-24, 02:48:
I've just built the latest MAME from source code and indeed "Yamaha MU-50" is loading and playing its Demo Song in the Emulator: […]
Show full quote

I've just built the latest MAME from source code and indeed "Yamaha MU-50" is loading and playing its Demo Song in the Emulator:

mu50_01.jpg

mu50_02.jpg

mu50_03.jpg

So, yeah, what an achievement - Kudos to MAME !

However, for regular users you will need to wait for the next official MAME release, because building from the source code as I did and setting it up at the moment, I think is not that easy as when MAME release it officially.

Any recording of it in action either with audio or also video?

Reply 9 of 54, by mattw

User metadata
Rank Oldbie
Rank
Oldbie
Trelokk wrote on 2023-10-25, 22:15:

How does this fare compared to the S-YXG50 VSTi plugin? Is any difference noticable to the ear of the average user?

I already answered to that question, in big details even in my initial post and subsequently in very simple words here:

Re: Yamaha XG emulation at last

however, as I see it might not be clear and that could be the reason why no one join to help me with:

Re: Yamaha Sequence Object Linking (SOL) 2

let me take the time to explain again:

1. I guess by "S-YXG50 VSTi plugin" you mean Veg's release, but whatever you mean, all variants of S-YXG50 even those that are not VSTi, but for example Windows drivers, etc. use extremely crippled 8-bit samples.

Also, now when we know how on real DB50XG/DB60XG/MU50 samples are compressed in its 4MB WaveROM, the statement that 4MB bank of S-YXG50 (which is uncompressed) is 'dump' from the hardware SoundBank is false. in fact DB50XG/DB60XG/MU50 4MB WaveROM is compressed and uncompressed is double digits in size (I am not giving exact number here, because I haven't made a tool that can decompress it yet and MAME decompresses it on-the-fly while playing and only those samples needed by the current MIDI file that is playing). Last, but not least, Veg's S-YXG50 is based on the trial version - that doesn't matter much, because it's patched to disable the trial

2. the real so-to-say, as it's not Trial version S-YXG50 VSTi comes as part of Yamaha SOL2:

Re: Yamaha Sequence Object Linking (SOL) 2

it also by default uses crippled 8-bit samples, but it can be patched to do 16-bit ones, I don't want to repeat myself, because I already spoke about it in my 1s post in this thread.

In very short, the simplest for the community to go, if there is a community, is patch SOL2 VSTi to use 16-bit and the high-end WaveROM samples from the real hardware - as you can see in that old thread I already did the hard work of cracking the encryption. That is not an easy task, especially, when there is no community to work on it, and so I guess we all will use MAME instead.

Now, to finish, MAME emulation as using the high-end WaveROM samples from the real hardware sounds amazing compared to any current S-YXG50 with crippled 8-bit samples, it cannot even compare and even a deaf can make the difference - those 8bit samples gives very obvious noise, while in MAME - the sound is clear with no any noise.

Last edited by mattw on 2023-10-25, 23:31. Edited 1 time in total.

Reply 10 of 54, by mattw

User metadata
Rank Oldbie
Rank
Oldbie
APN_K wrote on 2023-10-25, 21:06:

Any recording of it in action either with audio or also video?

I am too lazy to do that, but the command line is:

mame mu50 -midiin <you_midi_file>.mid -aviwrite video.avi

that will creative video with everything that is happening on the MU50 Emulated Display with the sound of the MIDI file playing.

Reply 12 of 54, by mattw

User metadata
Rank Oldbie
Rank
Oldbie
kinkong wrote on 2023-10-26, 15:37:

I must be blind, I can't seem to find xq730b0.ic9 or xq731b0.ic10 in any of the mame ROM packs

I don't know on this as it took me like few minutes to locate them with Google:

* "MAME 0.260 ROMs" : contains the 2 WaveROM files
* MAME ROM packs since like forever contain the Control ROM v1.04 from May 22, 1995
* "MAME 0.261 SL/CHD" : contains the new Control ROM v1.05 from Aug 21, 1995

BTW, it seems MAME 0.260 is now released as well, I don't know if the level of support is the same as what I built from the source code and showed in the previous posts - maybe that is scheduled for the 0.261 release, I am yet to test the 0.260 release...

Last edited by mattw on 2023-10-26, 17:33. Edited 1 time in total.

Reply 13 of 54, by mattw

User metadata
Rank Oldbie
Rank
Oldbie
mattw wrote on 2023-10-26, 17:12:

BTW, it seems MAME 0.260 is now released as well, I don't know if the level of support is the same as what I built from the source code and showed in the previous posts - maybe that is scheduled for the 0.261 release, I am yet to test the 0.260 release...

yes, MAME release 0.260 is working not the level of support I have with what I built from source code (i.e. I guess that is scheduled for the next 0.261 release), but the emulation is running - now I don't need to use Linux (where I built it from source code), but just run MAME official 0.260 release for Windows:

mame260_mu50.png
Filename
mame260_mu50.png
File size
33.21 KiB
Views
3023 views
File comment
MAME release 0.260 running MU-50 emulation in my Windows 7 x64 machine
File license
Public domain

So, yeah, now it's really accessible to the general user, but next 0.261 release will be even more existing.

Reply 16 of 54, by mattw

User metadata
Rank Oldbie
Rank
Oldbie
kinkong wrote on 2023-10-26, 17:35:

The 2 WaveROM files are indeed in a 0.260 pack. I was previously looking in 0.259 which didn't have them. Thanks!

yep, but it's a little bit messy at the moment, because "xq730b0.ic9" and "xq731b0.ic10" is calling the files upon DB50XG chip location, on DB60XG/XR385 they are IC6 and IC7 and the latest MAME source code is using "xq057c0.ic18" and "xq058c0.ic19", which is the MU-50 names and all those are the exact same files, just giving them different filenames, as per the table I put here:

Re: Yamaha XG emulation at last

APN_K wrote on 2023-10-26, 17:41:

Just tested it in MAME 0.260, it's still glitchy with wrong instruments playing on various midis, with clicks and pops. Guess will have to wait until 0.261 unless someone uploads a recent build.

I am not surprised, the current code has a lot of additional fixes...in fact even "mulcd.svg" file is not the same between 0.260 and the current code (presume what will be 0.261) and thus I guess even in the Emulated MU-50 LCD code there are improvement in the latest code.

Reply 17 of 54, by mattw

User metadata
Rank Oldbie
Rank
Oldbie

BTW, if someone wants to build MAME from source code - it's very easy to be done in Linux, I described the process here:

Re: MAME Roland MPU-401 Emulator

So, you don't really need to wait for any official releases, if you're OK to use Linux.

Reply 18 of 54, by sherman

User metadata
Rank Newbie
Rank
Newbie
mattw wrote on 2023-10-26, 17:43:
yep, but it's a little bit messy at the moment, because "xq730b0.ic9" and "xq731b0.ic10" is calling the files upon DB50XG chip l […]
Show full quote
kinkong wrote on 2023-10-26, 17:35:

The 2 WaveROM files are indeed in a 0.260 pack. I was previously looking in 0.259 which didn't have them. Thanks!

yep, but it's a little bit messy at the moment, because "xq730b0.ic9" and "xq731b0.ic10" is calling the files upon DB50XG chip location, on DB60XG/XR385 they are IC6 and IC7 and the latest MAME source code is using "xq057c0.ic18" and "xq058c0.ic19", which is the MU-50 names and all those are the exact same files, just giving them different filenames, as per the table I put here:

Re: Yamaha XG emulation at last

APN_K wrote on 2023-10-26, 17:41:

Just tested it in MAME 0.260, it's still glitchy with wrong instruments playing on various midis, with clicks and pops. Guess will have to wait until 0.261 unless someone uploads a recent build.

I am not surprised, the current code has a lot of additional fixes...in fact even "mulcd.svg" file is not the same between 0.260 and the current code (presume what will be 0.261) and thus I guess even in the Emulated MU-50 LCD code there are improvement in the latest code.

Are you sure there are any actual improvements since 0.260 was tagged?

The only MU50 related commit I see when browsing the commit history is this one: https://github.com/mamedev/mame/commit/8a574d … ec0f402cbf0f349

Like @APN_K has noted, emulation is still quite glitchy. However, it's rather dependent on the MIDI track as to how noticeable the problems are. For example, there are some tracks in Descent II that sound very good, other tracks such as those from Sam & Max really show the issues.

Reply 19 of 54, by mattw

User metadata
Rank Oldbie
Rank
Oldbie
sherman wrote on 2023-10-27, 19:42:

Are you sure there are any actual improvements since 0.260 was tagged? The only MU50 related commit I see when browsing the commit history is ...

in that 0.260 release the WaveROM files are still called "xq730b0.ic9" and "xq731b0.ic10" and so it's for sure this change:

https://github.com/mamedev/mame/commit/e96df7 … 0e2b521ea47c608

and all subsequent changes are not included in 0.260 release, because that's the point when the WaveROM files were renamed to "xq057c0.ic18" and "xq058c0.ic19".

sherman wrote on 2023-10-27, 19:42:

Like @APN_K has noted, emulation is still quite glitchy.

I see no problems in Linux (where I built myself the latest source code), but in Windows using the official 0.260 EXE file, the performance is very poor - it skips even when I open my Firefox browser, after that it cannot recover and some noise is introduced in the sound, etc. So, I don't know if you mean those problems, but at least I have those with the official 0.260 EXE file in Windows. In any way from this point further it will only improve...