ivop Posted May 7, 2018 Share Posted May 7, 2018 Did some preliminary timing tests and I'm afraid there's not much chance of a new AtariSid version incorporating this new sample playing method. The main culprit is that I need to switch to timer 4 for the 15kHz timer, but then I'll lose the 'inc IRQEN' trick to reset the timer. Also, I'd have to drop the noise generators and switch back to random noise samples (which sound metalic). Some very fast player routines might still work (Laxity's for example), but Jeroen Tel's player is definitely too slow... BTW I did a PWM version back when phaeron published his experiments. It worked, but I really can't stand the carrier tone. 2 Quote Link to comment Share on other sites More sharing options...
ivop Posted May 7, 2018 Share Posted May 7, 2018 BTW2 I see that you disable dither on your sox commands. I guess, for songs with little to no silent parts, it might help enable dither and use triangular noise shaping to avoid the most noticeable frequency bands, in order to expand the dynamic range somewhat more. 2 Quote Link to comment Share on other sites More sharing options...
tebe Posted May 7, 2018 Share Posted May 7, 2018 Not sure how they managed it on the C64, but it sounds like pressed through a compander. http://brokenbytes.blogspot.ch/2018/03/a-48khz-digital-music-player-for.html http://www.hotstyle64.com/pl/issues/5/odtwarzanie%20sampli%20na%20c64 Quote Link to comment Share on other sites More sharing options...
NRV Posted May 7, 2018 Share Posted May 7, 2018 I went back and did my last "megamix" in pdm 8 bits at 15.7Khz. I was already using one byte per sample so the memory consumption is the same and there is no carrier frequency. I don't know about real hardware, but in emulation it sounds reeeeally nice. Come one.. what's next.. a 320x200 mode with 16 colors? Stop moving the goalpost guys mixpdm.zip 8 Quote Link to comment Share on other sites More sharing options...
Xuel Posted May 7, 2018 Share Posted May 7, 2018 I went back and did my last "megamix" in pdm 8 bits at 15.7Khz. I was already using one byte per sample so the memory consumption is the same and there is no carrier frequency. I don't know about real hardware, but in emulation it sounds reeeeally nice. Sounds excellent! So amazing that this method has been there in POKEY this whole time and we're just now realizing it, amiright?! Huge kudos to kool kitty89 for showing us the light. 5 Quote Link to comment Share on other sites More sharing options...
Xuel Posted May 7, 2018 Share Posted May 7, 2018 I'm not sure if this technique is ever actually used in existing games or demos, but using 2 POKEY channels and two timers, it should be possible to get 8-bit linear PCM output through POKEY. Set one timer to the desired sample rate and set one 4-bit volume level for the upper 4 bits of a sample while the lower 4 bits go to the other channel. The second channel gets its volume then cut again to 1/16 by using the second timer to set the duration of the pulse to 1/16 of a sample period. Is this method something you've seen used elsewhere? What gave you the idea? It's so obvious now that I know it but I would have never come up with it on my own. Thanks for the mind expansion. 4 Quote Link to comment Share on other sites More sharing options...
Gunstar Posted May 7, 2018 Share Posted May 7, 2018 This is exciting stuff, of course I am ignorant of the vast majority of the sound tech speak here. Now, would this process be limited to just two voice channels due to processing overhead, or could this be enhanced further with a second two voices doing the same thing, and possibly further enhanced with a second POKEY chip too? Quote Link to comment Share on other sites More sharing options...
Xuel Posted May 7, 2018 Share Posted May 7, 2018 http://atariage.com/forums/topic/278463-pwm-experiments/ I just realized that kool kitty89 actually originally posted this back in 2015! So, huge thanks to you for bumping the thread. 4 Quote Link to comment Share on other sites More sharing options...
+CharlieChaplin Posted May 7, 2018 Share Posted May 7, 2018 (edited) Hmmm, could this trick be used for MOD-players as well ?!? Afaik, most MOD players playback MOD with 4bit, 5bit or max. 6bit resolution, only with Covox they can playback with 8bit resolution. But if this trick would also work with MOD-players (that would have to be programmed then), it would make the Covox device more or less obsolete... Maybe something for TeBe and his Inertia (MOD) player or for Epi and his Neotracker... Edited May 7, 2018 by CharlieChaplin 2 Quote Link to comment Share on other sites More sharing options...
Xuel Posted May 8, 2018 Share Posted May 8, 2018 This is exciting stuff, of course I am ignorant of the vast majority of the sound tech speak here. Now, would this process be limited to just two voice channels due to processing overhead, or could this be enhanced further with a second two voices doing the same thing, and possibly further enhanced with a second POKEY chip too? The new method actually requires three channels, either 1,2,3 or 1,3,4. Channel 2 or 4 plays the high 4-bits. Then both 1.79Mhz channels (1+3) are paired via the high pass filter to create the 1/16 signal (effectively DC at 1/16 VCC) for the low 4-bits. That leaves one channel that could play normal 15KHz or 64KHz sound or 4-bit PCM. You could definitely use a second POKEY to achieve stereo. I've actually experimented with that using PWM but I'll save that for a different thread some other time. BTW, I share kool kitty89's reservations about calling this new method PDM since the pulse density is actually constant, not modulated. What shall we call this new method? PCM44? BTW, another thing I realized is that you could vary the pulse signal from 1/16 to 16/16 as a master volume control on a 4-bit PCM sample. Kinda interesting. Not sure how useful it is since it would only work for one channel. 1 Quote Link to comment Share on other sites More sharing options...
NRV Posted May 8, 2018 Share Posted May 8, 2018 PCM44 because of the 44KHz rate?, could be.. Well you could do it at other rates also... PCMX?, the X could be for extra, extended, xuel.. Hope you document all your ideas at some point (could be in the wiki). Maybe some of them doesn't have an application now, but you never know who could use them later Quote Link to comment Share on other sites More sharing options...
phaeron Posted May 8, 2018 Share Posted May 8, 2018 I loaded this onto a MaxFlash cart and am getting some noise during playback: Top is line-in recording from 800XL, bottom is 64KHz audio tap from Altirra. Looks like the LSBs are playing at too high of a volume and chopping the MSB wave. In contrast, the PWM demos match much more closely: Not sure what's going on specifically yet... not enough resolution to see what's going on with the audio input and too chaotic to use the scope. Have to check whether high-pass timing might differ between the 800XL and 130XE. Unfortunately, only one MaxFlash cart makes switching between the two demos kind of painful. 5 Quote Link to comment Share on other sites More sharing options...
antrykot Posted May 8, 2018 Share Posted May 8, 2018 I share kool kitty89's reservations about calling this new method PDM since the pulse density is actually constant, not modulated. What shall we call this new method? PCM44? Because it works by multiplying 4-bit PCM by 1/16 PWM, it could be called PCM × PWM 1/16 or PCM × 1/16 or PCM * 1/16. Quote Link to comment Share on other sites More sharing options...
R0ger Posted May 8, 2018 Share Posted May 8, 2018 I'd call it 4 by 4 1 Quote Link to comment Share on other sites More sharing options...
Xuel Posted May 8, 2018 Share Posted May 8, 2018 Not sure what's going on specifically yet... not enough resolution to see what's going on with the audio input and too chaotic to use the scope. Have to check whether high-pass timing might differ between the 800XL and 130XE. Unfortunately, only one MaxFlash cart makes switching between the two demos kind of painful. Ugh. Hopefully not the nail in the coffin for getting this to work on real hardware. Here's a calibration program: calibrate.xex Maybe a different setting for Pulse Y would fix it on real hardware? I used 12 and 13 for X and Y in the original code. The X/Y values are used as follows: ; Set up 1/16 dutycycle HiPass on 1+3 mvx optpulsex AUDF1 mva optpulsey AUDF3 sta STIMER stx AUDF3 Full code here. 1 Quote Link to comment Share on other sites More sharing options...
Mr_Mary Posted May 8, 2018 Share Posted May 8, 2018 For the love of me I can't seem to make anything with this thing.The furthest I got was to get waveform.bin, and some form of .obx, but that crashes in emu (duh)I could make a cart on my own with supplied tools, but there's no bank0.bin Quote Link to comment Share on other sites More sharing options...
mono Posted May 8, 2018 Share Posted May 8, 2018 (edited) Why don't you use AUDC3 for $1x coarse level ($x0) sample part instead of AUDC2 (AUDC3 is using to dutycycle control of AUDC1 wave and is always deaf)? I think your method could use only two channels: AUDC1 for fine 1/16 sublevels and AUDC3 for coarse level and left AUDC2 and AUDC4 for other sound (it's a shame that they can't be clocked by 1.77MHz :/, however what do you think about using 64kHz and 1/3 carrier for them?). Edited May 8, 2018 by mono 1 Quote Link to comment Share on other sites More sharing options...
Xuel Posted May 8, 2018 Share Posted May 8, 2018 PCM44 because of the 44KHz rate?, could be.. Well you could do it at other rates also... PCMX?, the X could be for extra, extended, xuel.. Hope you document all your ideas at some point (could be in the wiki). Maybe some of them doesn't have an application now, but you never know who could use them later I was thinking of PCM44 as a reference to 4-bit PCM for MSB and 4-bit PCM for LSB. How about PCM4+4 to disambiguate? Because it works by multiplying 4-bit PCM by 1/16 PWM, it could be called PCM × PWM 1/16 or PCM × 1/16 or PCM * 1/16. I hesitate to call the LSB PWM since the pulse width isn't being modulated, only the amplitude. Quote Link to comment Share on other sites More sharing options...
Xuel Posted May 8, 2018 Share Posted May 8, 2018 For the love of me I can't seem to make anything with this thing. The furthest I got was to get waveform.bin, and some form of .obx, but that crashes in emu (duh) I could make a cart on my own with supplied tools, but there's no bank0.bin What environment are you using? You need a unix-like environment with Perl, make, xasm and sox. Cygwin works well for me on Windows. Edit the Makefile and replace "Demovibes11.raw" with "XXX.raw" where XXX.mp3 is the name of your .mp3 file. Then you can type "make thecart.car". PM me if you still are having trouble. Quote Link to comment Share on other sites More sharing options...
Xuel Posted May 8, 2018 Share Posted May 8, 2018 Why don't you use AUDC3 for $1x coarse level ($x0) sample part instead of AUDC2 (AUDC3 is using to dutycycle control of AUDC1 wave and is always deaf)? I think your method could use only two channels: AUDC1 for fine 1/16 sublevels and AUDC3 for coarse level and left AUDC2 and AUDC4 for other sound (it's a shame that they can't be clocked by 1.77MHz :/, however what do you think about using 64kHz and 1/3 carrier for them?). Great idea! Works like a charm: calibrate.xex Could you elaborate on the 64kHz 1/3 carrier idea? 1 Quote Link to comment Share on other sites More sharing options...
Mr_Mary Posted May 8, 2018 Share Posted May 8, 2018 (edited) Oh, didn't know about that you need to provide parameters, wasn't described anywhereworks now, cheers! Also, how hard would it be to make a version for use with shorter mp3s that actually could be loaded onto computers expanded to 1MB? Edited May 8, 2018 by Mr_Mary Quote Link to comment Share on other sites More sharing options...
antrykot Posted May 8, 2018 Share Posted May 8, 2018 (edited) So it looks like on a real hardware to get 1/16 duty cycle we need to do this mvx #12 AUDF1 mva #14 AUDF3 sta STIMER stx AUDF3 In other words, in calibrate.xex program set Pulse Y parameter to 14 and Pulse X to 12 Edited May 8, 2018 by antrykot 2 Quote Link to comment Share on other sites More sharing options...
emkay Posted May 8, 2018 Share Posted May 8, 2018 http://brokenbytes.blogspot.ch/2018/03/a-48khz-digital-music-player-for.html I know that article. But it lefts some relevant points out. And the Result really doesn't sound like "8Bit 48kHz". What you hear in this thread is something real , more regular, more clean. Quote Link to comment Share on other sites More sharing options...
Poison Posted May 8, 2018 Share Posted May 8, 2018 I try to use all *.car from this toppic with Ultimate Cart and it do not work on real atari. It wrote Unsuported car format. Should it wokrs on real atari? 1 Quote Link to comment Share on other sites More sharing options...
emkay Posted May 8, 2018 Share Posted May 8, 2018 Not sure what's going on specifically yet... not enough resolution to see what's going on with the audio input and too chaotic to use the scope. Have to check whether high-pass timing might differ between the 800XL and 130XE. Unfortunately, only one MaxFlash cart makes switching between the two demos kind of painful. Have you checked the response time? As far as I know, POKEY needs around 32 cycles to act on the generators. Possibly it's the same with the volume and the interrupts. 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.