gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Audio > SNES GBA audio comparison

#5026 - sgeos - Thu Apr 17, 2003 10:17 pm

What are the audio capabilities of the SNES, and how does the GBA compare?

-Brendan

#5027 - tepples - Thu Apr 17, 2003 10:24 pm

Super NES: Dual 16-bit DAC, 16-bit compressed samples, 8 channel mixer with L/R pan and hardware decompression, some hardware audio filters, dedicated sound CPU with a REALLY slow bus to the main CPU.

GBA: Dual 8-bit PWM DAC, 8-bit uncompressed (or software decompressed) samples, 2 PCM channels (software mixing adds up to 8) plus 4 tone generators. Analogous to the architecture of the Sound Blaster Pro adapter for PCs.

I went straight from programming the NES to programming the GBA. I never coded for the Super NES because I could never figure out how to program its sound system.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#5031 - sgeos - Thu Apr 17, 2003 10:59 pm

It looks the SNES has (much?) better sound hardware.

I read in another thread that audio routines need to be fast and effiecient, where general game stuff for an RPG/side scroller do not. Why?

> I went straight from programming the NES to programming the GBA.
> I never coded for the Super NES because I could never figure out how
> to program its sound system.

Hehehe... that bad?

Incidentally, does [any random person] know of any good resources on electronic music, and/or music theory.

-Brendan

#5034 - tepples - Thu Apr 17, 2003 11:24 pm

sgeos wrote:
It looks the SNES has (much?) better sound hardware.

"Better" can be defined in all sorts of directions. Super NES cartridges could hold 512 KB to 4 MB, but GBA cartridges can hold up to 16 MB. Thus, the samples themselves can be longer, allowing for drum-loop and guitar-loop samples as heard in Kilken and non-sequenced music such as the title screen music from Castlevania: Circle of the Moon. It's also possible to use more complex compression than the 4 bit per sample "BRR" format that the Super NES's DSP was locked into; I think Pac-Man Collection does this in Pac-Attack. And for beginning programmers, it's still possible to access a few simple tone generators; the Super NES had none.

Quote:
I read in another thread that audio routines need to be fast and effiecient, where general game stuff for an RPG/side scroller do not. Why?

The raw bulk of the data involved. A software audio mixer has to process about 300 pieces of data per channel per frame, and there are only 280,896 CPU cycles in a frame on the GBA. On the other hand, the music code doesn't need to be super efficient because it processes about a few dozen things per frame, mostly just reading notes, looking them up in a frequency table, and starting and modulating samples.

Quote:
Incidentally, does [any random person] know of any good resources on electronic music, and/or music theory.

Start with Elements of Computer Music by F. Richard Moore. See also musicdsp.org. To learn how to write a mixer, see "Digital Audio Mixing Techniques" by jedi / oxygen.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#5037 - sgeos - Thu Apr 17, 2003 11:45 pm

> "Better" can be defined in all sorts of directions. [SNIP good reasons]

Points taken. I won't use "better". Does it look like the GBA will be able to produce at least the SNES's level of audio quality?

> The raw bulk of the data involved. A software audio mixer...
> On the other hand, the music code doesn't need to be...

What is the difference between a software audio mixer and music code?

Thanks for the pointers to info on audio!

-Brendan

#5039 - tepples - Fri Apr 18, 2003 1:55 am

sgeos wrote:
Does it look like the GBA will be able to produce at least the SNES's level of audio quality?

Yes, in practice. The noise floor of 8-bit DAC output (about -44 dBFS) is usually about the same as the average cheap TV's audio noise level. The environments in which GBA owners actually use their systems are usually much noisier than the 8-bit noise floor, and this will make the difference not as noticeable.

The mixing quality is usually set somewhere around 18 to 24 kHz, but it really depends on how much CPU time you want to use for audio mixing as opposed to video and game logic.

Quote:
What is the difference between a software audio mixer and music code?

A mixer is the low-level code that takes samples, frequencies, and volumes as input and produces a single audio stream (or pair of audio streams) as output. Music code is higher-level code that takes a list of notes and durations (such as a MIDI file) as input and produces instructions to play samples at a given frequency and volume as output, instructions which are read by the mixer and by the four hardware tone generators that the GBA inherits from the GBC.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.


Last edited by tepples on Tue Apr 22, 2003 10:56 pm; edited 1 time in total

#5184 - Saj - Tue Apr 22, 2003 7:59 pm

Quote:
What is the difference between a software audio mixer and music code?


Quote:
mixer, low-level code, samples, frequencies, volumes, input, audio stream (or pair of audio streams), output, higher-level, list, notes, durations, instructions, samples, given frequency, volume, output, instructions, mixer, four hardware tone generators....


Wow! All those long words can make your head spin!

Just to clarify,

An audio mixer deals with samples (bits of music that you record from a tape or cd).

Music code (similar to midi information) is much, much smaller.
It simply tells the GBA to play a particular tone (like telling your friend to play a C sharp on his guitar).

As tepples said, the GBA has 4 built-in tone generators. The best way to think of these, is as musical instruments. You can set them up as different instruments (i.e. drums, guitar, piano, etc) Then, when you get them to play at the same time, they sound like a proper rock-band!! (Actually they sound kinda old-skool so that's why 'N' added the use of samples).

hope this helps.
_________________
---------------------------------------------------
Click here to give free food to starving animals.
--------------------------------------------------

#5205 - sgeos - Wed Apr 23, 2003 5:11 am

Saj wrote:

Wow! All those long words can make your head spin!


Big dictionary action? Big google action?

Saj wrote:

Music code (similar to midi information) is much, much smaller.
It simply tells the GBA to play a particular tone (like telling your friend to play a C sharp on his guitar).


What frequency is C again? What would C sharp be?

Saj wrote:

As tepples said, the GBA has 4 built-in tone generators. The best way to think of these, is as musical instruments. You can set them up as different instruments (i.e. drums, guitar, piano, etc) Then, when you get them to play at the same time, they sound like a proper rock-band!! (Actually they sound kinda old-skool so that's why 'N' added the use of samples).

hope this helps.


Actually, that was quite helpful. Now, if I want to get something that actually sounded like and instrument, I'd need to set up tone 3 to do that, right? How would I get a flute sound? A bell? A piano? Harp? (I don't care about anything else, really...)

How easy would it be (or even possible?) to combine tone 3 with direct sound and some note information to simulate a bunch of instruments? (Not that I don't like the square waves the old GB uses. =)

-Brendan

#5208 - tepples - Wed Apr 23, 2003 7:05 am

sgeos wrote:
What frequency is C again?

Frequencies in the "equal temperament" tuning system, which is predominant in modern western music, are defined such that note 69 (the A above middle C) is 440 Hz, and raising a pitch by one semitone corresponds to multiplying the frequency by 2^(1/12), or about 1.0595.

Note 60 (middle C) is about 261.6 Hz. However, you won't always want to compute Hz values in your music code because the conversion from Hz to tone generator period parameters involves a division. My music code contains a look-up table of note frequency scale factors (for sampled instruments) and periods (for tone generators) for notes from 36 (two octaves below middle C) to 99 (three octaves and a minor third above middle C).

Quote:
Actually, that was quite helpful. Now, if I want to get something that actually sounded like and instrument, I'd need to set up tone 3 to do that, right?

Tone 3's volume control is quite coarse and can't reproduce smooth envelopes well; forget about decay. Most of the time, if a piano-like sound is done with DMG instruments, it's done with one of the square wave channels set to 25% duty cycle. However, you can do wind instruments to an extent. Get a flute sound by loading a triangle wave (0123456789ABCDEFFEDCBA9876543210 or 02468ACEFDB9753102468ACEFDB97531) into Tone 3's wave RAM. Listen to NES games' soundtracks to get ideas.

Quote:
How easy would it be (or even possible?) to combine tone 3 with direct sound and some note information to simulate a bunch of instruments? (Not that I don't like the square waves the old GB uses. =)

Very easy. All you have to do in the music code is special-case channels 1-4 to write to the tone generators instead of your mixer's state table. Listen to the music in Calodox's Kilken demo and my TOD game (milestone 2 or later) to hear an example of using DSound along with the DMG sound channels. Mario Kart Super Circuit and Puyo Pop do as well.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#5324 - sgeos - Fri Apr 25, 2003 7:45 am

tepples wrote:

Frequencies in the "equal temperament" tuning system, which is predominant in modern western music, are defined such that note 69 (the A above middle C) is 440 Hz, and raising a pitch by one semitone corresponds to multiplying the frequency by 2^(1/12), or about 1.0595.


By semitone, do you mean note?

tepples wrote:

you can do wind instruments to an extent. Get a flute sound by loading a triangle wave (0123456789ABCDEFFEDCBA9876543210 or 02468ACEFDB9753102468ACEFDB97531) into Tone 3's wave RAM. Listen to NES games' soundtracks to get ideas.


I seem to be getting tapping noises, depending on the octave. I'm using boyscout to test this. Maybe it would sound different on hardware? If I were to try to get ideas by listening to NES soundtracks, what would I be listening for?

What are the NES's audio capabilities?

-Brendan

#5367 - tepples - Sat Apr 26, 2003 3:48 am

sgeos wrote:
By semitone, do you mean note?

"Semitone" is a term used by musicians to measure intervals between pitches in the Western musical scale. The distance from C to C# is one semitone, and the distance from C# to D is one semitone. All intervals used in Western music can; for example, one octave is 12 semitones. In MIDI, absolute pitches are measured from semitone number 69 (A above middle C), equivalent to 440 Hz by convention.

If you're going to be writing music code, I recommend that you become familiar with music theory.

Quote:
I seem to be getting tapping noises, depending on the octave. I'm using boyscout to test this.

Then you probably need to set your instrument length longer.

Quote:
What are the NES's audio capabilities?

The NES has two square wave generators, one triangle wave generator, one sample-and-hold noise generator, and one primitive sample channel. The Game Boy Color has two square wave generators, one 32-sample 4-bit wavetable generator (which can be programmed to generate the same triangle wave as the NES), and one sample-and-hold noise generator. The GBA adds a pair of versatile sample channels.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#5417 - sgeos - Sun Apr 27, 2003 3:03 am

Thank you very much for the audio help and feedback in general.

-Brendan

#6700 - A_Lee_N - Mon Jun 02, 2003 2:31 am

Tepples: I am sure you are aware of this but i still think that it should be mentioned. Some games on the NES used extra hardware in the carts to produce better sound. Mr. Gimmick! by Sunsoft for example used an extra chip called FME-7 to make it produce 8 sound channels. Two pulse channels, one triangle, one noise, one dpcm and three additional channels on top of that.

// A_Lee_N

#6712 - tepples - Mon Jun 02, 2003 4:41 am

A_Lee_N wrote:
Some games on the NES used extra hardware in the carts to produce better sound.

You're thinking of the Famicom, the Japanese equivalent to the NES. It had a 60-pin cart, and two of those pins were part of the machine's audio path. (Games without sound hw on the cart just shorted the pins.) The NES models that used a 72-pin cart (those sold in USA and Europe) did not run the audio path through the cartridge. The GB and GBC had a similar pin (called Vin), but the GBA apparently dropped it even in GBC mode, which may be why Nintendo Power magazine reported that Pocket Music for GBC did not work on GBA.

But that's moot for GBA native products, as there is more than enough spare cart bus bandwidth to stream real-time digital audio from the cartridge.

EDIT: corrected pins in famicom cart bus
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.


Last edited by tepples on Mon Jun 02, 2003 4:13 pm; edited 1 time in total

#6717 - A_Lee_N - Mon Jun 02, 2003 6:05 am

Actually, the Famicom had 60 pin carts while the american and european NES had 72 pins. You are however completely right about the FME-7 chip only working on the Famicom, Mr. Gimmick! was never released in the states because of this and in the european version the music had been rewritten.

Sorry for mixing things up.