-
Notifications
You must be signed in to change notification settings - Fork 801
Fix ReadNoiseSample 'inc a' distorting channel 4 percussion
Note: This may also cause Generation II music to sound different than they were originally, change this if you find they sound better that way somehow.
According to https://github.com/pret/pokecrystal/issues/924#issue-1238588091:
In ReadNoiseSample
, the first byte is split into a purely cosmetic hi nybble to make importing RBY noise data a matter of copy-paste, and a lo nybble for the length.
All the RBY percussion is already there, and drums that are two or more notes long indicate the same note length structure as in RBY. However, because of the way ReadNoiseSample
stores this first byte, this length is one frame longer than intended, meaning minimum note length is two instead of one. This makes the old drums with two or more notes sound slower than they should be and therefore vice versa for newer songs that utilize this new behavior.
To fix/tweak this, edit ReadNoiseSample
in audio/engine.asm:
inc de
cp sound_ret_cmd
jr z, .quit
and $f
- inc a
ld [wNoiseSampleDelay], a
An example of how Gen II music will sound with this fix/tweak is: https://soundcloud.com/aizakku-horooee/drum-test-ss-aqua Example taken from https://github.com/pret/pokecrystal/issues/924#issuecomment-1129040318