Jump to content
IGNORED

Pokey's pseuso sine wave


Irgendwer

Recommended Posts

[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:

post-7778-0-19472900-1538752352.png

 

Pokey output:

sample.wav.zip

 

Have fun experimenting!

Edited by Irgendwer
  • Like 10
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

 

  • Like 3
Link to comment
Share on other sites

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:

 

post-30400-0-80402300-1538826462.png

  • Like 3
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...