The Null Device

dermiv

One of the things I enjoy doing is creating electronic music, for which I use a Macintosh laptop, some music software and various plugins. For the past few years, the software which I used has been Apple's Logic Express, to which I switched from Cubase VST when moving from MacOS 9 to OSX. As Logic didn't come with a drum machine program back then, I found myself buying Linplug's RMIV drum machine, which I have over the years used extensively.

RMIV is an excellent and comprehensive drum machine, which contains both analogue-style drum synthesisers and sample playing capabilities, as well as filters and effects. However, it has one downside; when you import sounds into it, it has the annoying tendency of saving those in its own proprietary format (rather than using a standard format such as, say, AIFF or WAV, both of which are good enough for other software including Apple's own samplers).

Recently I have started using Ableton Live, and have found it very impressive. While Live will happily load all my AudioUnit plugins, it also contains its own drum sample player, Drum Rack, which integrates more tightly with it. Drum Rack allows you to drag your favourite samples to various pads and play them. The hitch is that the samples must be in a standard format; if most of your drum samples are in RMIV's .D4T format, then you have a problem. Guess where most of my samples were?

Anyway, not being one to give up easily, I took it upon myself to examine the D4T format, and come up with a way of converting my samples to an open format. Luckily, I had some samples sitting around in both formats; after examining them with hexdump(1) and a Python interpreter, I soon determined that D4T is a fairly simple format, consisting of a short header and the samples in 32-bit float format.

The header turned out to be a bit more work; there were what looked like magic numbers in it, as well as some values roughly proportional to the file size, though bizarrely unrelated to actual sizes. After creating a few oddly-sized AIFF files, importing them into RMIV and examining the imported versions, I determined that RMIV's format used a bizarre way of encoding integers: it would encode them in binary-coded centimal. Which is to say, as a series of bytes, each containing a value from 1 to 99, representing a pair of decimal digits. Why they settled on this peculiar and inefficient encoding, I can only guess; it seems too feeble to be an attempt to thwart reverse engineering.

Anyway, the point of this anecdote is that I have now written a Python script which converts from RMIV's .D4T sample files to AIFF files. (One could change it fairly trivially to make WAV files, though that's left as an exercise to the reader.) The script, named "dermiv", is here.

There are 2 comments on "dermiv":

Posted by: ctime Wed Jul 9 19:36:00 2008

they think he's a righteous dude

keep up the good work

Posted by: Michael English Mon Nov 18 14:10:46 2013

I wish I could understand this. I downloaded the script - but I have no idea what to do with it. Have tried various things with the terminal - but nothing seems to work.

Want to say something? Do so here.

Post pseudonymously

Display name:
URL:(optional)
To prove that you are not a bot, please enter the text in the image into the field below it.

Your Comment:

Please keep comments on topic and to the point. Inappropriate comments may be deleted.

Note that markup is stripped from comments; URLs will be automatically converted into links.