gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > lib for module files? specially for loading them from fat

#167608 - Tommmie - Thu Mar 19, 2009 9:09 pm

ok, so in the newest libnds we've maxmod but that lib hasn't the possibility to do this. has someone a suggestion and maybe an example cause i'm a idiot at sound

#167617 - JonH - Fri Mar 20, 2009 12:50 pm

Hi Tommmie :)
I think MaxMod can load from the FS, take a look at the mmSoundBankInFiles function. I've not tried it so sorry I can't be more help, but I'm pretty sure it's possible.

http://www.maxmod.org/ref/functions/mmSoundBankInFiles.html

#167620 - Tommmie - Fri Mar 20, 2009 5:05 pm

so i have to compile some soundbanks(as i can't get in the rom because it's big) load it from the filesystem into ram and play the module files in that bank? and does it automaticilly search for the module file?

Last edited by Tommmie on Sun Apr 25, 2010 9:12 pm; edited 1 time in total

#167657 - eKid - Sat Mar 21, 2009 1:29 pm

You make one soundbank with all of your modules and sounds, then you can initialize maxmod with it with 'mmInitDefault' (the other mmInitDefaultMem is for when it's already loaded into memory).

Then from that point when you use mmLoad/mmLoadEffect then it will load that particular element into memory (from the file), and mmUnload/Effect will unload it from memory.

#167659 - Dwedit - Sat Mar 21, 2009 1:45 pm

What about integrating the ability to directly load MOD files into maxmod? It wouldn't need to be ARM7 code, it could just load a MOD file and add it into whatever sound bank it is currently using, and trim away any identical samples to save memory.
This would just be for the benefit of End Users, for example, a game with custom user-supplied MOD music. They don't want to fiddle around with the converter tool, just throw the mods on the filesystem.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#167679 - eKid - Sun Mar 22, 2009 4:09 am

That's one thing I regret about doing preprocessing on the module data. Unless the converter is ported to DS (not fun) then there's no way to load actual mod files. Originally the system was designed for just GBA, which benefits a lot from preprocessing, so that decision was made before considering the DS.

I think I might change the system sometime to allow easier loading of unprocessed modules. (maybe in the DSi version :P)

#168002 - sverx - Mon Apr 06, 2009 3:14 pm

Dwedit wrote:
[...] for example, a game with custom user-supplied MOD music. They don't want to fiddle around with the converter tool, just throw the mods on the filesystem.


if you replace 'MOD' with 'XM' then you could try libxm7. To load XMs from FAT you could use the source code I wrote for xm7play... read more here.