PSG emulation

Page 1/2
| 2

By wolf_

Ambassador_ (9956)

wolf_'s picture

08-01-2007, 12:31

I've been making some cosy PSG drums yesterday in SEE on my 8250, hoping I could properly sample them from an emulator in order to use them. However, it seems that the PSG emulation of NL, Blue and Open all three seriously lack behind. What sounds like a deep snappy bassdrum on the real thing sounds like a weak fart in an emulator. In this particular case the envelopes in the snappy attack ( "Vvave" in SEE ) seem to go wrong, but the rest of the body (normal PSG sound) also seems to be sounding differently. Is every emulator using the same PSG code or what?

An interesting question however is whether the PSG code in the OCM is correct, if it is: perhaps emulator makers could adapt that code in order to improve emulators? (or isn't that allowed? Tongue )

The actual sound to test is quite easy, just pick any channel in SEE as long as snd and vol are the same channel, I used channel 3 in this particular case, but it's not relevant:

snd    vol        wave   time
---------------------------------------
001    Vwave       8      100
400    8
480    7
500    6
500    2
500    2
500    2
400    2
480    2
500    2
600    2

Try it on a real MSX in SEE, then do the same in one of the three emulators I mentioned.

I expect NL to be dead'ish, but could at least the blue- and open ppl have a look into it? Running Naked in a Field of Flowers

(and place some 'End' command one step after the last events on the most left column, or otherwise you'll keep on hearing "600 2" forever)

Login or register to post comments

By dvik

Prophet (2200)

dvik's picture

08-01-2007, 16:00

The PSG emulation in the three emus has no code at all in common. Not sure about the orgin of the NLMSX emulation. openMSX uses the Mame emulation and the blueMSX emulation is written from scratch. I'm quite sure that the core PSG emulation is correct in all three emus. Its really one of the simplest devices to emulate (at least the digital part).

The blueMSX emulation uses a band pass or perhaps a lowpass filter after DA conversion (its been a while since I made it and I don't have the source to check atm). It also has a DC offset filter. It sounds like NLMSX and openMSX also have some kind of filtering and so does a real MSX. The question is probably if these filters are accurate enough. They are definately needed to get something that sounds close to a real MSX but maybe there is something wrong.

Another posibility is that the sharp snap is removed because the emulators are outputting the audio in 44kHz. Your snappy bassdrum envelope could be getting the snap from too quick amplitude changes. Since I don't have any emu or real msx where I am I can't really say if this is the case but I'll do some tests when I get back home.

I'm sure both the blueMSX and openMSX teams wants to fix the PSG emulation if something is wrong with it.

By wolf_

Ambassador_ (9956)

wolf_'s picture

08-01-2007, 16:52


The blueMSX emulation uses a band pass or perhaps a lowpass filter after DA conversion (its been a while since I made it and I don't have the source to check atm). It also has a DC offset filter. It sounds like NLMSX and openMSX also have some kind of filtering and so does a real MSX. The question is probably if these filters are accurate enough. They are definately needed to get something that sounds close to a real MSX but maybe there is something wrong.

Is there any filter in the MSX-engine related to the PSG, or is there any filter in the PSG chip on msx1? If not: why were these filters added? A DC filter might 'clean' in theory but it might exactly be DC filters that could remove these snappy artifacts. Also not 100% sure about the BPF or LPF, just for the sake of experimenting: disable all these PF- and DC-filters and do a test-release .. Tongue (or just send a private test version to me orso)


Another posibility is that the sharp snap is removed because the emulators are outputting the audio in 44kHz.

I doubt this..

I'm sure both the blueMSX and openMSX teams wants to fix the PSG emulation if something is wrong with it.
Running Naked in a Field of Flowers Hannibal

In any case, when you have your hands on an MSX + emu again: do try the SEE thing, you'll hear my point soon enough!

By hap

Paragon (2040)

hap's picture

08-01-2007, 18:28

How accurately does blueMSX/OpenMSX convert the 3.57somethingMhz signal to 44100hz? By taking the approximation of a block from the large buffer, and at the end interpolating the signal? Does it simulate a band limited signal? ( http://www.slack.net/~ant/bl-synth/ )

By Manuel

Ascended (18781)

Manuel's picture

13-01-2007, 11:22

Any news, dvik?

By wolf_

Ambassador_ (9956)

wolf_'s picture

13-01-2007, 11:27

I'm not entirely sure whether I was correct btw.. Tongue I did some recordings from my 8250 (the audio out on the back) and the resulting sounds seem to match quite well, except for the terrible noise (I got a noise floor of -36db which is like 6bit sound!). I'll have to record the same stuff from some emulator again to find differences. I guess my TV made the sounds sound better orso.. crikey.. Running Naked in a Field of Flowers

By Manuel

Ascended (18781)

Manuel's picture

13-01-2007, 11:46

hmmmmmzzzzzz! Please do post some conclusions when you know more Smile

By Shiru

Expert (115)

Shiru's picture

13-01-2007, 22:53

How accurately does blueMSX/OpenMSX convert the 3.57somethingMhz signal to 44100hz?
I don't know answer, but there is no 3.57 MHz, and even 1.75 MHz, signals in AY/YM. They has a clock pre-divider by 8, so max generated frequency about a 218 KHz (YM also has built-in additional divider by 2, which does no require external 3.57/2 divider, as AY does).

By AuroraMSX

Paragon (1902)

AuroraMSX's picture

14-01-2007, 15:38

Hm, on my real NMS8280, that SEE thingy sounds like a pop -- the kind you'd want to remove from an LP recording Cool -- On openMSX it sounds like a PSG base drum...Tongue

By wolf_

Ambassador_ (9956)

wolf_'s picture

14-01-2007, 15:50

How are you listening to the 8280? Through the monitor or something?

By wolf_

Ambassador_ (9956)

wolf_'s picture

14-01-2007, 16:18

btw.. a question for a hardware guru: is the psg sound going through the scart/videocable to a mon/TV a (slightly) different one than the psg sound coming from the audio output at the back of an MSX?

Page 1/2
| 2