Skip to content

X68000 mdx files to vgm

Technical discussion about the VGM format, and all the software you need to handle VGM files.

Moderator: Staff

  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

That would actually result in a bit worse sound quality and much larger file sizes, as the samples are converted from ADPCM to PCM, then mixed and converted back to ADPCM for streaming. By using another sound chip, you only have to store the samples once in the file and the samples should sound a bit better as they're not being recompressed...
  • User avatar
  • Delek Offline
  • Posts: 41
  • Joined: 2012-05-05, 16:39:51

Post by Delek »

Exactly :P , for that reason I posted:
Delek wrote:That will complicate a little bit the stream data in the .vgms.
I'm afraid that mdx2vgm will need to use a multichannel PCM soundchip while playing PCM8 mdxs, as you said, ctr.
But before that we need to figure out how does PCM8 selects the sample to trigger, here:
https://github.com/LeonardoDemartino/md ... ore.h#L511

Post by vampirefrog »

I'm currently writing a MML compiler, so maybe ctr can help you instead.

Post by vampirefrog »

Ideally, you'd make it a command-line option: generate mixed ADPCM output like X68Sound.dll or use a multi-channel PCM chip, choose which chip, and so on and so forth.
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

vampirefrog wrote:I'm currently writing a MML compiler, so maybe ctr can help you instead.
if you just need something quick, i made a quick and dirty asm template (for a 68K assembler) that you can use to create MDX files.
  • Shywolf Offline
  • Posts: 41
  • Joined: 2015-11-01, 22:18:27

Post by Shywolf »

Two things:
  • Stereo panning of ADPCM is not working. (Samples are played back only "centered" in the .vgm)
  • Different speeds of ADPCM playback is not working. (15.6/10.4/7.8/5.2/3.9KHz can be selected using the F# command in note.x MML, but the resulting .vgm uses only 15.6KHz)
I made a test .MDX using note.x v0.8.5, which plays fine in hoot. The .MUS is the MML code if this is useful.
Attachments
TOM_TEST.7z
(2.66 KiB) Downloaded 223 times

Post by vampirefrog »

ctr wrote:if you just need something quick, i made a quick and dirty asm template (for a 68K assembler) that you can use to create MDX files.
Thanks, I'm trying to replicate what MXC.X does, and later on NOTE.X, which is pointlessly advanced. Right now I'm trying to use gnu bison to generate the parser.
  • User avatar
  • Delek Offline
  • Posts: 41
  • Joined: 2012-05-05, 16:39:51

Post by Delek »

I'm trying to figure out where is the panning, the speed and the sample selection in PCM8 mode for the samples in the disassembly hell of: https://github.com/mitsuman/mdx2wav/blo ... rvg_core.h
Do you guys have any idea about this?
  • ctr Offline
  • Posts: 492
  • Joined: 2013-07-17, 23:32:39

Post by ctr »

Most of that magic happens in the x68sound.dll, see here. The disassembly is really rough, PCM8_SUB() (which takes no arguments, everything is global) calls PCM8.Out() from the DLL. There are no defined constants, so it's a bit hard to follow...
  • User avatar
  • Delek Offline
  • Posts: 41
  • Joined: 2012-05-05, 16:39:51

Post by Delek »

The magic is not happening on that dll because I'm not even using it. :lol: I run the driver only and somehow and in someplaces the driver is telling "sample 1 on channel 1 and sample 4 on channel 2", "pcm stereo to xx", "pcm speed to xx" but I can't find it in the disassembly C code. This will take longer than expected... :(

Post by vampirefrog »

and that is why I'm writing it from scratch, instead of messing with some 30 year old code

Post by vampirefrog »

yo Delek take a look at this beauty http://vgmrips.net/mirror/mdxplay-20070206.tar.gz
  • User avatar
  • blitzlunar Offline
  • Posts: 126
  • Joined: 2012-12-21, 15:30:24
  • Location: UK

Post by blitzlunar »

This has already proven very useful to me!

I converted Spindizzy II from the MDX files I have, and retagged them for my own purposes - all that is missing is a track order/numbers and perhaps gzip compression. I thought I'd share them here too, in case this interests anybody else ~ it's a great soundtrack by Toshiya Yamanaka! If anyone wants to take it further for a VGMrips submission that would be splendid, however do bear in mind that A) the source MDX files may be third-party approximations of the soundtrack, rather than fully legitimate and sourced from the software; I am not sure eitherway, B) I haven't listened to the VGM conversion exhaustively and cannot assure its parity with the MDXs at this time (upon initial inspection it sounds fairly accurate though.)

Download here.
  • lo zaffo Offline
  • Posts: 39
  • Joined: 2016-08-03, 22:36:09
  • Location: Italy

Post by lo zaffo »

Terrific project!
I second what ctr says:
if managing .pdx samples (being single ADPCM channel or 8 PCM channels of PCM8 bpard), mdx2vgm could translate to OPL4 wavetable/PCM samples then I could play vgm with MSX with (YM2151)SFG-0x + (YMF-278B)Moonsound/DalSoRi/OPL4ShockWave/FM-BLASTER, and it could be such an achieving moment having real hardware on my side. :drool:
Ciao!

(actually I did some experiments with AIN's mdx player for MSX2/MSX2+/MSXturboR and it (sort of) works for FM part but I don't understand which hardware is supposed to play ADPCM or PCM even though some pdx managing is there. I have also mdx player Z80 assembly sources but not mdxdrv TSR driver sources.)
  • Shywolf Offline
  • Posts: 41
  • Joined: 2015-11-01, 22:18:27

Post by Shywolf »

blitzlunar wrote:... I converted Spindizzy II from the MDX files I have, and retagged them for my own purposes - all that is missing is a track order/numbers and perhaps gzip compression. ...
Someone was working on logging this OST a little while ago. Their pack would be preferred for submission as an "official pack", as it seems they had logged all the songs from the game's sound test.
Post Reply