All MSX has PCM sound

Page 1/3
| 2 | 3

By DarkSchneider

Paladin (882)

DarkSchneider's picture

20-05-2018, 10:07

Did you know that every MSX has a 1-bit DAC?

https://www.konamiman.com/msx/msx2th/th-5a.txt

Quote:

1.3 Tone Generation by 1-bit Sound Port

MSX has another sound generator in addition to the PSG. This is a simple one that generates sound by turning ON/OFF the 1-bit I/O port output repeatedly using software.

Why is this feature ignored so much?

I think is used in Super Laydock at load screen, in Rune Master 2 at the final boss, and maybe Ikari Warrios when die (but in this cause maybe is using the PSG, or at higher rate).

IMO it can gives depth to certain important events. I see it really interesting and very ignored. And it seems easy to use and only need to set 1 bit.

Don't know if there are tools for converting to 1-bit. If not, convert audio to 8-bit PCM WAV, and convert that to 1-bit RAW PCM simply removing the header, reading each byte value, AND 80h, and storing at its position in the new byte value (as a byte can fit 8 bit values).

Login or register to post comments

By Metalion

Paladin (1019)

Metalion's picture

20-05-2018, 11:00

It is ignored because mainly the result is so poor.

By Grauw

Ascended (8516)

Grauw's picture

20-05-2018, 11:46

It's what the key click uses.

By DarkSchneider

Paladin (882)

DarkSchneider's picture

20-05-2018, 12:39

Metalion wrote:

It is ignored because mainly the result is so poor.

Could be poor in ROM that lacks of capacity. On disk like Rune Master 2 is pretty nice, the final boss is much nicer and would not be the same with the b*stard not laughing on your face when you miss the attack, or screaming when die.

By Manuel

Ascended (15842)

Manuel's picture

20-05-2018, 13:06

It's also that playing the sample takes 100% CPU time.

Isn't it also used in the Aackosoft games, or do they use the PSG?

By DarkSchneider

Paladin (882)

DarkSchneider's picture

20-05-2018, 13:15

Good question, as PSG can also play samples. But the code to play them on the DAC is very little and easy.

It really does not takes 100% CPU, but usually is dedicated to play the sample because sync. So I use the question to ask, how could be the sample played correctly?. A good sync method should be used, so you can't rely on a fixed CPU speed. Maybe distributing some line interrupts? By this way also the CPU would not be halted completely for playing the sample, as is not required so much CPU power really.

It would be worth to dedicate a moment to this, because if worked can get good result from it. Imagine that can use samples in real time not stopping the CPU. Playing 1-bit samples I think it really does not take much CPU. We could pass from 6 FM channels + FM drums to 9 FM channels + PCM sampled drums.

By MsxKun

Paladin (924)

MsxKun's picture

20-05-2018, 14:44

Well, Beepertron uses it. Parachuteless Joe and Cow Abductors too. And some others maybe.
That the code is little and easy doesn't mean it leaves much CPU left to make anything else. So it's not practical except for what it was already used and some other strange things.

By santiontanon

Paladin (850)

santiontanon's picture

20-05-2018, 15:39

Very interesting! I never knew this! Is there any sample code somewhere of how to use this? (even just using the 100% CPU usage method)

By ARTRAG

Enlighted (6287)

ARTRAG's picture

20-05-2018, 15:54

By DarkSchneider

Paladin (882)

DarkSchneider's picture

20-05-2018, 16:49

MsxKun wrote:

Well, Beepertron uses it. Parachuteless Joe and Cow Abductors too. And some others maybe.
That the code is little and easy doesn't mean it leaves much CPU left to make anything else. So it's not practical except for what it was already used and some other strange things.

In math, for 8KHz sample would be about 8000/60 = 133 DAC data send per interrupt. Not sure how much CPU is that.

But I think even for secondary usage is interesting. A sample at the correct time gives a good impression, as said to emphasize some events could be nice.

By syn

Paragon (1920)

syn's picture

20-05-2018, 17:33

The keyclick is used in zxspectrum beeper music, (mixing a number of musical channels into 1). Reason being they did not all have a AY/psg.

We talked about it briefly here https://www.msx.org/forum/msx-talk/general-discussion/better..., some examples are posted there as well.

and no, its not practical to use in a game when stuff is moving, unfortunately. Imho better use SCC/music module/opl4 if you want samples.

Page 1/3
| 2 | 3