StinkerB06 Posted December 4, 2017 Share Posted December 4, 2017 I found most emulators have sound that is accurate to the hardware, and the TIA involves two channels with a 9-bit polynomial counter each. The TIA involves 16 waveshape selections, with most of them duplicated and some silent. These range from pure squares, to buzzy tones, to white noise. But the problem is, every doc I found on the internet does not provide the exact timbral or feedback taps that give the sounds their accuracy. If any TIA emulator developer knows of these, let me know immediately! Quote Link to comment Share on other sites More sharing options...
Rybags Posted December 5, 2017 Share Posted December 5, 2017 Poly counters = LFSRs (Linear Feedback Shift Register). They can be replicated programatically easily. With an LFSR the existing value is shifted, 2 existing bits have a formula applied (like XOR) which is used as the incoming bit, and another bit is tapped to use in the audio algorithm. AFAIK with Atari's use of them with TIA and Pokey the audio algorithm might either use the LFSR output directly or AND it with the flip/flop that toggles at AUDF frequency that if selected by AUDC would normally give a pure tone. There's various length polys, the values generated are predictable and easily reproducable and repeat each 2 to the power of (n-1) samples. From memory the Pokey polys update every machine cycle but the TIA ones update based on the AUDF value for each voice. The problem with updating indepdendant of AUDF is that in some situations the AUDF divisor will mean you can read the same sample which gives silent output. Not sure if the exact LFSR algorithms are documented on a webpage but emulator source code would likely have the info required. Quote Link to comment Share on other sites More sharing options...
iesposta Posted December 5, 2017 Share Posted December 5, 2017 The current best 2600 emulator, Stella, doesn't get it totally correct. An upcoming version will improve the audio reproduction, but of course at the cost of using more processor power. I read a long text that thoroughly explained the sound generation. I don't remember where, but someone here may remember the link. Quote Link to comment Share on other sites More sharing options...
+stephena Posted December 5, 2017 Share Posted December 5, 2017 IMO, none of the 2600 emulators has ever gotten this fully correct, since they were almost all based on Ron Fries sound code, which, while quite accurate, described sound at a high level, and didn't take interference patterns into account (where each channel interferes with the other). There has been much work done on this over the past year. It started with a document by Crispy, then my attempt to get it working in Stella, and finally new code being added to Stellerator. This work is being ported to Stella, and will be present in the next major point release after 5.1. Some documentation on this as follows: Issue created on Stella github page (contains initial document by Crispy and some extra info): https://github.com/stella-emu/stella/issues/80 Extra info from TJ about the new findings: http://atariage.com/forums/topic/271920-tia-sound-abnormalities 2 Quote Link to comment Share on other sites More sharing options...
DirtyHairy Posted December 5, 2017 Share Posted December 5, 2017 (edited) The only full "documentation" of the audio generation logic that I am currently aware of: Crispys audio code (available in the old new-sound branch in the Stella repo on github) The implementation in 6502.ts which is a straightforward port of said code The TIA schematics If you're curious, you can find the relevant code in Stella here and in 6502.ts here and here. I am currently in the progress of porting the rewritten audio code back to Stella. Edited December 5, 2017 by DirtyHairy Quote Link to comment Share on other sites More sharing options...
vidak Posted December 6, 2017 Share Posted December 6, 2017 I remember there being some discussion about the TIA sound polynomial counters in the Stella Mailing List. If you search "polynomial" in my Commo Dig you should see the discussion I logged down. Not sure if it's useful though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.