vgmrips

The forum about vgm files
It is currently 2020-09-25, 22:55:57

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: X68000 mdx files to vgm
PostPosted: 2017-04-24, 2:20:58 

Programmers Programmers
Contributors Contributors
Offline
User avatar

Joined: 2012-05-05, 16:39:51
Posts: 41
Hello there!
I'm working on a tool to convert mdx files to vgm (only because I want to listen and correctly rip the Namachuukei 68 OST by Yuji Takenouchi, one of the best things in the Chiptune history imho)

The files should be 1:1 replicas of the mdx information because I'm using a direct disassembly of the X68k MXDRV music driver to dump the data! Awesome stuff! 8|
This is the 0.1 alpha version, I think there are some bugs here and there (loop points, sample volume, tempo?) so pelase help me out to test this converter.

I have made versions for Windows and Mac:
http://delek.net/mdx/mdx2vgm_windows.zip
http://delek.net/mdx/mdx2vgm_mac.zip

Usage: mdx2vgm <file>

Source code: https://github.com/LeonardoDemartino/mdx2vgm

_________________
Delek's Website
DefleMask Tracker
Delek's SoundCloud
Delek's YouTube Channel


Last edited by Delek on 2017-05-08, 3:53:39, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: 2017-04-24, 2:35:49 

Contributors Contributors
Staff Staff
Reverse engineers Reverse engineers
Offline
User avatar

Joined: 2013-07-17, 23:32:39
Posts: 438
It seems to be really picky when looking for the PDX file. Apart from that, it seems to work ok on the files i tested it on (with the exception of songs using PCM8)
Code:
PDX FILE: GR_PCM.PDX.pdx
cannot open GR_PCM.PDX.pdx
Error while reading .pdx file: GR_PCM.PDX.pdx.


Also, there's an asm->C disassembly + wrapper for mxdrv here but maybe it's too late for me to point that out now :P


Top
 Profile  
 
 Post subject:
PostPosted: 2017-04-24, 2:47:31 

Programmers Programmers
Contributors Contributors
Offline
User avatar

Joined: 2012-05-05, 16:39:51
Posts: 41
ctr wrote:
It seems to be really picky when looking for the PDX file. Apart from that, it seems to work ok on the files i tested it on (with the exception of songs using PCM8)
Code:
PDX FILE: GR_PCM.PDX.pdx
cannot open GR_PCM.PDX.pdx
Error while reading .pdx file: GR_PCM.PDX.pdx.


Also, there's an asm->C disassembly + wrapper for mxdrv here but maybe it's too late for me to point that out now :P
Hmmm, it seems that some .mdx include the ".PDX" in the header. A workaround for now is to rename the file to PDX.pdx.

_________________
Delek's Website
DefleMask Tracker
Delek's SoundCloud
Delek's YouTube Channel


Top
 Profile  
 
 Post subject:
PostPosted: 2017-04-24, 14:17:42 

Staff Staff
Programmers Programmers
Contributors Contributors
Ball Fondlers Ball Fondlers
Offline
User avatar

Joined: 2014-01-28, 5:51:54
Posts: 714
I also have a mdx to vgm tool, written in C++. Mine doesn't have vibrato and some other fine detail stuff, but iirc it generates decent vgm files.

https://github.com/vampirefrog/mdxtools ... dx2vgm.cpp

BTW, X68Sound.dll uses the same technique of disassembling the X68000 MXDRV and reassembling it as a DLL somehow. Here is a link (download is at the bottom of the page).

Also, interesting enough, he uses a FIR lowpass filter on the OPM.

_________________
vampi.tech


Top
 Profile  
 
 Post subject:
PostPosted: 2017-04-24, 14:40:56 

Programmers Programmers
Contributors Contributors
Offline
User avatar

Joined: 2012-05-05, 16:39:51
Posts: 41
Yes vampirefrog, your work inspired me to do this actually, but I used a different approach after all. Btw I actually wrote in your repository here: https://github.com/vampirefrog/mdxtools/issues/2
but you never replied :(

It is interesting because your code tries to "replicate" the handling of events from the .mdx language directly. My solution is to run the "official" driver with the .mdx/.pdx file and dump what he does (with some variables added to it in order to detect loop points and other stuffs)

_________________
Delek's Website
DefleMask Tracker
Delek's SoundCloud
Delek's YouTube Channel


Top
 Profile  
 
 Post subject:
PostPosted: 2017-04-25, 18:51:58 
Offline
User avatar

Joined: 2012-12-21, 15:30:24
Posts: 73
Location: UK
This is a great idea! I'm not a huge fan of MDX format as it doesn't integrate terribly well with modern media libraries - this seems like the perfect solution.

_________________
http://iridescentaudio.co.uk


Top
 Profile  
 
 Post subject:
PostPosted: 2017-04-25, 20:37:27 

Programmers Programmers
Contributors Contributors
Offline
User avatar

Joined: 2012-05-05, 16:39:51
Posts: 41
Exactly! I will release an update soon with better handling of PDX files, some improvements in the loop points and sample triggering.

_________________
Delek's Website
DefleMask Tracker
Delek's SoundCloud
Delek's YouTube Channel


Top
 Profile  
 
 Post subject:
PostPosted: 2017-04-26, 18:48:46 

Staff Staff
Programmers Programmers
Contributors Contributors
Ball Fondlers Ball Fondlers
Offline
User avatar

Joined: 2014-01-28, 5:51:54
Posts: 714
can you release the source please? I'd like to use it on linux

also, if there is no pdx file (empty filename) it still looks for ".pdx", so I can't use it with, for example, bomberman X68k

also, with these two files, it only plays the kick drum (probably the first sample in the pdx file), no snare, no high-hat, no toms.


Attachments:
castlevania-mdx.zip [116.06 KiB]
Downloaded 129 times

_________________
vampi.tech
Top
 Profile  
 
 Post subject:
PostPosted: 2017-04-27, 4:06:04 

Programmers Programmers
Contributors Contributors
Offline
User avatar

Joined: 2012-05-05, 16:39:51
Posts: 41
Of course vampirefrog, I will upload the source code to GitHub in some minutes. All the bugs you mentioned are fixed with the exception of the sample triggering stuff. I'm trying to figure out how does the mxdrvg parses this data, could you help me out with this in the repo please?

_________________
Delek's Website
DefleMask Tracker
Delek's SoundCloud
Delek's YouTube Channel


Top
 Profile  
 
 Post subject:
PostPosted: 2017-04-27, 4:17:40 

Programmers Programmers
Contributors Contributors
Offline
User avatar

Joined: 2012-05-05, 16:39:51
Posts: 41
Here is the repo: https://github.com/LeonardoDemartino/mdx2vgm

Please work in the branch fix_sample_triggering if you want to help me out with that issue. Thanks!

_________________
Delek's Website
DefleMask Tracker
Delek's SoundCloud
Delek's YouTube Channel


Top
 Profile  
 
 Post subject:
PostPosted: 2017-04-27, 4:45:07 

Programmers Programmers
Contributors Contributors
Offline
User avatar

Joined: 2012-05-05, 16:39:51
Posts: 41
Builds updated too!

_________________
Delek's Website
DefleMask Tracker
Delek's SoundCloud
Delek's YouTube Channel


Top
 Profile  
 
 Post subject:
PostPosted: 2017-04-27, 5:24:59 

Contributors Contributors
Staff Staff
Reverse engineers Reverse engineers
Offline
User avatar

Joined: 2013-07-17, 23:32:39
Posts: 438
I think the problem with samples affect files that use PCM8. It's a PCM driver (that runs on top of MXDRV) that is used to mix 8 pcm channels, this was heavily used by MDX files. Check the x68sound.dll source code for an implementation.

For some examples of files that use PCM8 you can check here and here.


Top
 Profile  
 
 Post subject:
PostPosted: 2017-04-27, 14:32:50 

Programmers Programmers
Contributors Contributors
Offline
User avatar

Joined: 2012-05-05, 16:39:51
Posts: 41
Wow that could be the explanation why some tunes are perfectly fine while others can't trigger some samples. So some mdx can have more than 1 pcm channel? That will complicate a little bit the stream data in the .vgms. Please confirm this.

_________________
Delek's Website
DefleMask Tracker
Delek's SoundCloud
Delek's YouTube Channel


Top
 Profile  
 
 Post subject:
PostPosted: 2017-04-27, 14:57:30 

Contributors Contributors
Staff Staff
Reverse engineers Reverse engineers
Offline
User avatar

Joined: 2013-07-17, 23:32:39
Posts: 438
Correct. But the mixing is entirely done in software, so you will have to either use pcm8.h and send the data to the MSM6258 as a stream, or you could decode each sample individually and use a different sound chip (I'd suggest the YMF278B to make your VGMs compatible with the MSX).


Top
 Profile  
 
 Post subject:
PostPosted: 2017-04-27, 16:57:47 

Staff Staff
Programmers Programmers
Contributors Contributors
Ball Fondlers Ball Fondlers
Offline
User avatar

Joined: 2014-01-28, 5:51:54
Posts: 714
just copy what X68Sound.dll does

_________________
vampi.tech


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.437s | 18 Queries | GZIP : On ]