What the NES Would Sound Like if it Were an Atari 2600

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
What the NES Would Sound Like if it Were an Atari 2600
by on (#74163)
Well I got bored last night and decided to hook up the TIA audio block to my NES FPGA and play some games and music and record the results. Not much more to say than that. So here it is.

http://blog.kevtris.org/blogfiles/nes2600.mp3

Sounds are from:

1) Super Mario Bros
2) Super Mario Bros 2
3) Megaman 2 (Metalman stage)
4) Neotoxin (track 10h)
5) Super Mario Bros 3

by on (#74166)
The SMB2 underground theme through your emulated 2600 sort of reminds me of how I imagined it might sound on the Game Boy (with abuse of the Game Boy's looped noise pitches, which are very close to C-D-F-G#).

I imagine this isn't without the TIA's limitation on simultaneous channels or period granularity.

by on (#74171)
Well all I can say is thanks god it sounds like the NES !!

by on (#74172)
Good old Bregalad, thinking that everything that isn't 100% to his liking is crap...

I think it sounds pretty good. I didn't understand what exactly happened here though... How did you get NES code to interact with the TIA? Are you performing some sort of on-the-fly conversion of 2A03 registers to TIA registers or are you just making the NES channels as limited as Atari channels?

Anyway, it sounds pretty good for an Atari 2600 (although I guess there are more than 2 channels there), and makes us imagine what could have been done on the 2600 if ROM space wasn't so scarce. I have heard some pretty impressive new compositions for the 2600, and I imagine that the NES tunes could sound very decent if someone adapted them manually while taking the hardware limitations into consideration.

by on (#74176)
tepples wrote:
The SMB2 underground theme through your emulated 2600 sort of reminds me of how I imagined it might sound on the Game Boy (with abuse of the Game Boy's looped noise pitches, which are very close to C-D-F-G#).

I imagine this isn't without the TIA's limitation on simultaneous channels or period granularity.


Correct, what I did was took the NES divider outputs for the squares and triangle, and fed them into the TIA block from the FPGA 2600 I made. The output of the NES' dividers then clocks the TIA block.

It still retains the TIA's 5 bit divider which I used to try and tweak pitches so they were mostly in tune with each other.

Not surprisingly, I mapped the registers at 2600h in the address space, hehe. You can control the "distortion type" and the divider which gives some control of pitch relative to the other channels. It's also possible to swap between the original NES channel and the TIA version.

The two squares just take the output of the divider directly and volume is still controlled by the volume hardware on the NES stuff.

Triangle is a bit different, and there's a fixed volume register you can write to. Otherwise that channel overpowers the other two.

Noise and DPCM are unaffected.

In total then there's three "TIA like" channels.

by on (#74188)
I wonder what kind of decoder it'd take to put the TIA at $4600 as a Famicom expansion sound chip.

by on (#74189)
Last night on IRC I asked about the feasibility of doing something just like that, but at $4100 (I was unaware that $4600 was "special" already) and use a PIC to emulate a TIA, as I imagine that real TIAs are hard to find.

by on (#74190)
tepples wrote:
I wonder what kind of decoder it'd take to put the TIA at $4600 as a Famicom expansion sound chip.


That'd be pretty easy to do. I suspect it'd work if you did it like this:

Connect M2 to the TIA's clock in, then A0-A5 and D0-D7 to the usual places.

you'd also connect M2 to the phi2 input on the TIA.

Then, you get a few chip enables. 1 positive, 3 negative. To put it in at say, 4800 you have to decode A11-A15 in the pattern 11001 (A15 being inverted on the cart port as /CE to the PRG ROM). A 74138 would do. A, B, C inputs would be A13-15 respectively, /E1 would connect to A12, /E2 to ground, and +E3 to A11.

Output 6 would connect to /CE on the TIA with the other 3 TIA chip enables grounded and/or pulled to VCC to enable them permanently.

The only thing I'd be worried about would be the 1.78MHz clock on the inputs vs. the 1.19MHz it's used to, but I highly doubt it'd be a problem since most of the video stuff runs at 3.579MHz anyways.

by on (#74201)
Wow, these sound great, especially the SMB2 clip.

by on (#74207)
Hah, good stuff! :D

by on (#74209)
Wow - SMB2 & Metal Man sound great! :o

Okay never mind (still listening to it). :?
Re: What the NES Would Sound Like if it Were an Atari 2600
by on (#74220)
kevtris wrote:
Well I got bored last night and decided to hook up the TIA audio block to my NES FPGA and play some games and music and record the results. Not much more to say than that.


Can there be a way to test it myself, I wanted to do it, But if you had posted what you did in a schematic/pinout format (Nesdev Wiki comes to mind), maybe I can make it myself, I have a regular NES to hack if you care,

by on (#74442)
kevtris wrote:
tepples wrote:
I wonder what kind of decoder it'd take to put the TIA at $4600 as a Famicom expansion sound chip.


That'd be pretty easy to do. I suspect it'd work if you did it like this:

Connect M2 to the TIA's clock in, then A0-A5 and D0-D7 to the usual places.

you'd also connect M2 to the phi2 input on the TIA.

Then, you get a few chip enables. 1 positive, 3 negative. To put it in at say, 4800 you have to decode A11-A15 in the pattern 11001 (A15 being inverted on the cart port as /CE to the PRG ROM). A 74138 would do. A, B, C inputs would be A13-15 respectively, /E1 would connect to A12, /E2 to ground, and +E3 to A11.

Output 6 would connect to /CE on the TIA with the other 3 TIA chip enables grounded and/or pulled to VCC to enable them permanently.

The only thing I'd be worried about would be the 1.78MHz clock on the inputs vs. the 1.19MHz it's used to, but I highly doubt it'd be a problem since most of the video stuff runs at 3.579MHz anyways.


If someone actually did this that would be awesome. I'd love to build a cartridge with a TIA built in! The sound example is wonderful!

by on (#74452)
- Very interesting! Could it be emulated? :) No, I'm not joking.

by on (#74471)
kev:

How many TIAs are used in this, also are you using false pitch dividers?

by on (#74473)
If "false pitch dividers" is what I think you mean, then yes, as was explained to me on IRC.

by on (#74515)
Well due to popular demand here's more! This time I did a proper job and produced single tracks each having 1 song, with clean ends and no sfx or other interruptions.

* Boulderdash
* Castlevania (3 tracks)
* Megaman
* Caesar's Palace
* Metroid
* Silver Surfer
* SMB3 (4 different distortions)

http://blog.kevtris.org/blogfiles/nes%20tia/


To answer the question earlier from b00d about if I am using "false dividers", kinda. It's all on my FPGA right now so I get some more latitude in what normally could be done.

It's "stock" TIA channels, but the clock for them is being fed from my dividers for the NES channels. This means that the divider that generates the square waves/triangle is being used to clock the TIA. A "real" TIA cannot natively produce the tonal range I am getting. For my divider, I run it off the 1.78MHz directly, divided by the NES pitch register value, then feed it directly into the TIA block.

1.78MHz -> NES pitch divider -> TIA divider -> TIA shift registers

However, you COULD run a few TIA's off a PIC micro or similar CPU and run its clock line off one of the microcontroller's timers to do the same thing. On the TIA, the audio clock generation (via the 3.579MHz input) is separate from the CPU input clock (M2) so doing this is not a problem.

I then just write to my TIA channel registers manually through my debugger while the music plays which are mapped into NES address space at 2600h and up. Figured putting them there would be appropriate. I can change distortion, pitch (via the TIA's 5 bit divider) to "tune" channels a bit, and then I can turn the channel on or off and finally select the triangle channel's TIA volume (since otherwise it'd be overpoweringly loud).

If anyone wants to reproduce what I did the register mappings I used were:

2600-2602: select distortion #
2603-2605: select divider
2606-2608: select mode
2609: TIA triangle channel volume

the registers above are arranged in sets of three. The first register of a group is for square 0, the second register is square 1, and the third is triangle.

2600-2602 selects one of the 16 TIA "distortions" for the channel (low 4 bits)

2603-2605 selects the divider on the TIA (5 bits) which divides the incoming clock before sending it to the shifters that make the sound

2606-2608 selects if this particular channel will be NES or TIA. When bit 0 is clear, the regular stock NES audio comes out of the channel. when set, TIA audio comes out.

2609 sets the volume for the triangle channel in TIA mode only. Since the NES cannot control the volume of the triangle, it is required for the TIA, otherwise it overpowers the other 2 channels. The lower 4 bits were used for volume.


I found that using a divider of 0fh for the squares and 1fh for the triangle worked pretty nice for most things. distortion #5, 7, 9, A, B "go together" pretty well.... #6 does too but it's a quieter more "musical" sounding one. You have to adjust the triangle volume a bit though to make it match the squares if this is done.

Distortions 3 and f sound really interesting but are hard to use since the apparent pitch moves up and down as it plays, kind of an "Eeeoooeeeooo" sound. 2 and e are very low pitch and you have to crank up the pitch using the divider at 0 or 1, and then it's hard to "tune" the squares to it unless you use 2 or e for them also.

divider values of 3, 7, F, and 1F seem to work the best since they are multiples of each other. (reload is N-1, so that means the division ratios are 4, 8, 10, and 20h). I didn't try any "odd" ratios like 3, 6, 12, 24 or whatever... maybe I should. The 3/7/f/1f set sounded the best musically so far.

Sorry for a bit of rambling but that's pretty much all there is to know about how I did it and how to implement it on an emulator if someone wanted to give it a shot. It shouldn't be very hard to add.

by on (#74528)
Thanks for sharing these, I really like them. Are you going to do more? Would you consider giving the treatment to any tunes from Wizards and Warriors 1-3?

by on (#74547)
*ahem*

- Could someone answer me if such sound could be reproduced by an emulator?

by on (#74551)
Zepper wrote:
- Could someone answer me if such sound could be reproduced by an emulator?

It probably could, if you can write code to emulate the sound part of the TIA. I still haven't understood exactly how kevtris "glued" it all up, but maybe he can give tips on how to make this in software...

by on (#74555)
https://stella.svn.sourceforge.net/svnr ... TIASnd.cxx

by on (#74557)
The emulator project should be called Project:Tiger

If someone can do TIA for NSF and NES emulators, That's Grrrrrreat!!!

If so, NSFs with TIA can be accessed with unused bit 6 or 7

(This post, really has no relation to, but mocks Tony the tiger.)

by on (#74559)
This is sounding really cool. On my Squeedo synth (on a PIC18 originally, so yeah a PIC can do something like this) I want to get some sound like this too, the wavetable synth will include some 2600 and POKEY waveforms. I've got the waveforms already, but haven't resampled them to the right size yet. It doesn't have an NSF player as part of it, but it probably could be hooked up to use the same format kevtris used for similar output. It won't sound identical to this though, the tuning would be different.

Since my newer synth is written in C, the hope is that it could be supported on any emulators by using a DLL I'll build of it. So in theory, it should sound identical to the hardware version, no matter how strange the algorithms get.

by on (#74560)
BUT WAIT, THERE'S MORE! If you order right now, you'll also receive these 10 great new tracks!

Well not really, but I did make 10 more tracks!

I took a few suggestions and gave it a whirl and this is what I added tonight:

* Linus Spacehead (three tracks, using some of the weirder waveforms)
* Faxanadu (two tracks)
* Wizards and Warriors 1 (2 tracks)
* Wizards and Warriors 2
* Ducktales (the moon)
* Adventure Island

http://blog.kevtris.org/blogfiles/nes%20tia/

enjoy.

by on (#74587)
kevtris wrote:
enjoy.


Thank you so much! These are so cool!

edit:Are you familiar with Conquest of the Crystal Palace? I think there might be one or two good tracks from that game for this.

by on (#74608)
- kev: care to record some boss music, like from MegaMan games? ^_^;;

by on (#74729)
I wish I knew why this music sounds so good to my ears. I never had an Atari 2600. I've been listening to it a lot. Maybe it is the creativity that I am appreciating? Anyway, it's good stuff. Thanks again.

by on (#74905)
Ask and ye shall receive. I have done a few more tracks including some requests.


This time I have added:

* Megaman 2 boss music
* Memblers' Chipography (3 tracks)
* abadidea's Her Courage
* GI Joe track 7
* Novayoshi's "life2.nsf"

Also, I have added a single archive with all the tracks in it for easy leechage.

http://blog.kevtris.org/blogfiles/nes%20tia/

Enjoy!

by on (#74907)
- Awesome, thanks a lot for the MM2 boss music! :)

by on (#74911)
Hebereke Music Everyone???

Also, Wagyan Land and Yo! Noid

by on (#75333)
Haha, these are really cool. Neat idea!

by on (#76439)
I would love to have a nes playing through atari 2600. It just shows you the power of an atari 2600. One of the things is that the pitch seems to be just a tiny bit to high, other than that the music is pure awesome. Maybe we could call it the Nestari.