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 > Simple beeps and clicks...

#22495 - MumblyJoe - Wed Jun 23, 2004 2:28 am

Just curious, I am entering some things into the current pdroms comp and was wondering on some advice. Normally I always use the direct sound registers and dma etc for any sound, but for this comp I want a simple beep beep beep style thing.

Anyone recomend any examples?
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!

#22496 - keldon - Wed Jun 23, 2004 3:07 am

Rather than examples, I'd just like to go over a few basic terms when it comes to audio synthesis.

Attack relates to when the sound first starts. An attack of 0 makes the volume start immediately at its normal level. This is fine until you want to do the same note twice in a row and you want the volume to gradually increase (not for long, like a second, but so that there is an audible note).

Decay is when the attack has reached full volume and the the note goes down to what is called the sustain level. Decay is like attack, a decay of 0 makes the volume go directly to the sustain level.

Sustain is the volume of the note you would like the sound to remain at after it has 'decayed'

Release is how long the note is played after it is released. A release of 0 means that the note immediately disappears, but increasing the release makes the note gradually fade out (though I'm not sure if the GBA sound module features this)


---

I have recently restarted this computer, so all my GBA docs are on the other computer; and I left my USB key with GBA stuff on it downstairs, I'll give you a lot more info within 24 hours if nobody has already given it; but it's very late and I must sleep.

#22498 - poslundc - Wed Jun 23, 2004 3:14 am

If you've already written a mixer before, I would imagine the least effort thing to do would be to record (or "acquire") samples of the beeps, clicks, etc. that you want your game to use and just play them like that through the direct sound FIFOs.

You could go to the trouble of fine-tuning the wave generators to the sounds you want, but why bother?

Dan.

#22502 - tepples - Wed Jun 23, 2004 3:27 am

The tone generators are dead easy. To see how to tickle them to make sound, go look at tri.c from the source code for Tetanus On Drugs.

And no, you can't easily do an ADSR envelope using GB/GBA tone generators. To switch the envelope, you need to restart the note, which produces a click. That's part of why PocketNES sound is so darn clicky.

But for a realistic LCD game simulation, you probably don't need ADSR but just an on-off envelope.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#22547 - col - Thu Jun 24, 2004 1:16 am

This site has detailed gba audio info:
http://belogic.com/gba/

cheers

Col

#22563 - Abscissa - Thu Jun 24, 2004 6:54 am

I found the http://belogic.com/gba/ to be very helpful. Download the four demos (There's one for each of the four non-DirectSound channels). The demos are very helpful for tweaking sounds to get them to sound how you want them to.

#22568 - keldon - Thu Jun 24, 2004 11:23 am

tepples wrote:
The tone generators are dead easy. To see how to tickle them to make sound, go look at tri.c from the source code for Tetanus On Drugs.

And no, you can't easily do an ADSR envelope using GB/GBA tone generators. To switch the envelope, you need to restart the note, which produces a click. That's part of why PocketNES sound is so darn clicky.

But for a realistic LCD game simulation, you probably don't need ADSR but just an on-off envelope.


Will the gameboy synth respond to changes to decay and sustain? If not that can be tackled by restarting the note at the volume of sustain with 0 attack, sustain set to 0 and decay set to what you want release to be =).

#22573 - tepples - Thu Jun 24, 2004 2:46 pm

keldon wrote:
Will the gameboy synth respond to changes to decay and sustain?

Not easily. It seems to respond to changes in the inverse slope of the envelope but not to changes in the duration of the envelope or in the starting volume. You have to restart the note between attack and decay, and restarting the note produces a click.

No, real G&W type units do not use ADSR envelopes; most just use trivial (on/off) envelopes.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.