# VOGONS

## Munt Reloaded - Development

### Reply 920 of 964, by BrillieMan

Rank Newbie
Rank
Newbie

While the Sample ROM and Control ROM may be easy enough to dump, dumping the cards is going to be a tad more challenging.

I have dumped some of these pcm-cards I have to see if I could make some with my own samples, to play on my Roland U-220. I'm still looking at how Roland compresses the samples. That's how I stumbled on this thread. Because I hope that the algorithm Roland used to compress samples for the MT-32 would be the same as for the D-110, and maybe also the U-110/U-220. They are all from the same time period. And as the MT-32 is very close to the D-110, the CM-32P is hopefully very close to the U-110.

If I can help in any way, please let me know. I am more than willing to share my info and data.

### Reply 922 of 964, by sergm

Rank Oldbie
Rank
Oldbie
BrillieMan wrote:

I'm still looking at how Roland compresses the samples. That's how I stumbled on this thread. Because I hope that the algorithm Roland used to compress samples for the MT-32 would be the same as for the D-110, and maybe also the U-110/U-220. They are all from the same time period. And as the MT-32 is very close to the D-110, the CM-32P is hopefully very close to the U-110.

At this point, we haven't dealt with CM-32P samples, so there isn't much I can help you with. The sample format may or may not be identical to the one used in MT-32, but I can describe it briefly in a hope that it may give you a clue.

Actually, in MT-32 the PCM samples are not compressed but converted sample-wise. Each 16-bit value stored is the "signed" base 2 logarithm of the linear sample with additional bit shuffling. The "signed" here means that the sign of the original sample is stored intact, and the logarithm is taken from the absolute value, obviously. The exact decoding algorithm can be seen in methods Synth::loadPCMROM() and LA32FloatWaveGenerator::getPCMSample().

I hope that helps 😀

### Reply 923 of 964, by BrillieMan

Rank Newbie
Rank
Newbie

Thank you! That will help loads!

I was looking at the "bit shuffling" part:

`1`int order[16] = {0, 9, 1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 8};``

And I was wondering: where this order information came from? Or what technique was used to see what bits are shuffled?
I am looking at the MT-32 Service manual and can't see any mismatching datalines. (at the moment)
Is the shuffling done inside the LA32?

@HunterZ, I am willing to share the data ("with people who have the cards themselves"), not that I don't want to share... But I don't want to get Roland on my ass for ©op¥right inƒring€m€nt.

### Reply 924 of 964, by sergm

Rank Oldbie
Rank
Oldbie
BrillieMan wrote:

And I was wondering: where this order information came from? Or what technique was used to see what bits are shuffled?
I am looking at the MT-32 Service manual and can't see any mismatching datalines. (at the moment)
Is the shuffling done inside the LA32?

Sorry, this is not my part in the project 😀
Anyway, I'm still able to give a hint. Similar issue I faced with the reverb chip too; the RAM address lines are bit-shuffled as well. Nevertheless, the reverb RAM is scanned with a certain period, and the addresses accessed in the consecutive cycles must increment or decrement by unity, so it was easy to deduce how the bits are actually shuffled.

When dealing with PCM samples, I assume the same technique may be applied. When choosing a sample with slow attack, the logarithmic values will behave similarly, so we don't expect jumps but slow amplitude increase. Also, since we had (yeah, it's now in the past 🙁 ) an opportunity to take digital captures directly at the DAC input, we simply compared bitwise the capture with the output from our model, so it is quite accurate now. Indeed, digital captures can help a lot in emulation of any such hardware 😀

### Reply 925 of 964, by BrillieMan

Rank Newbie
Rank
Newbie

Thanks again! A bit busy so excuse for the late reply, but I'll be measuring tracing circuit boards and logic probing... And when/if I find something useful I'll keep you all posted. Have a nice weekend.

### Reply 926 of 964, by Lord Nightmare

Rank Newbie
Rank
Newbie
HunterZ wrote:

Nice! You should consider putting the dumps on the Internet Archive so they can be preserved.

I'd love to see these sample roms as well, if possible.
EDIT: Ok, I get it, no asking for roms on this forum.

LN

Last edited by Lord Nightmare on 2018-10-08, 15:16. Edited 1 time in total.

"When life gives you zombies... *CHA-CHIK* ...you make zombie-ade!"

### Reply 927 of 964, by Lord Nightmare

Rank Newbie
Rank
Newbie
balrog wrote:
If anyone wants to see a decap image, here you go: […]

If anyone wants to see a decap image, here you go:

https://dl.dropbox.com/s/ellocl0ig0dfc9v/LA32 … -res_3.jpg?dl=1

This is not perfect, but I was able to image it well enough to extract the ROM tables. These are nearly identical to the Yamaha OPL2/3 tables from https://docs.google.com/document/pub?id=18IGx … oAqoIn1rIm42nwo .

They can be generated with the following equations:

the table that has a very visible curve:
f(x) = x == 0 ? 8191 : -1024*log(sin((x+0.5)*pi/1024))/log(2)

The other table has two tables within it:
g(x) = (1-2^(-(x+1)/512))*8192-1
g_delta(n) = 15-(g[n]-g[n-1])

The equations above are not bit-accurate to the decapped sine, exp and exp delta tables. Here's a program which bit-accurately reproduces the 3 tables, and even creates two ascii-art images which 1:1 match the rom arrays on the LA32 die:
https://www.dropbox.com/s/myv5258rgsw6119/la3 … tablegen.c?dl=0

LN

"When life gives you zombies... *CHA-CHIK* ...you make zombie-ade!"

### Reply 929 of 964, by Mok

Rank Newbie
Rank
Newbie
HunterZ wrote:
SLON wrote:

What I have long wanted to ask... Will there ever be support of CM-64?

The only difference between CM-64 and CM-32L is that the CM-64 also includes CM-32P functionality, which is not used by any games as far as I know.

While I have seen plenty of bad MT-32 drivers that send random junk on channels 10-15, what about early Sierra SCI0 games? These definitely send a lot of data on channels 10-15. Is it really random stuff and they disable CM-32P functionality? I have never used CM-64 so cannot check anything myself.

### Reply 930 of 964, by NewRisingSun

Rank Oldbie
Rank
Oldbie

Of course it's not random. It's data for the AdLib and PC speaker. Instead of filtering it out, MT-32 sends it to the MIDI device and uses a System Exclusive Message to have it not played back.

### Reply 931 of 964, by Mok

Rank Newbie
Rank
Newbie
NewRisingSun wrote:

Of course it's not random. It's data for the AdLib and PC speaker. Instead of filtering it out, MT-32 sends it to the MIDI device and uses a System Exclusive Message to have it not played back.

That's what I call '"random" 😀 So they disable it, ok. I have never bothered to take a look at the init code in there, thanks for the info.

### Reply 932 of 964, by BrillieMan

Rank Newbie
Rank
Newbie

Can anybody tell me what the 32787.0f does in the LA32FloatWaveGenerator:
float sampleValue = EXP2F(((pcmSample & 32767) - 32787.0f) / 2048.0f);

https://github.com/munt/munt/blob/master/mt32 … nerator.cpp#L32

We are writing a little utility to "unscramble" the PCM-ROM so you can put in your own samples, and then "scramble" the code again by reversing the algoritme... We first thought it was a typo... But I see it here: https://github.com/munt/munt/blob/master/mt32 … erator.cpp#L212 as well. It seems like such a strange value... What does it do?

### Reply 933 of 964, by Lord Nightmare

Rank Newbie
Rank
Newbie

I threw this together a few months ago, and it decodes/descrambles the PCM roms using 32767.0 rather than 32787.0. I'm curious if the latter being 'correct' is a silicon bug in the LA32...
https://www.dropbox.com/s/q0z01e4t7ov4w3h/la3 … pleparse.c?dl=1
License is GPLV2.

"When life gives you zombies... *CHA-CHIK* ...you make zombie-ade!"

### Reply 934 of 964, by BrillieMan

Rank Newbie
Rank
Newbie

Cheers mister Nightmare! I will look at your code when I have some time later today.
Our code is here: https://drive.google.com/open?id=1Rg11eK8aOFb … VnCvm5Asl-2E7wK
Please take a look and see if you see something interesting. It has both descramble and rescramble routines.

It works okay... even with that strange 32787.0f in it. I can get a MT-32 PCM-ROM descramble it. When importing the file as 32-bit float raw data, in a waveeditor Then I can copy new sounds in it. Save it as a raw file again. Then rescramble that again. Get the SHA hash, and put that into Munt-code. Than select new ROM as the pcm-rom and it all plays the new samples.

The only thing is that it has a bit of a crackle sound. I am investigating if that has something to do with:
The Envelope settings (too fast attack) or That I have to leave the first few samples silent (just as the samples in the original rom)... Or might it be the 32787.0f?

In the above link you can also find a .PDF with pinouts to a few Roland Gate-Array IC's. That are used in the CM-64 and CM-32P... Hope someone has got any use for that.

### Reply 936 of 964, by Falcosoft

Rank Oldbie
Rank
Oldbie

Hi Serg,
I have replied to you on my thread ( I post this here since I do not know whether you get notifications about it)
Re: Falcosoft Soundfont Midi Player + Munt VSTi + BassMidi VSTi

### Reply 937 of 964, by Darklord42

Rank Newbie
Rank
Newbie

Hi it doesn't look like munt compiles with QT5. Complains about:

fatal error: QtGui/QAction: No such file or directory
#include <QtGui/QAction>

-----------------

I got it to compile following some advice from here -> https://github.com/splintermind/Dwarf-Therapist/issues/27

sudo apt-get remove --purge qt4-default qt4-designer qt4-dev-tools qt4-qmake qt4-doc qt4-linguist-tools qtchooser
sudo apt-get install qt5-qmake qt5-default qttools5-dev-tools libqt5script5 libqt5scripttools5 qtscript5-dev

Still a little weird

### Reply 938 of 964, by realnc

Rank Oldbie
Rank
Oldbie
Darklord42 wrote:

Hi it doesn't look like munt compiles with QT5. Complains about:

fatal error: QtGui/QAction: No such file or directory
#include <QtGui/QAction>

Are you calling cmake with "-Dmt32emu-qt_WITH_QT5=YES" ? Also, you can just use "ccmake" instead of "cmake" to get a terminal UI where you can set build options more easily.