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.

Audio > MOD volume settings

#13094 - poslundc - Fri Dec 05, 2003 3:53 am

I've got my basic sound-player working and playing different notes for different instruments out of a MOD file.

I'm having trouble figuring out the whole volume thing, though.

First of all, each sample has a "default" volume setting. (The MOD I'm looking at has all of them at 64, so this is not particularly informative.) Next, there is the Volume Set effect that can be applied to any note. On top of this, the tracker I'm using has a "Volume" setting for each note - normally set to zero - and I'm not sure where it is stored in the MOD file.

I've also read that each channel has a separate volume assigned to it, but I can't figure out where this is specified in the MOD.

So given all of these different settings, how do I determine the volume of a note?

Furthermore, can I apply the volume on a linear scale to my values, or should I be looking it up in a volume table? Is there a source for a table that works well for the GBA?

Thanks,

Dan.

#13095 - Burton Radons - Fri Dec 05, 2003 5:06 am

Multiply global volume by sample volume by channel volume by panning. There is no way to change the volume of a note as an individual parameter in MOD, so either your tracker expects to output to a different format or it will insert volume set effects before playing the note if it can't put the set volume effect inside the line. Or it could just drop the data entirely.

Initialise channel volume to full. Just multiply volume against the samples.

#13097 - poslundc - Fri Dec 05, 2003 2:10 pm

Can't make it much simpler than that.

Thanks,

Dan.