Page 1 of 1
SPC noise generation
Posted: Tue Apr 28, 2009 10:53 pm
by mukunda
Hello! I was wondering if anyone has some information to help me implement 'fake' noise in my SPC driver.
By 'fake' I mean the noise that doesn't use the actual SPC noise generation hardware, but rather exploits some kind of bug in the Gaussian interpolation (I think?). Chrono Trigger uses it a lot (for wind.. etc)
I want to use this noise along with a few other simple waveforms for synthesizing sound effects.
Posted: Wed Apr 29, 2009 5:53 am
by Bregalad
I studied that a lot in the past, and it ended up as a headache. Also, I didn't know as much math back then than now.
You basically need a sample using BRR filter 2 (or 3), and make the resulting waveform "overflow" from the normal 16-bit range, and that looping. You can get various noises that way, but honneslty, it takes a lot of trial & error to get anything that doesn't loop too often. Also uses modern SPC players like SNESAmp by Anti-Resonnance which is accurate. Many older SPC players / emulators are innacurate, and will either not produce noise (breaking Chono Trigger's wind) or simulate "perfect" white noise instead of the pseudo-noise the sample does.
So for the short answer, convert a sine wave into BRR, increase the shift amount (higher nybble of first BRR byte) and listen to the result.
Posted: Thu Apr 30, 2009 5:00 am
by mukunda
Hmm, sounds like this isn't going to be easy..
I guess I'll have to setup some method to test various samples easily.
Posted: Thu Apr 30, 2009 5:11 am
by Bregalad
Well it's not really hard after you understand how BRR encoding works.
Read
this, it's easy to understand but it's half-accurate.
A more complete version is
this.