Irgendwer Posted October 5, 2018 Share Posted October 5, 2018 (edited) [Edit: Sorry for the typo in the title, maybe a moderator is able to apply the change to "pseudo"...] This is nothing new, but I found the principle behind this sound generation nowhere explained, so I explored the subject by myself - maybe it's of some interest. Back in the 80's, there was this German "Atari music programming language" production called "Masic". http://www.atarimania.com/utility-atari-400-800-xl-xe-masic_12533.html AFAIR on the second side of the disk was a sample song, using a kind of Pokey sine-wave like voice I never heard before or after again: (Jump to 2:21!) Just inspecting the Pokey registers, I discovered the following: The first and second voice are configured by AUDCTL to be timed with 1.79 MHz. Then the frequency selection utilizes the beat effect https://en.wikipedia.org/wiki/Beat_(acoustics) to produce the audible tone. Ideally the both carrier frequencies are out of the human perceivable frequency range, but forming the desired sub-frequencies you have to trade. Additionally, coming from a square wave, you aren't able to construct a perfect sine, but have some jitters. Both effects are recognizable in the demo tune above. I've create a small Turbo-Basic test program, demonstrating the effect: 10 REM PSEUDO SINE-WAVE POKEY OUTPUT 20 BASEFREQ=62:PFRQ=1773447 30 POKE 53768,96 40 POKE 53761,173 50 POKE 53765,173 60 POKE 53760,BASEFREQ 70 FREQ=BASEFREQ-1 80 ? ABS(PFRQ/BASEFREQ-PFRQ/FREQ)/2;"H z" 90 POKE 53764,FREQ 100 GET KEY 110 FREQ=FREQ-1:IF FREQ>0 THEN 80 120 END The "BASEFREQ" is the first of the two clock dividers. In general a smaller value will reduce the noise but limits the frequency selection, while a bigger one has the opposite effect. Here an example of the "476.7331 Hz" wave: Pokey output: sample.wav.zip Have fun experimenting! Edited October 5, 2018 by Irgendwer 10 Quote Link to comment Share on other sites More sharing options...
Rybags Posted October 5, 2018 Share Posted October 5, 2018 Pretty sure that's what's known around here as the triangle wave. Also possible is the sawtooth which also uses 1.79 MHz mode and the high-pass filter. I also discovered like you (I might have done a spreadsheet) that the resultant frequency of the waveform produced is the difference between the 2 high pitched voices. There's only a fairly narrow band of useful frequencies and most of the usable notes are 1 AUDF value apart but I think there are some 2 apart that are useful as well. The values outside the useful range tend to include useless carrier noise. As I put it, it's a sort of variable repeating PWM that's generating the waveforms.They'd be somewhat more useful and include less unwanted noise if there was some low-pass filtering available external to Pokey. 1 Quote Link to comment Share on other sites More sharing options...
R0ger Posted October 5, 2018 Share Posted October 5, 2018 Yep, sadly there is only few usable frequencies. Quote Link to comment Share on other sites More sharing options...
AtariNerd Posted October 5, 2018 Share Posted October 5, 2018 Pseus-pseus-pseudio! (Forgive me, but I had to do it.) 5 Quote Link to comment Share on other sites More sharing options...
makary Posted October 6, 2018 Share Posted October 6, 2018 Interesting. I believe Miker did some experiments using Music ProTracker and similar technique. The tracker has a really nice feature, a direct access to the frequency tables. So you can define there appropriate 'couples of frequencies' to get triangle/quasi-sine or saw-like instruments and use them within a tune. 3 Quote Link to comment Share on other sites More sharing options...
+DrVenkman Posted October 6, 2018 Share Posted October 6, 2018 Pretty sure that's what's known around here as the triangle wave. I don't think he's referring to the component parts (which do indeed seem to be triangle waves), but rather the (for lack of a better term) pseudo-sine wave produced by the beat effect: 3 Quote Link to comment Share on other sites More sharing options...
Rybags Posted October 6, 2018 Share Posted October 6, 2018 Yeah, the resultant is closer to a sine than a triangle. But both wave types sound almost identical. If anything the triangle probably preferable since it's a bit less muted. 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.