Playing modules MOD XM IT S3M

DOS specific questions.
Posts: 1
Joined: Mar 27, 2019 9:14

Playing modules MOD XM IT S3M

Postby Ratchet » Mar 27, 2019 9:18

Is there a lib to play module files in DOS?
I know there are libs like fmod, bass or fbsound. But theyare only available for Win/Linux.
I wanna play old school module music under DOS ;)
Posts: 305
Joined: May 09, 2014 21:19
Location: Argentina

Re: Playing modules MOD XM IT S3M

Postby xlucas » Mar 30, 2019 2:50

I don't know any DOS library for this. If anybody does, then that'll be a better answer to your question, but just in case no one does, this is what I do know:

MOD and S3M format are very documented everywhere. I have made programs in the past that handled these formats. Yet, if you're to reproduce them, the complexity resides in the effects. If you just make a routine to scale the samples, you could start just ignoring all effects and just playing the thing and then work on each effect as you need them. It takes time, but would be interesting to do if you're willing to play with DOS :) There exists also a 8-channel MOD format. I have never worked with XM or IT, though.

If you just want to play DOS style music, you may also be interested in MID and CMF files, which are not tracker files, but were used by many DOS games to store their music. For CMF files (which are MIDI files with OPL2 instruments embedded in them), there exists not a library, but a TSR you can use called SBFMDRV.COM (there also exists a DRV version, which you have to load in memory manually). You can easily interact with the driver using the INT 80h or you can set it to another interrupt. I have the specs on how to program it and it's very straightforward. I can get it to you if you're interested. Playing MID files with the SB requires you to provide the instruments, but you could well borrow them from CMF files and use SBFMDRV to play them as well. SBFMDRV came with several Creative sound cards.

SBFMDRV.COM is here:
MOD file format:
S3M file format:
Posts: 1870
Joined: Jun 21, 2005 19:04

Re: Playing modules MOD XM IT S3M

Postby angros47 » Mar 30, 2019 22:48

There are some examples in QuickBasic that allow to open a .MOD file. Some can be ported to FreeBasic (but accessing the audio card is more complex in DOS FreeBasic)

Otherwise, a multiplatform library that does what you need is LibMikMod, there should be a version for DOS too
Posts: 219
Joined: Jun 30, 2006 5:31
Location: Usono (aka, USA)

Re: Playing modules MOD XM IT S3M

Postby rugxulo » Mar 31, 2019 17:22

angros47 wrote:a multiplatform library that does what you need is LibMikMod, there should be a version for DOS too

This sounds like something that should be on DJGPP mirrors, but I can't find it offhand. I've never used it (nor similar), so I'm a bit inexperienced, to say the least.

The one that comes to mind, to me, is DUMB ( Years ago, I wanted somebody to port it (make a binding) to FBC. I remember vaguely telling someone, but they never got around to it, and I was (and still am) too inexperienced. IIRC, it worked in DOS (but only on ancient cards like SB16, obviously). Probably not directly helpful, but that's as close as I can remember.
Posts: 8290
Joined: May 28, 2005 3:28

Re: Playing modules MOD XM IT S3M

Postby D.J.Peters » Apr 06, 2019 22:07

I know a little bit of "libMod" I use the C source code for FBSound.

Thausend years ago I wrote the GDK (game developer kit) for Kirschbaum Software - Power Basic
I shipped the GDK with 10,000 CD's with audio and video* stuff
sponsored by VW, yes the criminal guys to day :-)
it worked in DMA mode for the most DOS sound cards.

(*)video playback in sync with audio was a kind of holy grail with 386 DX CPU's ...

Maybe I have the source code of my DOS 32-tracks playback code I can share it with you.

It's power "BASIC" with inline assembler XMS and EMS memory support in protected mode you know ?
(if not, sorry the source code isn't the right thing for you)


Return to “DOS”

Who is online

Users browsing this forum: No registered users and 1 guest