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 > Detailed sound tutorial?

#53185 - CabaretVoltaire - Tue Sep 06, 2005 5:22 pm

I'm just getting started with NDS programming and am having some trouble finding a nice sound tutorial. Compared to graphics sound seems to be a neglected subject.

I know how to load and play a sample but what I want to do is be able to either change the pitch of a sample or generate a sample at any given pitch. Can the NDS hardware do this? Otherwise is there a library that can?

I've never really done any sound programming before so if this is something I will have to code myself I would appreciate a few pointers.

Thanks

#53190 - NoMis - Tue Sep 06, 2005 6:10 pm

You should take a look at DekuTree's Sound Tutorial. Althought it's originally written for the GBA it won't be that hard to adept it to the DS. The DS is very simillar to the GBA regarding sound you probably only have to swap out some registers.

NoMis
_________________
www.gamedev.at - The austrian gamedev site
hde.gamedev.at - The Handheld Dev Env plugins for Eclipse

#53247 - cybereality - Wed Sep 07, 2005 12:32 am

If you haven't yet seen Chris Double's tutorials, I suggest you check those out (http://www.double.co.nz/nintendo_ds/). They helped me a lot in getting myself up and running. You said you can play a sample, so thats a good start. The only thing you have to do to change the pitch is to change the sample rate. For instance, if your original sample rate is at 44100, set it to 22050 and the sample will play half the speed and at a lower pitch. If you are trying to actually pitch-shift the sample (and not change the length) then you must do more research. I have seen this effect used in elektroplankton, but I don't know if its done in hardware or not. If you find a solution, please post it here cause I am interested for a DS-DJ program I have on the backburner.

// cybereality

#53262 - tepples - Wed Sep 07, 2005 3:12 am

If you want to pitch-shift audio, investigate time stretching using overlap-add.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.