Advertisement

Playing .MOD files with DirectSound

Started by July 29, 2000 10:58 AM
8 comments, last by smidge_tech 24 years, 5 months ago
Having decided that digital music would be a great complement to a demo of my 3d engine, I''ve started work on a VC++ .MOD player which uses DirectSound... I can load the files perfectly, but I need to know how to convert the raw sample data into something that DSound understands. I''ve tried simply copying it straight over after locking a DS Buffer, but that only played a few blips, so that''s obviously not the correct format. Does anyone know the format of the samples in MOD files?!? BTW, there are no errors with setting up DS, because I can load another sound (from a .WAV file) and that works. Wave format is set to 11025Hz, 8-bit... Help! ======== Smidge smidge@smidge-tech.co.uk ========
--Mr Smidge
Wotsit''s File Format comes to mind.

jumble
-----------
Microsoft patents ones and zeroes - remind you of Hasbro?
jumble-----------
Advertisement
Yeah, that was the first place I looked already.

Not enough info.



========
Smidge
smidge@smidge-tech.co.uk
========
--Mr Smidge
I can''t answer your question, but FMOD comes with a very powerful .mod/.xm-Player that is free, if your program is free, too.

_Andy

- - - - - - - - - - - - - -
Andreas Mähler
Wolf359 Interactive
MOD player with DS? If you''re planning to use DS buffers to store sample data, DON''T! It CAN be done, but it isn''t really worth the effort, and will be really painful to do.
Write custom mixer. It''s only sensible way. If you don''t reuse someone''s mixer
~~~ "'impossible' is a word in the dictonary of fools" --Napoleon
Getting the sample data is easy. the samples are stored in delta compressed format (storing differences every sample instead of amplitude). Getting the playback info on a particular node via varous lookuptables requires a bit more work. Adding the effects, like portamento and tremolo, is equally hard work.

The file format as such is fairly simple, but it''s not easyly adopted into the DirectSound API, I think.


If you want .Mod or .Xm format description, Email me.

NiteZhifter
bakkevej@stofanet.dk
Advertisement
DirectX 6.0 and above offers a new feature - DirectMusic.
I''ve been looking for a description in dx sdk and it sounds
great for developing music. Did you try this? Disadvantage
of this is that it plays midi files (also with custom samples,
thus creating a mod file architecture), but it plays through
DirectSound.So if you can convert your module to midi, you can use yours module samples with all the atributes of midi effect,
and not using midi architecture -> on all sound cards also without midi support it will sound the same. look for it in the sdk.


krompo
krompo
Yet again: Good luck, and get a large amount of those really nice relaxing pink pills before you start something like that.

MIDI and MOD have very different basic structure, and directsound is pretty MIDI-oriented if you think what you can do easily with the interface it gives you.

Basic MOD operation - playing samples - is easy. The tricky part are all those neat effects; for example, setting sample play offset, which is nearly impossible to do with MIDI.
Also, MODs allow you to play same sample in all channels simultaneously, or have a sample to interrupt other sample on same channel. More things that are tricky (at best!) to do with MIDI, or even DS...

Again, I don't say it couldn't be done. I say that it isn't worth the trouble.

And I still say that you should write your own, customized mixer. Or use mine I have provided with MULE sources (http://www.ee.oulu.fi/~taur/mule.htm) , the sound code used is pretty easy to port to windows (been there, done that), and is VERY scalable (lowest quality should work at 386/33, highest quality can choke a slow pentium... (and yes, those sources include a mod (umm... make that s3m) player also)


Edited by - Hway on August 2, 2000 8:33:12 AM
~~~ "'impossible' is a word in the dictonary of fools" --Napoleon
Thx for all your help.

It''s just a real pity I can''t even play the samples properly yet! Custom mixer, here I come...



========
Smidge
smidge@smidge-tech.co.uk
========
--Mr Smidge

I remember back in the day, I created a .MOD/.S3M player from scratch in assembly.. but there''s no need for such heroics now.

Go get FMOD, which is a really nice mod player that will use DSound. It costs money for commercial applications, but in my case, since I know my game will never see the light of day commercially, that''s no problem.

This topic is closed to new replies.

Advertisement