Offline
NC in the US of America

It's funny. When I try to make MIDIs with an NES sound, I always use the Sine Wave instrument for bass. Haha.

Offline
Sweden
rainwarrior wrote:

Lookup tables are fairly simple to implement as logic, I don't know what you mean by "sparing any ROM"; I wasn't talking about a lookup table like you would implement in software. At this scale, it would be similar in logic complexity to things like counters, and I mentioned them as a practical way to do a 4-bit 16-stage sine wave in comparison to the 4-bit 16-stage triangle. My point was that complexity was not the reason they didn't pick a sine wave; they didn't pick it because triangle is superior.

I am saying "sparing any ROM" because one of the peculiarities of a lookup table design is that you need a table to look samples up in. This would most likely be implemented as ROM on the chip surface, and definitely using a type of memory. Do you disagree? Either way, you would still need phase counters, so yes, there is complexity added by a LUT design. Also, sixteen samples at 4 bit resolution is distorted to the point where the difference to a triangle wave hardly matters. That's still only half the triangle time resolution.

But I agree somewhat with your point. For some extra chip area they could have done a LUT design. With some extra bit depth and some good table size they might even have made it reasonably resemble a sine wave. But why would they? Sines aren't as musically versatile unless you have a lot of them or some complex modulation techniques.

If you really want to know the particulars of the triangle implementation, you might learn how to read the Visual 2A03 project. I personally don't have the skill/knowledge to do it quickly, though, so I've kind of held off on attempting to gain knowledge that way.

That's a pretty cool thing! I couldn't read it at gunpoint, though.

The SID is a great chip, and that's a cool article (thanks for linking it). Its design is drastically different though; particularly how it uses one underlying binary counter to output the 3 different waveforms by changing how its bits are output. (Compare to the 2A03 where each channel has a single purpose.) A large sine wave LUT with resolution like the other 3 waveforms would be impractical for this for sure, but a 4-bit/16-step sine wave LUT would probably have been quite doable actually for the SID -- though it would have been pointless to implement such a thing.

The SID is a different design for sure, but I have no doubts that the basic idea of waveform generation by simple logic applied to the phase accumulator output is similar to that of the NES.

Anyway, "doable" is far from the only concern when designing consumer electronics. Production/design cost and time probably weighed more in both the case of the SID and the 2A03 APU.

Last edited by boomlinde (Jul 25, 2012 7:00 pm)

Offline
Buenos Aires, Argentina

Because it's the most "bass similar" waveform that could be achieved with the targeted hardware by Nintendo.

Offline
Toronto, Canada

No, the complexity of a LUT for a 4-bit sine would not be very significant, and I think it's weird to call it ROM because its small size and specific purpose allows a great deal of simplifications vs a generic "ROM", but I think we're off topic. The point was that I think a sine was a viable option, electronics wise, but wouldn't have been as useful as a triangle anyway.

Last edited by rainwarrior (Jul 25, 2012 8:57 pm)

Offline
Sweden

I never said it would be "very" significant (if it's a matter of a 4 bit inverter vs a tiny adressable LUT), but I think that the added complexity vs. what you gain in sound quality made it an easy choice for the chip designers even if they'd preferred to have a sine wave. Chip surface was a scarcity, and since the APU shared die with the CPU and other circuitry, I assume the designers were instructed to cut corners when possible.

I don't see what significant simplifications you could apply to a 16*4 bit sine wave table. With a sine wave you could get away with storing a quarter of it (as they did in OPL type chips), but then I think you'd need two more inverters to reassemble it. What other kinds of simplifications do you have in mind? What is a generic ROM?

If you disagree on the use of the word ROM (which is exactly what it is), can you at least suggest an alternative?

Offline
Toronto, Canada

No, not really. I don't really have any desire to argue what words mean. I only wanted to clarify what I was trying to say, which was that the decision not to use sine was probably not a cost saving measure, and you seem to at least partly agree with this, don't you? I don't think I will get anything out of trying to design/describe an actual sine generator circuit, so please excuse me if I leave off details of that at this point. I'm sure you could do it as well as I can. I was a little confused by the words you were using, but I think we know what each-other means by now.

There are a number of things on the chip that could have been cut with some foresight, I think. The envelope and length counters in particular don't offer much, and the majority of games ignore them. The length counter in particular has a rather large and useless lookup table attached to it. The triangle has its own redundant "linear counter" in addition to the length counter; not sure what that was about.

Another weird thing is that the periodic noise mode was apparently not present in the original run of Famicom units. Not sure what the story is on that one; maybe there was a problem that disabled it by accident that they fixed in subsequent runs?

Offline
Sweden

I'm beginning to suspect it's a matter of how we put it rather than much of an actual disagreement smile. I agree that whatever the cost of a wavetable, a triangle must have been an obvious choice over a sine for reasons that you already mentioned. Though, if they'd wanted a reasonable sine, I think they would have gone for something more complex than sixteen step 4 bit wavetable. Say, 6 or 7 bit output, double the period increment rate, and a 32 step half-sine LUT fed by the output of the existing triangle circuitry.

I didn't know about the length counter LUT. Seems like the designers went crazy over some very specific use cases.

Offline

it also wasn't all about music right?  i think they had to use the chips to do sound effects for the games also.

Offline
buffalo, NY
electricloverecords wrote:

it also wasn't all about music right?  i think they had to use the chips to do sound effects for the games also.

at the exact same time.

Offline
Russia, Moscow

I'm sure sound effects were the main concern of designers of 2A03. As for music, they maybe were expecting to do short jingles and simple background loops, but certainly not something that Konami or Sunsoft brought much later.

Offline

so then, why a triangle for sound fx instead of saw?

Offline
uhajdafdfdfa

i think as it was already mentioned a saw sounds a lot like a 12.5% pulse wave in terms of the timbre (aka shit) and a triangle sounds really good and there is no real difference in implementation so why not use a triangle

Offline
Milwaukee, WI

Why doesn't someone just ask Nintendo?

Offline
Toronto, Canada

The hardware sweep was especially suited for sound effects. The envelopes and length counters were evidently designed with both music and sound effects in mind, though in the end since you could get a lot more versatility (for both music and sound) by ignoring them and building software macros, most games did so.

boomlinde, something that just occurred to me that's kind of interesting design-wise different between SID and 2A03: 2A03's oscillators are all clock dividers, i.e. you have some counter that puts out a pulse every N clocks, which then drives the waveform generator. The SID being an accumulator adds N to the accumulator on every clock, and the high bits are (almost) directly used as the waveform output. The 2A03 units all have another output stage. This is visible to the user by whether the frequency registers increase or decrease with pitch; some Famicom expansions accumulate: FDS, N163, VRC7, others divide: MMC5, VRC6, 5B. The ones that accumulate all happen to use wavetables, incidentally.

Quietust has a few visual 2A03 overlays on his page, this one diagrams all the chip regions he's determined the function of: http://www.qmtpro.com/~nes/chipimages/r … egions.png

Offline
Russia, Moscow

'Nintendo' is a very abstract person to ask, the company by itself didn't actually designed the hardware, so they don't know the answer. A few japanese engineer guys did it like 30 years ago, that's who should be asked, if it is even possible to even find them now.

Offline
matt's mind

maybe its listed on the patent?  they have a lot of that info.

the patents for the game boy player are online, not sure why the ones from this console wouldn't be.

nintendo has a shit ton of patents available to view...  just takes a bit of searching through the US Patent database.  (as they're headquartered in Redmond, WA in the US, and took out US Patents, all this info should be centralized in the US Patent office).

they've recently been cited in court for 'patent trolling' too, can't remember what the legal term is.