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.