candle Posted May 27, 2010 Share Posted May 27, 2010 After few days of work i've managed to implement POKEY's audio module As for now there are only registers D200-D209 and 2 bits of D20F, but this is enough to simulate sound output of real thing High-pass filters still waits for their tests, but everything else is confirmed to be working as it should. Apart from hi-pass filters i need to check ouput when POKEY is used for saw-tooth generation or sine-wave - but i need some examples for this if someone has strong nerves, may listen to draconus theme after day 2 of chip development for less resistant people here is draconus in version after day 3 day four was spent on bugfixes that didn't improove sound output that much, but day 5th seems to be final one - again draconus at this moment logic POKEY's logic implemented inside FPGA takes only 9% of its resources a tak wyglada aktualny "setup" (no... troche balagan) here is a "setpu" i'm using so far for this (sorry for the mess, wasn't ment for publishing this, but its almost 4AM, and i don't want to get on quest for camere right now) this core in stereo version will become part of SoundBoard Quote Link to comment Share on other sites More sharing options...
Rybags Posted May 27, 2010 Share Posted May 27, 2010 (edited) Nice. It actually sounds "purer" than real Pokey - I suppose maybe you don't get the decay after wave peak/troughs as much as the real sound system. The Delta RMT tune would be good for testing filters. Saw/triangle should be fairly straightforward to test - just plug values in and compare to a real machine. Saw uses Voice 1&3 in 1.79 MHz mode with Filter turned on for 1. Use 2 close values for AUDF in both voices (usually 1 or 2 apart), AUDC value for both should be $AF. Triangle, same deal except don't turn on the filter. In the case of both, the useful AUDF values tend to be around $10 thru $50 or thereabouts. Edited May 27, 2010 by Rybags Quote Link to comment Share on other sites More sharing options...
analmux Posted May 27, 2010 Share Posted May 27, 2010 ...As for now there are only registers D200-D209 and 2 bits of D20F, but this is enough to simulate sound output of real thing... Which 2 bits of D20F do you mean? Quote Link to comment Share on other sites More sharing options...
candle Posted May 27, 2010 Author Share Posted May 27, 2010 the lowest ones - just for reset pokey sound is degenerated by caps on output and then the effect is amplified by lm358 on Atari motherboard what is on output more remainds saw tooth than square wave so this is external to pokey Quote Link to comment Share on other sites More sharing options...
analmux Posted May 27, 2010 Share Posted May 27, 2010 the lowest ones - just for reset... Then you didn't include ALL Pokey's sound features. Quote Link to comment Share on other sites More sharing options...
candle Posted May 27, 2010 Author Share Posted May 27, 2010 i'm sure of that sio sounds of emulated pokey are diffrent from originals one - could you elaborate a bit more on this matter? Quote Link to comment Share on other sites More sharing options...
Rybags Posted May 27, 2010 Share Posted May 27, 2010 Two-tone would be what he's getting at. It's probably the last bastion for music and sound effects so is pretty unexplored, but IMO 100% necessary for any hardware duplication project such as this. Quote Link to comment Share on other sites More sharing options...
candle Posted May 27, 2010 Author Share Posted May 27, 2010 it surely will be included, as the goal is to have a working copy of all what inside the pokey in the end of the day anyway, i'm more than open for any test programs (as simple as possible) that would try to challange current emulation Quote Link to comment Share on other sites More sharing options...
Rybags Posted May 27, 2010 Share Posted May 27, 2010 Given that you're using only the 9% or so of the FPGA... shouldn't that then mean you probably could emulate the sound portion for at least a dozen extra Pokeys with ease. OK... at $D0x0 = 15 + the original, 64 voices, or 32 in 16 bit mode. Quote Link to comment Share on other sites More sharing options...
candle Posted May 27, 2010 Author Share Posted May 27, 2010 i want to add paula-like sound device for sampled music playback, and some sort of fm sythesis sid and audio portion of ricoh 2a03 i think i would start from latter one, if only someone could provide me with example music assuming base register for audio portion of ricoh chip at d600 Quote Link to comment Share on other sites More sharing options...
+Larry Posted May 27, 2010 Share Posted May 27, 2010 Hi Candle- Sounds terrific! I am constantly amazed by the cleverness and sophistication of your projects! -Larry Quote Link to comment Share on other sites More sharing options...
analmux Posted May 27, 2010 Share Posted May 27, 2010 it surely will be included, as the goal is to have a working copy of all what inside the pokey in the end of the day anyway, i'm more than open for any test programs (as simple as possible) that would try to challange current emulation Indeed, I mean the 2-tone mode. The 2-tone-filter is a serious and useful feature. Here's a tune I composed one year ago. It indeed makes use of the 2-tone-filter features (after 2:57 minutes). One of the purposes of this tune is to test emulators. It makes use of sawtooth, pulse wave, triangle, 2-tone, 16bit-filter, etc. On most current emulators it will not exactly sound as it should, so make sure you run it on the real machine. I'm not sure how to transform this into a test-song for your FPGA board. Maybe just record what values it's writing to which registers. However, handling the pulsewave feature is really timing-critical, so doubt it will be easy to make this tune sound as on real atari. Quote Link to comment Share on other sites More sharing options...
candle Posted May 27, 2010 Author Share Posted May 27, 2010 (edited) as expected, sine is missing due to cut-off frequency of used DAC (or rather lack of DAC at all - this is only PWM with low-pass filter producing semi-costant voltage with cuttoff frequency at about 225kHz) and its not related to emulation, but lack of two-tone generation is and is very audiable could you provide me with register content to produce constant two-tone output as used in this tune? instrumentarium without two tone generator Edited May 27, 2010 by candle Quote Link to comment Share on other sites More sharing options...
analmux Posted May 27, 2010 Share Posted May 27, 2010 could you provide me with register content to produce constant two-tone output as used in this tune? You already supported bit0&1 of $D20F. Writing 0xxx0x11 to $D20F is the normal mode: 2tone inactive. Writing 1xxx1x11 to $D20F is the mode I'm using in the demo tune. Explanation of this setting: bit 3 is set to 1 to activate 2tone mode itself. Then writing bits to the serial port will select the tone setting. Otherwise you can FORCE it to bitvalue 1 when setting also bit 7 of $D20F. That's why both bit 3&7 need to be set. There are other possible modes, f.e. 0xxx1x11, and this can also give some strange effects now and then, but as far as I remember correctly this isn't of much use for music. Quote Link to comment Share on other sites More sharing options...
candle Posted May 27, 2010 Author Share Posted May 27, 2010 (edited) seems to be working now instrumentarium with dual-tone generator it might be infected by data currently transmitted this "feature" would not be supported fully untill whole rest of POKEY chip will be synthetised let me know what you think about current emulation quality (disregarding lack of sine that is - can't do untill i change the DAC) Edited May 27, 2010 by candle Quote Link to comment Share on other sites More sharing options...
analmux Posted May 27, 2010 Share Posted May 27, 2010 Great!!! The 2-tone-filter instrument sounds very good. However, I listened with some more care now. The sawtooth emulation seems messed up a bit. The sound-type (timbre) itself sounds fine, but the resulting pitch is slightly too high. I have no idea though what causes this. Quote Link to comment Share on other sites More sharing options...
candle Posted May 27, 2010 Author Share Posted May 27, 2010 if i find some time for this i'll make "real" dac as it is inside pokey chip - will see then for now its just PWM running at 50mhz clock and reloaded every 256 ticks with new audio data audio data is produced by "pokey" circuitry on every falling edge of phi2 signal asynchronously from 50mhz one this forms low-pass filter, and because of pwm converter is far from beign perfect some aliasing effects may occour beside this we have 44khz sampling from pc soundcard, and mp3 compression won't make thing prettier Quote Link to comment Share on other sites More sharing options...
ctirad Posted May 28, 2010 Share Posted May 28, 2010 Hey, you saved a lot of my time I started to write a pokey in VHDL several months ago, but then I quickly found that even the big CPLD is not enough for at least clean voices, so I put it on ice. The FPGA is a solution, of course, but it would require more components around and also an external multichannel ADC or microcontroller to fully replace the Pokey chip. This is far from a simple and cheap Pokey drop in replacement I wanted to originally create. However, eventually I´d like to create such thing in a cheap ARM microcontroller. Quote Link to comment Share on other sites More sharing options...
candle Posted May 28, 2010 Author Share Posted May 28, 2010 actually it would fit inside xc95288 Quote Link to comment Share on other sites More sharing options...
ctirad Posted May 28, 2010 Share Posted May 28, 2010 actually it would fit inside xc95288 For the barebone 4 channel audio perhaps yes, but I wanted a full replacement with 8 channels. In addition this CPLD is very expensive. One can have five ARM cortex M3 MCUs for the same price. 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.