Sample sharing and callback questions

support for the gba/nds sound library from www.maxmod.org

Moderator: eKid

Post Reply
headkaze
Posts: 13
Joined: Wed Oct 21, 2009 5:57 pm

Sample sharing and callback questions

Post by headkaze » Sat Nov 14, 2009 5:42 pm

I have an xm that currently has 3 songs in one and I use SetPosition() to change which song is playing. I'm curious is it possible to have two separate xm's share samples to save memory? In that case I could split them into separate modules.

One other question is when I stop a song in the callback No$ crashes. Is it not possible to stop a song in the callback?

This is for the DS. Thanks.

eKid
Posts: 65
Joined: Sat Dec 06, 2008 6:07 pm
Contact:

Re: Sample sharing and callback questions

Post by eKid » Tue Nov 17, 2009 10:31 am

mmutil removes duplicate samples from the resulting soundbank, so you can split the songs into multiple XM's with duplicated samples and only one of each will be stored. (and you can also store duplicate samples inside the same XM and they will be removed, this is sometimes necessary because XM can't share samples between instruments)

You can't stop the module inside the callback, it's called from inside the update routine so it's unsafe. You'll have to stop it from outside somehow.

headkaze
Posts: 13
Joined: Wed Oct 21, 2009 5:57 pm

Re: Sample sharing and callback questions

Post by headkaze » Tue Nov 17, 2009 3:13 pm

Thanks for the info much appreciated :)

DeProgrammer
Posts: 1
Joined: Tue Nov 17, 2009 7:11 pm

Re: Sample sharing and callback questions

Post by DeProgrammer » Tue Nov 17, 2009 7:13 pm

I appreciate the info, too. I've actually been watching this topic because I happened to want to know the same thing at about the same time this was posted. :)

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests