What the NES Would Sound Like if it Were an Atari 2600
Moderator: Moderators
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.
* 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.
/* this is a comment */
- Hamtaro126
- Posts: 786
- Joined: Thu Jan 19, 2006 5:08 pm
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.
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.
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.
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.
/* this is a comment */
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!
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!
/* this is a comment */
- Hamtaro126
- Posts: 786
- Joined: Thu Jan 19, 2006 5:08 pm