![]() |
Forum Index : Microcontroller and PC projects : CMM2: MODs vs. WAVs, and ModTracker recommendations.
Author | Message | ||||
epsilon![]() Senior Member ![]() Joined: 30/07/2020 Location: BelgiumPosts: 255 |
I noticed that the PLAY WAV command is fairly expensive and it doesn't vary much with the sample rate: > TIMER=0:PLAY WAV "fireSmall.wav":PRINT TIMER 13.444 > TIMER=0:PLAY WAV "fireBig.wav":PRINT TIMER 14.252 > list files "fire*.wav" A:/XDRAGON/demo 12:54 22-05-2021 42982 fireBig.wav 12:55 22-05-2021 21514 fireSmall.wav 0 directories, 2 files One is 22050Hz, the other 11025Hz. I'm guessing file system access is a big part of the cost, and maybe that's not the case if I would use PLAY MODSAMPLE instead. So I'm looking for a beginner friendly ModTracker for PC that allows me to edit in my sound FX (currently in .wav format). Any recommendations? I found OpenMPT, but I'm struggling with it. It lets me import my sound effects but they sound weird. I see some resampling options, but those only made it worse. Or maybe this approach is wrong and I should find a MOD archive somewhere that contains MOD friendly sounds? Epsilon CMM2 projects |
||||
Tinine Guru ![]() Joined: 30/03/2016 Location: United KingdomPosts: 1646 |
Reaper DAW No clue what this MOD thing is but when it comes to audio, Reaper can handle pretty much anything. Edited 2021-05-22 23:44 by Tinine |
||||
epsilon![]() Senior Member ![]() Joined: 30/07/2020 Location: BelgiumPosts: 255 |
...anything but mod files. .mod files are not recognized as supported media files. MOD is a chiptune file format, late-80s/90s era. I think it came from Amiga but it was common in the PC demoscene as well. Epsilon CMM2 projects |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
What do you think you are testing? Play WAV is non-blocking so you are just measuring the time to open the file and read the header + the first block of data. This won't vary much. The overhead of actually playing the sample will vary linearly with sample rate |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
MOD uses 8-bit PCM samples of instruments. Usually either 15 (IIRC) or 32. They did, indeed, start on the Amiga but PC sound cards started handling them too. I think the file specifies the instrument, special effect, channel, start and stop times. My memory is a bit hazy now. lol They were designed to have a low processing load on the system. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
epsilon![]() Senior Member ![]() Joined: 30/07/2020 Location: BelgiumPosts: 255 |
Yes, I'm aware of that. But the time to open the file and reader the header and first block of data is already too much if the sound effect in question is a bullet being fired in a game for instance. I'm hoping that PLAY MODSAMPLE will be faster because it's referencing samples in an already open MOD file. I would like to experiment with that a little, but haven't found a good ModTracker yet that allows me to add my sounds to an existing .mod. Epsilon CMM2 projects |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10310 |
If it is a short sound effect, load it into an array and use DAC START |
||||
epsilon![]() Senior Member ![]() Joined: 30/07/2020 Location: BelgiumPosts: 255 |
This indeed appears to be the case: > play modfile "blind_justice.mod" > TIMER=0: play modsample 26, 1: PRINT TIMER 0.007 The sample I played is the same as the .wav in the previous test. (still struggling to get it to sound right however). Epsilon CMM2 projects |
||||
epsilon![]() Senior Member ![]() Joined: 30/07/2020 Location: BelgiumPosts: 255 |
Perfect! Yes, I'll try that. Thank you! Epsilon CMM2 projects |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1132 |
Creating sounds with MODs Visit Vegipete's *Mite Library for cool programs. |
||||
epsilon![]() Senior Member ![]() Joined: 30/07/2020 Location: BelgiumPosts: 255 |
Thank you. That's a great post! The steps outlined happened to match with what I was doing, but only in the case of 8000Hz the sample playback approached the original, at least when played back in OpenMPT itself. Anyway, it's good to know OpenMT is the tool to use. I will experiment more with this. Epsilon CMM2 projects |
||||
epsilon![]() Senior Member ![]() Joined: 30/07/2020 Location: BelgiumPosts: 255 |
Thank you. That's a great post! The steps outlined happened to match with what I was doing, but only in the case of 8000Hz the sample playback approached the original, at least when played back in OpenMPT itself. Anyway, it's good to know OpenMT is the tool to use. I will experiment more with this. It was just a pilot error. The procedure as described by vegipete works great. So, MOD files are a great container for sound effects, and the PLAY MODFILE/MODSAMPLE API is a perfect API for sound effects in games: low overhead, easy to use, and supports overlapping sounds. Epsilon CMM2 projects |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |