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 > Audio Synthesis

#58698 - SittingDuck - Tue Oct 25, 2005 1:31 pm

Is it possible to do audio synthesis on the GBA? I want:
    Stereo audio
    Each channel to have up to four basic waveforms
    Noise generator and background sampled sound

The program will have to do nothing else but a menu to control it.
Is the GBA's 16.7MHz fast enough to cope with this? (I presume I will have to stick with fast integer math and lookup tables)
How would I go about it? Would I have to use an extra buffer?

#58749 - tepples - Tue Oct 25, 2005 7:49 pm

"Basic waveforms" what kind? You might be able to get away with just sampling each basic waveform.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#58753 - SittingDuck - Tue Oct 25, 2005 8:28 pm

Basic waveforms being sine, triangle, square etc.

#58757 - thegamefreak0134 - Tue Oct 25, 2005 9:04 pm

If you want to mess with them, I believe the 4 compatability channels from the old GB can do them. The first two are pretty much set, the 4th is noise, and I think the 3rd you can define your own waveform. I'm unsure about this of course. If thats the music you need to work with, you can use them. Alternateively, you could always include the waveforms yourself and use the directsound channels. I think the 4 compatability channels are generally frowned upon around here, so that might be a better way to go.
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#58811 - SittingDuck - Wed Oct 26, 2005 10:26 am

Well I'll give it a go.

#59017 - FluBBa - Fri Oct 28, 2005 1:05 am

You can take a look at the source to PCEAdvance or SMSAdvance for examples on how to render their respective soundchip into raw samples compatible with the GBA (in ARM ASM though).
_________________
I probably suck, my not is a programmer.

#59029 - headspin - Fri Oct 28, 2005 5:07 am

I think your better off generating the basic waveforms using an algorithm like Flubba suggests, since then you can define the characteristics required on the fly, such as velocity, frequency, amplitude etc. Also, playing raw samples would require a accurate timer to calculate when the next sample should play, and there will be a clicking sound between them if the samples arn't played exactly after each other or without interpolation.
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game