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 > Sound 3 any good for effects?

#13099 - poslundc - Fri Dec 05, 2003 3:27 pm

I'm trying to make some design decisions for my music engine, and the big one at the moment is whether to allow for sound effects (and therefore reduce the number of channels available to my composer) or find some other way of doing it.

How is Sound 3 for playing effects? I'm thinking of just running another, smaller mixer alongside my music mixer that just mixes four channels of four-bit samples at uniform volume and dumps whatever data it has into the dual-buffer.

Has anyone played around with this? What were your findings? I suppose straight off the bat I will be forfeiting any options for things like stereo sound effects. So I suppose my other main concern is whether people find that 4-bit sound-effects are "good" enough for most games.

Thanks,

Dan.

#13105 - gb_feedback - Fri Dec 05, 2003 5:02 pm

Personally, I'd go for stealing one of the mixer channels for the duration of the sound effect. The technique is virtually the same as playing a sample for musical purposes, so the code is almost done already. And who will notice a missing instrument when the sound effect is stealing their attention (even if there's one playing). I don't think 4 bit sound effects are worth it myself.
_________________
http://www.bookreader.co.uk/

#13108 - Touchstone - Fri Dec 05, 2003 6:00 pm

poslundc wrote:
So I suppose my other main concern is whether people find that 4-bit sound-effects are "good" enough for most games.
I think that's up to your sound guy to decide. For a water-splash sound effect or other sounds with white noise 4 bits should do just fine, right? (If it's just noise you could of course use the noise channel :) For a laser gun shooting soundeffect you're all set with the tone+sweep channel or just tone channel.
_________________
You can't beat our meat

#13110 - poslundc - Fri Dec 05, 2003 6:29 pm

I suppose I could just tell the composer that channels 1-4 are his primary channels, and that if he wants to use channels 5-8 he should be aware that the instruments may get bumped for effects. That way he can prioritize his channel usage, and maybe put instruments that exist more in the background into the upper channels.

I doubt he'll be thrilled by it, though. :P

I would also have to code into my MOD player some kind of recognition system that says if an effect is playing in one of the channels, not to play any new notes in the channel until the effect is done. The player is only running on VBlank, though, so that shouldn't steal too many cycles away from everything else.

Dan.

#13111 - DekuTree64 - Fri Dec 05, 2003 7:04 pm

poslundc wrote:
I would also have to code into my MOD player some kind of recognition system that says if an effect is playing in one of the channels, not to play any new notes in the channel until the effect is done.

Yeah, that's what I do. Just keep a sound effects flag byte that has one bit for each channel, and in your MOD player, check if the current channel is available before playing the note.
Or rather, that's what I did before, since I'm working on an IT player now. One of the nice things about IT is the mixer channels are no longer locked to the channels of the song, so if a note plays, it just picks a free channel. That way it can do stuff like a note fading out while a new note plays on the same channel. The fadeout channel is set to lower priority incase all the channels are playing new notes or whatever and something needs to take it, but you could just request that a sound effect be played and let it deal with the specifics. Then you can do stuff like when a new note plays and all the channels are full, search through and see if you can find a channel with a lower volume than the note being played, so if a sound is blocking a channel, only the quietest channel of the song gets kicked.
You could do something like that on your MOD player too if just blocking specific channels bothers your music guy. It does require a little extra memory to keep track of which song channel is using which mixer channel, and processing to search through for free ones, but it's not that much.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#13113 - tepples - Fri Dec 05, 2003 7:26 pm

poslundc wrote:
I suppose I could just tell the composer that channels 1-4 are his primary channels, and that if he wants to use channels 5-8 he should be aware that the instruments may get bumped for effects.

Just about every Super NES sound engine did this as well.

Quote:
That way he can prioritize his channel usage, and maybe put instruments that exist more in the background into the upper channels.

Or you could add channels 9-12 played through the Game Boy tone generators.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#13122 - poslundc - Fri Dec 05, 2003 8:48 pm

tepples wrote:
Or you could add channels 9-12 played through the Game Boy tone generators.


I don't think that would be very practical for my purposes. I understand you can synth a few instruments using the tone generators, but getting that to work in concert with the MOD file format, and then setting it up so that the composer can use those instruments on his PC for tracking the the tunes all seems a little overkill.

Dan.