diff options
author | Kurausukun <lord.uber1@gmail.com> | 2018-11-05 17:13:44 -0500 |
---|---|---|
committer | Kurausukun <lord.uber1@gmail.com> | 2018-11-05 17:13:44 -0500 |
commit | f9f4f468c24bce859aa8ff2b9b99e374b073bcc6 (patch) | |
tree | 2c7e36db35e06275542e85d23bbce3d2de1ca411 | |
parent | 45f829864c4230107e7acf13f7b148aacf017b8c (diff) |
Updated Reduce noise and improve sound quality of music (markdown)
-rw-r--r-- | Reduce-noise-and-improve-sound-quality-of-music.md | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Reduce-noise-and-improve-sound-quality-of-music.md b/Reduce-noise-and-improve-sound-quality-of-music.md index 403a72c..21df1b7 100644 --- a/Reduce-noise-and-improve-sound-quality-of-music.md +++ b/Reduce-noise-and-improve-sound-quality-of-music.md @@ -36,7 +36,7 @@ Here, `[size]` is the length of one frame of audio, which varies by the sample r 40137Hz: 0x2A0 42048Hz: 0x2C0 ``` -Just find the sample rate you're using and use its corresponding frame size as the size of the array. For example, for the default sample rate, the size of the array is 0xE0. +Just find the sample rate you're using and use its corresponding frame size as the size of the array. For example, for the default sample rate, the size of the array is 0xE0 (note that the size of the array actually needs to be the frame size x 4; this is why this array is of type `u32` rather than `char` or `u8`). Next, remove the following from common_syms/m4a_2.txt: ``` @@ -49,7 +49,7 @@ gSoundInfo: ``` That's the mixer stuff out of the way, and if it was done correctly, the game shouldn't be producing as much quantization noise. -Next step changing base frequency. +Optionally, you can also change the audio engine's sample rate if you're using higher-quality samples. However, be warned; this means that any fixed-frequency samples (most percussion samples) will be played at this frequency; if you keep these samples at a lower sample rate, they will get pitched up and not sound right. Resample your samples to the rate you're making the engine use, or use higher quality samples and downsample them to the proper rate. In src/m4a_2.c, look for: ```c @@ -69,6 +69,8 @@ For the sake of this tutorial, we'll be changing it to 36314Hz. So in that file, | (12 << SOUND_MODE_MASVOL_SHIFT) | (5 << SOUND_MODE_MAXCHN_SHIFT)); ``` -And I believe that's that. If everything was done correctly (or I didn't screw something up) the sound will sound A LOT better than before. +There's another call to set the sound frequency on line 372; while it appears this code never actually affects anything since it gets overridden by the above change, for fool-proofing and if you're paranoid like me, you can change that one to match as well. -NOTE: The current code for the mixer has issues with reverb and this will be fixed at a later date. I will update the tutorial when we have the fix for that.
\ No newline at end of file +And I believe that's that. If everything was done correctly (or I didn't screw something up), you will have much less noise in your sound. + +NOTE: The current code for the mixer does not support reverb, but the code exists and can be added without too much trouble. This will happen at a later date, and when it does, this tutorial will be updated.
\ No newline at end of file |