FM PCM Player

Page 1/2
| 2

By Grauw

Ascended (9342)

Grauw's picture

12-01-2020, 16:51

I’ve released my PCM player for the YM2413 OPLL MSX-MUSIC.

Not only does it play PCM in high 8-bit quality, but it also shows a nice wave visualisation effect while doing so. It requires MSX2, MSX-DOS2, and several megabytes of memory is recommended.

It works by forcing the phase generator to hold on a specified phase using test register bit 2. This allows it to index into the sine table and produce accurate near 8-bit sample playback with a simple inverse lookup table.

The playback is timed by synchronizing to the VDP line drawing frequency, which provides a good high-frequency timer on MSX2 that is CPU speed independent. Additionally it lets us render the nice visualisation.

Project page:
http://www.grauw.nl/projects/fmpcm/

Login or register to post comments

By Grauw

Ascended (9342)

Grauw's picture

12-01-2020, 17:33

You can see the FM PCM player in action in this video (Youtube). Captured straight from my MSX turboR (with audiofix) with OSSC and Elgato CamLink 4K.

Leading up to this release the techniques used were discussed in the following places:

https://twitter.com/Grauw/status/1208845242201509888
https://www.msx.org/forum/development/msx-development/limita...

As far as I know this is the first time anyone used this method for PCM playback on YM2413.

By knm1983

Champion (504)

knm1983's picture

12-01-2020, 17:18

Guauuu Is impressive audio quality , congratulations for this work Wink

By knm1983

Champion (504)

knm1983's picture

12-01-2020, 17:50

Grauw, can I convert an MP3 music to a raw 8bit and 16khz??
I try with audacity program but the sound don’t work correctly
Thanks

By Grauw

Ascended (9342)

Grauw's picture

12-01-2020, 18:02

After you’ve loaded a wave in Audacity you need to:

  1. Select the track
  2. “Tracks / Mix / Mix Stereo Down to Mono”
  3. “Tracks / Resample…”, then enter 15700
  4. Change “Project Rate” in the lower left corner to 15700
  5. “File / Export / Export Audio…”, then “Header: RAW” and “Encoding: Signed 8-bit PCM”

Optionally if the original wave’s volume is low, before exporting you can normalise it using “Effect / Normalize…” and then setting “Normalize Peak Amplitude to: 0.0 dB” and turning off the other options.

By knm1983

Champion (504)

knm1983's picture

12-01-2020, 18:11

Yes , I try this options exactly , with option /r pcm turbo r , work ok , with fm the sound is sshhhhh

By Grauw

Ascended (9342)

Grauw's picture

12-01-2020, 19:00

Ah, I must mention: you must use an MSX-MUSIC with a real YM2413 chip. None of the PC emulators nor FPGA emulations so far support the test register bits, also the synthesis emulation may not be accurate enough. I hope the emulations will be improved as a result of this software being available.

Three weeks ago Nuke.YKT released his Nuked OPLL emulation which is very accurate and plays back correctly. Last I heard Wouter is working on optimizing it so it can be integrated into openMSX. I think Okazaki’s emu2413 also improved its emulation to support this a few weeks ago.

Nuked OPLL is also written in a style that makes it relatively easy to translate to FPGA code, so I hope someone will do this as well and then 1chipMSX, Carnivore2, GR8NET and FlashJacks can be updated.

The /r (TurboR PCM) option currently exists as a workaround to allow trying it in emulators.

By knm1983

Champion (504)

knm1983's picture

12-01-2020, 18:29

Ahhhhh okok , thanks very much for this information , yes I try with output turbo r and work ok.
Eso impressive de quality with fm pac , thanks again Grauw

By alexito

Hero (631)

alexito's picture

12-01-2020, 18:49

Hey, Grauw good job man.

Testing the PCM DAC on OCM

Here is my try with my Zemmix Neo BR and recently flashed firmware Ver 3.8 and Turbo R BIOS on SDCARD.

Video

By Grauw

Ascended (9342)

Grauw's picture

12-01-2020, 18:52

Nice! I see the /r option also comes to the rescue for the 1chipMSX Smile. I’ll add a loop function to the wishlist. Also wav file support; it works in principle, but you’ll hear some noise at the start and the end from the headers.

By knm1983

Champion (504)

knm1983's picture

12-01-2020, 18:57

I ear de music from PCM of FlashJacks and de sound is incredible , spectacular quality

Page 1/2
| 2