In typical SNES music engines, how much SPC RAM is used for the playback engine, sequence data, music samples, sound effect samples, and echo buffer?
Please define a typical music engine.
I'm pretty sure there is many ways to go. An OK practice would be to reserve about 3/4 of the total memory for the echo buffer and samples added together, and that if you need a longer echo buffer for a particular song, you will have less room for samples. I'm pretty sure Chrono Trigger does something like that.
You can also either create sound effects with complex usage of simple sounds, such as what Squaresoft did, which takes few memory, but you can also have all sound effects streamed like Super Double Dragon. Of course a mix of both is also possible.
8 KB (1/4 of memory) should be more than enough for music playback code + it's variable. I just thrown that number out, if you can make it smaller then good you can use more samples / longer samples.
Bregalad wrote:
Please define a typical music engine.
Into what patterns of memory usage did the common music drivers fall?
Quote:
You can also either create sound effects with complex usage of simple sounds, such as what Squaresoft did, which takes few memory, but you can also have all sound effects streamed like Super Double Dragon.
How do games like Kirby's Avalanche and Super Street Fighter II do voices? Are those streamed? But of course, once you get too much streaming going on, the gameplay slows down *cough*LOTR*cough*.
Quote:
8 KB (1/4 of memory)
I thought memory was 64 KB, not 32 KB. But you're right that one can probably use the size of an NSF as a rough benchmark for how big an SPC might be minus the samples.
Oh of course you are right SPC's mem is 64 KB.
So yeah if you manage to pull replay code + replay variables in 8KB ($0000-$1fff), music / sound effects in 8KB ($2000-$3fff), this leves 48 KB for samples and echo buffer.
I don't know if this is what needs to be done, but it sounds like a decent deal.
Super Street fighter 2 has streamed voices, but really simples one, it only have something like "Shoryu-ken" and "hado-ken" recorded at very slow rate, with the same "ken" ending. I think particular game does work with only one set of samples loaded at startup, like the vast majority of eariler SNES games.
Voices in Tales of Phantaisa are the opposite, the 6502 streams them to the SPC700 somehow, and it end up being streamed almost in real time. (not really in real time because there is probably a double/triple buffering system sending blocks of BRR data, as opposed to directly steam via the echo buffer like Blargg managed to do).
Some games, like BS-Zelda and probably earlier SNES games load the SPC with 64kb of data at game load-up. And that's it. However alot of later games probably only keep the engine in memory and swap out music data and samples for both music and sound effects.
Street Fighter Alpha 2 has horrible "load times" that are mistaken by some to be graphics loading when it's actually spending time loading high quality voice samples for the announcer or reloading the samples for the music and characters about to fight again.
I've heard some games like EarthWorm Jim 2 do some on the fly type loading but I imagine that most games do loading of SPC data at your typical key points, between levels or areas of levels, or between matches.
I guess it's too bad that SNES didn't have DMA to the SPC's memory.
Yeah, many SNES games have a second or so pause due to loading new music into the SPC. It's too bad games didn't do this in parallel with other CPU-unintensive things like scrolling.
Nintendo Power made a big deal of the fact that Jurassic Park's outdoor engine loaded music in the background. It didn't indoors because it needed all the time it could get for texture-mapped raycasting.
blargg wrote:
Yeah, many SNES games have a second or so pause due to loading new music into the SPC. It's too bad games didn't do this in parallel with other CPU-unintensive things like scrolling.
I recall a good example of no attempt of hiding this. In Rockman & Forte after defeating a boss your character can move around and if you do so you'll notice everything freeze for a small time while it loads the victory fanfare tune. For the development time and money point of view this makes sense but from another it seems lazy not to hide this.
It does seem like it would have been pretty easy to hide the loading. Even the standard bootloader allows the 65816 to set the pace of upload, so for example it could upload for half of the frame time, then leave the rest for moving the player and updating PPU registers. One downside is that it would lengthen the silence between sounds, and it'd have to avoid making any sound effects while uploading. The narrow interface to the SPC is a big cause. I understand that part of this was to reduce difficulties in having another company develop the sound hardware. If the interface were wider, it would have required more collaboration. Given all the features of the SNES, it is a glaring bottleneck for sure.
I understand that [the low bandwidth between the 65C816 and the SPC700] was to reduce difficulties in having another company develop the sound hardware. If the interface were wider, it would have required more collaboration. Given all the features of the SNES, it is a glaring bottleneck for sure.
Yeah, it is pretty obvious that the SPC700 barely has anything to do with the rest of the SNES design. It just doesn't have that "Nintendo architecture" that the rest of the system has.
The rest of the system is all about squares and patterns, while the sound chip is all about complicated curvature.
Sometimes I wonder how it would've been like if Nintendo developed the soundchip in-house. It would probably sound crisper, clearer and more video-gamey.
psycopathicteen wrote:
Sometimes I wonder how it would've been like if Nintendo developed the soundchip in-house. It would probably sound crisper, clearer and more video-gamey.
It would probably have sounded like the GBA's soft PCM mixers and the DS's sound chip: aliased to all heck.
In
this sample I play a short passage four times:
- Original, ripped from the DDR Extreme soundtrack
- Bandlimited to 9 kHz
- Bandlimited to 9 kHz, decimate to 18 kHz (Nyquist rate), upsample with nearest neighbor
- Bandlimited to 9 kHz, decimate to 18 kHz, upsample with linear interpolation
Let's just say SNES sounds like 2 and GBA and DS sound like 3.
Quote:
Yeah, it is pretty obvious that the SPC700 barely has anything to do with the rest of the SNES design. It just doesn't have that "Nintendo architecture" that the rest of the system has.
The rest of the system is all about squares and patterns, while the sound chip is all about complicated curvature.
Well now that you mention it it's right. The SPC700 is from Sony.
Quote:
It does seem like it would have been pretty easy to hide the loading. Even the standard bootloader allows the 65816 to set the pace of upload, so for example it could upload for half of the frame time, then leave the rest for moving the player and updating PPU registers. One downside is that it would lengthen the silence between sounds, and it'd have to avoid making any sound effects while uploading
Then the ideal deal would be to upload the initial SPC700 stuff with the included bootloader, then have your own that is more efficient and allows :
* For the 65816 to update SPC data when it is iddle with gameplay
* For the SPC to recieve SPC data when it's iddle, while still being to play SFX that aren't affected by the updated data.
However, the SPC doesn't have any interrupts, which probably makes this hard to do.
I suspect the Playstation has the same problem with games loading music off the disks.
In Final Fantasy 8/9 there is a considerable lag when you win a battle so that the game loads the winning music. This lag doesn't happen in parts of the game where the music doesn't change when you enter in battle.
Bregalad wrote:
I suspect the Playstation has the same problem with games loading music off the disks.
In Final Fantasy 8/9 there is a considerable lag when you win a battle so that the game loads the winning music. This lag doesn't happen in parts of the game where the music doesn't change when you enter in battle.
How so? I thought the PS1 had no SPC processsor. Just the DSP and 512k of ram that it could see/use. And the main/MIPS cpu took care of the DSP reg updates (it does all the song decoding).
This is right. However those games probably loads samples and music data from the disk to RAM before playing the victory song.
Again this is pure speculation, I haven't hacked those games or anything.
http://www.youtube.com/watch?v=Gi3bZzok ... re=related
I wonder if this is how the SNES would've sounded like without the low-pass-filter, interpolation, and BRR compression.
http://www.youtube.com/watch?v=TGbwL8kSpEk&feature=fvw
This other video is completely irrelevant to this thread. I just saw it on the "related videos" column, clicked on it, and enjoyed it a lot.
Teenage girls + long legs + Japanese + techno = Awsomeness!
psycopathicteen wrote:
http://www.youtube.com/watch?v=TGbwL8kSpEk&feature=fvw
This other video is completely irrelevant to this thread. I just saw it on the "related videos" column, clicked on it, and enjoyed it a lot.
Teenage girls + long legs + Japanese + techno = Awsomeness!
They're South Korean though. But I agree.
Quote:
I wonder if this is how the SNES would've sounded like without the low-pass-filter, interpolation, and BRR compression.
..and reverb support in the DSP.
The DSP already has an echo buffer. The first underground stage in Donut Plains of Super Mario World shows it off much better than the underground stages in Super Mario Bros. and Super Mario Bros. 3 do.
Which brings me to another question: How much memory do games typically use for their echo buffers?
Quote:
The DSP already has an echo buffer.
Yeah I know that the DSP supports echo, but it doesn't do reverb.
By reverb do you mean an impulse response around 1000 samples long?
Well as far as I know, reverb is multiple echo buffers with different delay/feedback values. SNES has only one echo buffer, which is why it is called echo and not reverb.
The effect is less realistic, but in some case can be just as impressive, as seen in caves of Secret of Mana.
Quote:
Which brings me to another question: How much memory do games typically use for their echo buffers?
Definte "typically". Some game such as Castlevania IV uses nothing, Final Fantasy 4-5-6 uses an EDL of 5, Chrono Trigger have it varying in function of the song played, but it uses the maximum EDL = 15 for the 100AD overworld theme.
Personally I think very short echo buffer (1-3) sounds really bad as the buffer is short enough to be in the audible range - it can lead to interesting effect, but overall if you're going to use echo at all you want EDL to be at least 5.
Quote:
By reverb do you mean an impulse response around 1000 samples long?
I mean multiple reflections of the same sound, taking into account the acoustic environment ("room type").
I always wondered why SNES's reverb always sounded kind've tiny compared to reverb you would hear in trance music.
I know a lot of people like the SNES characteristic sound quality, but for me it tends to fall in the "uncanny valley" where it isn't horribly bad, but not particularly good either. I'm surprised neither of the two main competing 16-bit systems had a tradition upgrade from the NES sound chip. The TurboGrafx was the only 16-bit system capable of replicating the nostalgic NES sound while improving upon it.
In another thread, we were talking about how you have to use really long samples just to make a good sounding square wave, because of it's interpolation. A perfect square wave would only take 2 samples on a traditional PCM chip. The same thing with a sawtooth wave. It just doesn't come out as pure and vibrant with all this extra stuff.
Quote:
I always wondered why SNES's reverb always sounded kind've tiny compared to reverb you would hear in trance music.
This is because they use actual reverb with multiple echo buffers in trance music, while the SNES only have a single echo buffer. So this "infinite" reverb effect is lacking. I know the therm is bad, but on the SNES you can clearly hear repetitions of the original sound at a constant distance.
On a more modern reverb, the sounds seems to have an infinity of repetitions that comes everywhere and you can' hear spearate repetitions of the original sound. I guess it's made with 2 or more echo buffers, each one echoing the others buffer, effectively creating an "infinity" of echo repetitions.
And I fully agree about the SNES's lacking the ability to reproduce square waves. Music on the GBA which mix samples and square waves is awesome !
However, I think it should be possible to reproduce a square wave by doing a fourrier transform, shifting the phases, and re-fourrier transform it to get a different wave, without discontinuities, that sounds like a Square wave to the human ear. Maybe it would compress better into BRR. Maybe not, who knowns.
Also "perfect" square waves could be done by filling the echo buffer with sofware writes (instead of enabling the echo normally) but you'd need CRAZY optimized code in order to do it in time, since you only get 32 cycles per outpu sample (the SPC is clocked at 1.024 MHz and the output is 32 kHz).
psycopathicteen wrote:
The TurboGrafx was the only 16-bit system capable of replicating the nostalgic NES sound while improving upon it.
If the TG16 was 16-bit, then the Genesis was 32-bit.
Quote:
A perfect square wave would only take 2 samples on a traditional PCM chip.
How many samples would a near-perfect sine wave take? With Gaussian or cubic interpolation, it doesn't take many.
Quote:
The same thing with a sawtooth wave.
On a PCE/GB/VB style 32-step PCM wavetable unit with nearest-neighbor resampling, a sawtooth wave won't have much more resolution than an NES triangle wave.
tepples wrote:
psycopathicteen wrote:
The TurboGrafx was the only 16-bit system capable of replicating the nostalgic NES sound while improving upon it.
If the TG16 was 16-bit, then the Genesis was 32-bit.
Please don't start that. It's pretty obvious that the PC-Engine/TG16 belongs in the same product cycle as the Genesis and SNES which are considered to be the "16-bit generation". We don't need to grab register or address space sizes to come up with a number of bits just to try to ungroup them when they clearly are grouped.
Quote:
Quote:
The same thing with a sawtooth wave.
On a PCE/GB/VB style 32-step PCM wavetable unit with nearest-neighbor resampling, a sawtooth wave won't have much more resolution than an NES triangle wave.
Isn't a 32-step PCM sawtooth equivelant to a sawtooth + a reversed sawtooth with 32x the frequency and 1/32 the volume?
Going by release date makes even less sense than those other measurements. In that case you should drop any mention of "bits" and just refer to it as "N:th generation".
tepples wrote:
psycopathicteen wrote:
The TurboGrafx was the only 16-bit system capable of replicating the nostalgic NES sound while improving upon it.
If the TG16 was 16-bit, then the Genesis was 32-bit.
I know, right? Although, when I'm playing LOT port on the SegaCD - I can't figure out for the life of me why the colors are much reduced and there's slowdown in parts where there weren't originally. And the SegaCD is like 64bit, right? I mean, it's got like two processors and stuff.
Quote:
On a PCE/GB/VB style 32-step PCM wavetable unit with nearest-neighbor resampling, a sawtooth wave won't have much more resolution than an NES triangle wave.
What's nearest-neighbor has to do with anything??? PCE is all period driven from a base clock of 3.579545mhz. Full resolution.
tomaitheous wrote:
Although, when I'm playing LOT port on the SegaCD - I can't figure out for the life of me why the colors are much reduced
PCE, GBA: 16 background palettes and 16 sprite palettes
SNES: 8 background palettes and 8 sprite palettes
MD: 4 background palettes, and sprites share the background palettes
Quote:
And the SegaCD is like 64bit, right?
Jaguar: Do the MA+H.
Quote:
tepples wrote:
On a PCE/GB/VB style 32-step PCM wavetable unit with nearest-neighbor resampling, a sawtooth wave won't have much more resolution than an NES triangle wave.
What's nearest-neighbor has to do with anything??? PCE is all period driven from a base clock of 3.579545mhz. Full resolution.
In digital signal processing, "nearest neighbor" refers to the kind of resampling that one gets from a
sample and hold circuit. Linear interpolation fits a linear curve across each sample period; Gaussian and cubic interpolation fit a smoother curve. The smoother curves are worse for representing square waves but better for representing sinusoids and other band-limited signals.
Quote:
PCE, GBA: 16 background palettes and 16 sprite palettes
SNES: 8 background palettes and 8 sprite palettes
MD: 4 background palettes, and sprites share the background palettes
I think you missed the sarcasm in my post
Quote:
In digital signal processing, "nearest neighbor" refers to the kind of resampling that one gets from a sample and hold circuit. Linear interpolation fits a linear curve across each sample period; Gaussian and cubic interpolation fit a smoother curve. The smoother curves are worse for representing square waves but better for representing sinusoids and other band-limited signals.
I know what nearest neighbor is; I'm asking what it has to do with PCE sawtooth and NES triangle? PCE is 5bit waveforms. In 32steps, all 32 amplitude values can be used. NES triangle peaks at 16 steps, then climbs down. How is that the same?
Anything above 7khz (per sample, not per 32 step cycle) on the PCE ramps towards the next sample (not the same as return to zero or decay to centerline). Something like a sawtooth climb has a nice smooth line (no stepping like you would think from 5bit PCM). Maybe because each channel has its own DAC, rather than digitally mixed and output on a single DAC.
tomaitheous wrote:
Quote:
In digital signal processing, "nearest neighbor" refers to the kind of resampling that one gets from a sample and hold circuit. Linear interpolation fits a linear curve across each sample period
I know what nearest neighbor is; I'm asking what it has to do with PCE sawtooth and NES triangle? PCE is 5bit waveforms. In 32steps, all 32 amplitude values can be used. NES triangle peaks at 16 steps, then climbs down. How is that the same?
PCE triangle would have steps 0, 2, 4, 6, 8, 10, ..., 28, 30, 30, 28, ... 6, 4, 2, correct?
Quote:
Anything above 7khz (per sample, not per 32 step cycle) on the PCE ramps towards the next sample (not the same as return to zero or decay to centerline). Something like a sawtooth climb has a nice smooth line (no stepping like you would think from 5bit PCM).
From your description, that sounds like either a low-pass filter or linear interpolation. I'm curious as to how sound actually works on PCE. Is there a recording of a sawtooth period sweep, including parts below and above 7 kHz sample rate, that I could examine in an audio editor?
Quote:
From your description, that sounds like either a low-pass filter or linear interpolation. I'm curious as to how sound actually works on PCE. Is there a recording of a sawtooth period sweep, including parts below and above 7 kHz sample rate, that I could examine in an audio editor?
Not linear interpolation, 'cause I can tap the lines directly from the chip before the AMP circuitry and they look pure digital (although extremely high temporal res - on the scope). And the low frequency settings give the usual return to zero artifacts (causes a slight metallic sound to notes in octave range 1 - especially noticeable for sinewave sample). Given that, I guess it has nothing to do each channel having a separate DAC (although there are still artifacts from changing the volume for each channel - a spike that causes a DC offset to that channel, the decays back to the normal centerline).
I can do a recording sometime this week.
Quote:
PCE triangle would have steps 0, 2, 4, 6, 8, 10, ..., 28, 30, 30, 28, ... 6, 4, 2, correct?
Correct.