Skip to content

How to Improve the Drum Channel

TempoQuill edited this page May 17, 2022 · 4 revisions

In Pokemon Gold/Silver/Crystal, there was support for Generation 1 percussion, but the sounds are distorted. Additionally, some of the new sounds tend to sound a little slurred. The main problem stems from an instruction in ReadNoiseSample.

First, let's see how wNoiseSampleDelay is used.

	ld a, [wNoiseSampleDelay]
	and a
	jr z, ReadNoiseSample
	dec a
	ld [wNoiseSampleDelay], a

When a sample is first loaded, we come around to see if the delay is 0. That means, if done right, a note can play at any frame within 256 of the last. If wNoiseSampleDelay is 0, we read the next sample in ReadNoiseSample.

Here's the problem though. While register a is reduced to a 4-bit value, it's incremented before it gets stored into ReadNoiseSample. Instead of 1-16 frames, it's raised to 2-17; no drum sound can last less than 2 frames. Here's the fix in audio/engine.asm:

	ld a, [de] 
	inc de

	cp sound_ret_cmd
	jr z, .quit

	and $f
-	inc a
	ld [wNoiseSampleDelay], a

There you go. Now the noise channel will play as intended. Enjoy the clean, clear new samples and the Gen 1 proper sound on the noise channel.

Clone this wiki locally