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 ch3 worries...

#2469 - FluBBa - Tue Feb 04, 2003 2:11 pm

Maybe this is more of GBC question but the few places to look doesn't tell much so I figured maybe some old GBC developers are here =)
If I have written data to the wave ram of channel 3 and initialized it and set it to use the counter.
After the sound has played how do I get it to play again?
Is the only way to start it again to do another initializing? If I have to do that I also have to rewrite the wave ram area every time.

/FluBBa
_________________
I probably suck, my not is a programmer.

#2476 - tepples - Tue Feb 04, 2003 4:42 pm

My GBA sound engine "stops" channel 3 by setting its volume to zero. No rewriting of the wavetable is necessary. But then, I don't use the length counters to time note releases.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#2479 - FluBBa - Tue Feb 04, 2003 5:30 pm

The problem is that it gives a click when i turn the volume completly off.
I don't know if there is any way around this, maybe it doesn't help to use the counter either.
And this is for emulating the NES triangle channel, which just stop the oscillation of the channel. Any ideas?

/FluBBa
_________________
I probably suck, my not is a programmer.

#2482 - tepples - Tue Feb 04, 2003 6:31 pm

FluBBa wrote:
The problem is that it gives a click when i turn the volume completly off.

One way to smooth the click is to set the channel 3 volume to 50 percent, wait a few microseconds, then set it to 0 percent. Still, you're a lot more likely to hear clicks on GB hardware than on NES hardware because while NES audio has a low-pass filter, GB audio has a HIGH pass filter because the tiny speaker has very little response below 500 Hz.

Quote:
I don't know if there is any way around this, maybe it doesn't help to use the counter either.

Accurate length counters are better done in software.

Quote:
And this is for emulating the NES triangle channel

Heck, I often slip and call channel 3 on the GB the "triangle channel" by mistake.

If you want the most accurate emulation of NES sound hardware, you're going to have to do it in software. For instance, the lowest pitch on the GB is 15 percent higher than the lowest pitch on the NES, so what do you do when an NES program writes a period of 1748 or greater to channel 1, 2, or 3? And the GB doesn't have a "software envelope" mode that allows direct access to the volumes of the channels. Writing to the volume register on GB channel 1, 2, or 4 doesn't affect the current note, and starting a new note produces a click. What do you do when an NES program puts channel 1, 2, or 4 in "software envelope" mode?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.