A new, and correct sound test program this time... - Printable Version
+- VBA-M Forums (http://vba-m.com/forum)
+-- Forum: VisualBoy Advance-M (/Forum-visualboy-advance-m)
+--- Forum: Bugs and Support (/Forum-bugs-and-support)
+---- Forum: Audio (/Forum-audio)
+---- Thread: A new, and correct sound test program this time... (/Thread-a-new-and-correct-sound-test-program-this-time)
A new, and correct sound test program this time... - Dwedit - 08-26-2008 10:06 AM
First, I'm sorry about the crappy misleading sound test program I posted previously.
Here's a real sound testing program.
The program repeatedly plays a middle C note every 64128 GBA clock cycles, with the reset flag turned on. It fades the volume down by setting a new volume every 30 writes. GBC sound channel frequency register "n value" of the note is 1547, for a frequency of ~261.62Hz. You can also change the period from 64128 to any other number.
GBA's GBC sound clock is 131072Hz, GBA clock speed is 16777216Hz, so GBA timers are 128 times faster than the sound clock for the GBC. This means that every (2048-1547)*128=64128 GBA clock cycles, there is a complete period of the square wave.
I've tested it on hardware, and when the value is one less than it should be, it sounds terrible. When you increase the value, you need to increase it by a certain threshhold before you hear any difference.
I tested this program with a Milky Blue Japanese GBA.
Results may vary depending on what it's been playing before...
Sometimes the 'period' values are off by 1 as in you may get the junky tone one period earlier or later.
reminder: "Period" values refer to how many clock cycles it waits before writing a new C note with reset to the GBC sound channels...
At period 8001 and lower, it just clicks.
At period 8002-8016, it either just clicks, or plays a different octave of middle C, or a junky tone
At period 8017-16017, it starts with repeating middle Cs, then gradually gets lower as you increase the period, until 16018, when it becomes one octave below middle C
At period 16018-16035, you get junky tones
At period 16035-24033, you get middle C notes gradually going down to F below middle C tones
At period 24033-24047, you get junky tones that gradually become middle C again at 24048
At period 24048-32050, you get middle C notes gradually going down one octave
At period 32051-32064, you get junky tones
At period 32065-40065, you get middle C notes gradually going down to G#
At period 40066-40080, you get junky tones
At period 40081-48081, you get middle C notes gradually going down to A
At period 48082-48095, you get junky tones
At period 48096-56097, you get middle C notes gradually going down to A
At period 56098-56111, you get junky tones
At period 56112-64114, you get middle C notes gradually going down to A#
At period 64115-64127, you get junky tones
At period 64128, you get the C note
At period 64129-72130, you get middle C notes gradually going down to A#
At period 72131-72144, you get junky tones
At period 72145-80416, you get middle C notes gradually going down to A#
At period 80417-80161, you get junky tones
At period 80161-
blah blah blah... you get the idea..
Good C notes at:
All multiples of 8016.
Or in other words: All multiples of Wavelength [2048 - "n value"] * 16
Junky notes just before good C notes. "Junky" notes gradually start at low C, A#, or some other note, and go up to middle C
On the NDS Lite, I'm getting less tolerance for deviating from the perfect position of the note.
So yeah, by timing sound writes carefully, you can change the volume of GBC sound channels without bad reset artifacts.
RE: A new, and correct sound test program this time... - Squall Leonhart - 01-22-2009 08:22 PM
When on a GBA, GBC games make use of the GBA audio hardware, there ARE several instances of faults in the GBC hardware that introduce audio artifacts.
If you could run the same tests via an actual GBC.