Atari 2600 VCS Sound Frequency and Waveform Guide

From 8BitDev.org - Atari 7800 Development Wiki
Jump to: navigation, search

Document

Subject: [stella] Frequency and Waveform Guide
From: Eckhard_Stolberg@xxxxxxxxxxxxxxxxxxxxx (Eckhard Stolberg)
Date: Sun, 22 Jun 1997 16:16:32 +0200

ATARI 2600 VCS SOUND FREQUENCY AND WAVEFORM GUIDE
by Eckhard Stolberg
last modified on 22.6.97 (first version)
==============================================================================
These tables have been calculated with the information found in Ron Fries'
TIASOUND emulation package. I have done some sampling on my own to verify
it and got basically what Ron's theory suggested. Also I have compared my
results with Glenn Saunders's note tables and found them to be almost the
same.

However, I might have missed something important or simply miscalculated
some of the values. Therefore it would be nice, if someone could do some
sampling or recalculating to verify or correct these tables.

The cent values have been calculated with rounded frequencies. Therefore
they are not as acurate as they might look, especially the ones for the
lower frequencies.
==============================================================================
The Atari 2600 VCS produces it's sound with some shift registers of various
lengths. The speed at which it shifts the registers can be set to either the
pixelclock/114 or to the CPUclock/114, which means two shifts per scanline
or a third of this. Since a NTSC VCS produces 262 scanlines per frame and 60
frames per second this results in output rates of 31440 Hz and 10480 Hz.
PAL TVs produce only 312 scanlines and 50 frames, so the output rates are
only 31200 Hz and 10400 Hz.

A pitch value of n stored in the AUDFx registers modifies the frequency in a
way, that n possibilities to shift are left out.

The distortion values stored in the AUDCx registers select the clock to use.
They also select two shift registers of various lengths. One of these is the
source pattern. Every time a 1 is shifted out of the source pattern, the
output is set high. If a 0 is shifted out, the output is set low.

The other shift register is a clock modifier. Every time a 1 is shifted out,
the effect of the source pattern can take place. If a 0 is shiftet out, the
bit, that is shifted out of the source pattern, has no effect on the output.

Since the source pattern and the clock modifier registers match up perfectly
except for distortion 2 & 3, my tables only list the resulting output
bitstream.

More information on the patterns can be found in the documentation for Ron
Fries' TIASOUND emulation package.

However, since the output switches so fast between high and low, the resulting
waveforms are not perfect squarewaves. For example distortion 4 with a pitch
value of 0 would flip the output at a rate of 15720 Hz. This is so fast,
that the membrane of the speaker couldn't swing very far before it has to
change it's direction. Therefore no audible sound is produced.
==============================================================================
How to read the tables:

DISTORTION is the value to be stored in the AUDCx registers.
WAVEFORM: A 1 means the output is set high, a 0 means the output is set low.
          For distortion 2 & 3 it is source pattern -> clock modifier pattern.
CLOCKSPEED is the speed at which the registers are shifted.
PITCH is the value to be stored in the AUDFx registers.
NTSC & PAL are the calculated frequencies for the specified TV norm.
NOTE is the note value, that is closest to the calculated frequency.
FREQ is the frequency that this note would have if A4=440 Hz.
CENT specifies how many percent the calculated frequency is off it's 
     corresponding note frequency

Lines marked as below have such a low frequency, that it really doesn't
matter if it is C or C# rumble.
==============================================================================
Distortion: 0 & 11
Waveform  : always high
            (used to output 4-bit samples by changing the volume very fast)
Clockspeed: pixelclock/114


Distortion: 1
Waveform  : 001010000111011
Clockspeed: pixelclock/114

Pitch   NTSC    Note    Freq    Cent    PAL     Note    Freq    Cent
-----   ----    ----    ----    ----    ---     ----    ----    ----
 0      2096     c7     2093     +2     2080     c7     2093     -1
 1      1048     c6     1046.5   +2     1040     c6     1046.5   -1
 2       698.7   f5      698.5    0      693.3   f5      698.5   -1
 3       524     c5      523.3   +2      520     c5      523.3   -1
 4       419.2   g#4     415.3   +16     416     g#4     415.3   +3
 5       349.3   f4      349.2    0      346.7   f4      349.2   -13
 6       299.4   d4      293.7   +33     297.1   d4      293.7   +20
 7       262     c4      261.6   +3      260     c4      261.6   -11
 8       232.9   a#3     233.1   -2      231.1   a#3     233.1   -15
 9       209.6   g#3     207.7   +15     208     g#3     207.7   +2
10       190.5   f#3     185     +50     189.1   f#3     185     +37
11       174.7   f3      174.6   +1      173.3   f3      174.6   -13
12       161.2   e3      164.8   -39     160     d#3     155.6   +48
13       149.7   d3      146.8   +33     148.6   d3      146.8   +20
14       139.7   c#3     138.6   +13     138.7   c#3     138.6   +1
15       131     c3      130.8   +3      130     c3      130.8   -11
16       123.3   h2      123.5   -3      122.4   h2      123.5   -16
17       116.4   a#2     116.4    0      115.6   a#2     116.5   -14
18       110.3   a2      110     +5      109.5   a2      110     -8
19       104.8   g#2     103.8   +16     104     g#2     103.8   +3
20        99.8   g2       98     +31      99     g2       98     +17
21        95.3   g2       98     -49      94.5   f#2      92.5   +36
22        91.1   f#2      92.5   -27      90.4   f#2      92.5   -40
23        87.3   f2       87.3    0       86.7   f2       87.3   -12
24        83.8   e2       82.4   +29      83.2   e2       82.4   +16
25        80.6   e2       82.4   -39      80     d#2      77.8   +48
26        77.6   d#2      77.8   -5       77     d#2      77.8   -18
27        74.9   d2       73.4   +34      74.3   d2       73.4   +20
28        72.3   d2       73.4   -27      71.7   d2       73.4   -41
29        69.9   c#2      69.3   +15      69.3   c#2      69.3    0
30        67.6   c#2      69.3   -44      67.1   c2       65.4   +44
31        65.5   c2       65.4   +3       65     c2       65.4   -11

Distortion: 2 & 3
Waveform  : 001010000111011->0100000000000000000100000000000 (465 bits long)
            001010000111011->0010110011111000110111010100001 (465 bits long)
Clockspeed: pixelclock/114

Pitch   NTSC    Note    Freq    Cent    PAL     Note    Freq    Cent
-----   ----    ----    ----    ----    ---     ----    ----    ----
 0      67.6     c#2    69.3     -44    67.1     c2     65.4     +44
 1      33.8     c#1    34.6     -42    33.5     c1     32.7     +42
 2      22.5     f#0    23.1     -46    22.4     f0     21.8     +46
 3      16.9     c#0    17.3     -44    16.8     c0     16.4     +44
 4      13.5     below                  13.4     below
 5      11.3                            11.2
 6       9.7                             9.6
 7       8.5                             8.4
 8       7.5                             7.5
 9       6.8                             6.7
10       6.1                             6.1
11       5.6                             5.6
12       5.2                             5.2
13       4.8                             4.8
14       4.5                             4.5
15       4.2                             4.2
16       4                               4
17       3.8                             3.7
18       3.6                             3.5
19       3.4                             3.4
20       3.2                             3.2
21       3.1                             3
22       3                               2.9
23       2.8                             2.8
24       2.7                             2.7
25       2.6                             2.6
26       2.5                             2.5
27       2.4                             2.4
28       2.3                             2.3
29       2.3                             2.2
30       2.2                             2.2
31       2.1                             2.1

Distortion: 4 & 5
Waveform  : 01
Clockspeed: pixelclock/114

Pitch   NTSC    Note    Freq    Cent    PAL     Note    Freq    Cent
-----   ----    ----    ----    ----    ---     ----    ----    ----
 0     15720    silent                 15600    silent
 1      7860     h8     7902.1   -9     7800     h8     7902.1   -23
 2      5240     e8     5274     -11    5200     e8     5274     -25
 3      3930     h7     3951.1   -10    3900     h7     3951.1   -23
 4      3144     g7     3136     +4     3120     g7     3136     -9
 5      2620     e7     2637     -11    2600     e7     2637     -25
 6      2245.7   c#7    2217.5   +21    2228.6   c#7    2217.5   +8
 7      1965     h6     1975.5   -9     1950     h6     1975.5   -23
 8      1746.7   a6     1760     -13    1733.3   a6     1760     -27
 9      1572     g6     1568     +4     1560     g6     1568     -9
10      1429.1   f6     1396.9   +39    1418.2   f6     1396.9   +25
11      1310     e6     1318.5   -11    1300     e6     1318.5   -25
12      1209.2   d6     1174.7   +49    1200     d6     1174.7   +36
13      1122.9   c#6    1108.7   +22    1114.3   c#6    1108.7   +8
14      1048     c6     1046.5   +2     1040     c6     1046.5   -11
15       982.5   h5      987.8   -10     975     h5      987.8   -23
16       924.7   a#5     932.3   -15     917.6   a#5     932.3   -28
17       873.3   a5      880     -14     866.7   a5      880     -27
18       827.4   g#5     830.6   -7      821.1   g#5     830.6   -20
19       786     g5      784     +4      780     g5      784     -9
20       748.6   f#5     740     +20     742.9   f#5     740     +7
21       714.5   f5      698.5   +39    709.1    f5      698.5   +26
22       683.5   f5      698.5   -38     678.3   e5      659.5   +48
23       655     e5      659.3   -12     650     e5      659.3   -25
24       628.8   d#5     622.3   +18     624     d#5     622.3   +5
25       604.6   d5      587.3   +49     600     d5      587.3   +36
26       582.2   d5      587.3   -16     577.8   d5      587.3   -29
27       561.4   c#5     554.4   +21     557.1   c#5     554.4   +8
28       542.1   c#5     554.4   -40     537.9   c5      523.3   +47
29       524     c5      523.3   +2      520     c5      523.3   -11
30       507.1   h4      493.9   +45     503.2   h4      493.9   +32
31       491.3   h4      493.9   -9      487.5   h4      493.9   -23

Distortion: 7 & 9                            6 & 10
Waveform  : 0010110011111000110111010100001  1111111111111000000000000000000
Clockspeed: pixelclock/114

Pitch   NTSC    Note    Freq    Cent    PAL     Note    Freq    Cent
-----   ----    ----    ----    ----    ---     ----    ----    ----
 0      1014.2   h5     987.8    +45    1006.5   h5     987.8    +32
 1       507.1   h4     493.9    +45     503.2   h4     493.9    +32
 2       338.1   e4     329.6    +43     335.5   e4     329.6    +30
 3       253.5   h3     246.9    +45     251.6   h3     246.9    +32
 4       202.8   g#3    207.7    -42     201.3   g3     196      +45
 5       169     e3     164.8    +43     167.7   e3     164.8    +30
 6       144.9   d3     146.8    -23     143.8   d3     146.8    -37
 7       126.8   h2     123.5    +42     125.8   h2     123.5    +32
 8       112.7   a2     110      +42     111.8   a2     110      +28
 9       101.4   g#2    103.8    -41     100.6   g2      98      +45
10        92.2   f#2     92.5    -6       91.5   f#2     92.5    -19
11        84.5   e2      82.4    +43      83.9   e2      82.4    +31
12        78     d#2     77.8    +4       77.4   d#2     77.8    -9
13        72.4   d2      73.4    -24      71.9   d2      73.4    -37
14        67.6   c#2     69.3    -44      67.1   c2      65.4    +44
15        63.4   h1      61.7    +46      62.9   h1      61.7    +32
16        59.7   a#1     58.3    +41      59.2   a#1     58.3    +26
17        56.3   a1      55      +39      55.9   a1      55      +27
18        53.4   g#1     51.9    +48      53     g#1     51.9    +35
19        50.7   g#1     51.9    -41      50.3   g1      49      +45
20        48.3   g1      49      -25      47.9   g1      49      -39
21        46.1   f#1     46.2    -4       45.7   f#1     46.2    -20
22        44.1   f1      43.7    +16      43.8   f1      43.7    +4
23        42.3   e1      41.2    +44      41.9   e1      41.2    +28
24        40.6   e1      41.2    -26      40.3   e1      41.2    -39
25        39     d#1     38.9    +4       38.7   d#1     38.9    -9
26        37.6   d1      36.7    +41      37.3   d1      36.7    +27
27        36.2   d1      36.7    -24      35.9   d1      36.7    -38
28        35     c#1     34.6    +19      34.7   c#1     34.6    +5
29        33.8   c#1     34.6    -42      33.5   c1      32.7    +42
30        32.7   c1      32.7    0        32.5   c1      32.7    -11
31        31.7   h0      30.9    +44      31.5   h0      30.9    +33

Distortion: 8
Waveform  : 511 bits long (white noise)
Clockspeed: pixelclock/114

Pitch   NTSC    Note    Freq    Cent    PAL     Note    Freq    Cent
-----   ----    ----    ----    ----    ---     ----    ----    ----
 0      61.5     h1     61.7     -6     61.1     h1     61.7     -18
 1      30.8     h0     30.9     -6     30.5     h0     30.9     -22
 2      20.5     e0     20.6     -8     20.4     e0     20.6     -17
 3      15.4     below                  15.3     below
 4      12.3                            12.2
 5      10.3                            10.2
 6       8.8                             8.7
 7       7.7                             7.6
 8       6.8                             6.8
 9       6.2                             6.1
10       5.6                             5.6
11       5.1                             5.1
12       4.7                             4.7
13       4.4                             4.4
14       4.1                             4.1
15       3.8                             3.8
16       3.6                             3.6
17       3.4                             3.4
18       3.2                             3.2
19       3.1                             3.1
20       2.9                             2.9
21       2.8                             2.8
22       2.7                             2.7
23       2.6                             2.5
24       2.5                             2.4
25       2.4                             2.3
26       2.3                             2.3
27       2.2                             2.2
28       2.1                             2.1
29       2                               2
30       2                               2
31       1.9                             1.9

Distortion: 12 & 13
Waveform  : 10
Clockspeed: CPUclock/114

Pitch   NTSC    Note    Freq    Cent    PAL     Note    Freq    Cent
-----   ----    ----    ----    ----    ---     ----    ----    ----
 0      5240     e8     5274     -11    5200     e8     5274     -25
 1      2620     e7     2637     -11    2600     e7     2637     -25
 2      1746.6   a6     1760     -14    1733.3   a6     1760     -27
 3      1310     e6     1318.5   -11    1300     e6     1318.5   -25
 4      1048     c6     1046.5   +2     1040     c6     1046.5   -11
 5       873.3   a5      880     -14    866.7    a5      880     -27
 6       748.6   f#5     740     +20    742.9    f#5     740     +7
 7       655     e5      659.3   -12    650      e5      659.3   -25
 8       582.2   d5      587.3   -16    577.8    d5      587.3   -29
 9       524     c5      523.3   +2     520      c5      523.3   -11
10       476.4   a#4     466.2   +39    472.7    a#4     466.2   +23
11       436.7   a4      440     -13    433.3    a4      440     -27
12       403.1   g4      392     +48    400      g4      392     +34
13       374.3   f#4     370     +20    371.4    f#4     370     +6
14       349.3   f4      349.2   0      346.7    f4      349.2   -13
15       327.5   e4      329.6   -11    325      e4      329.6   -25
16       308.2   d#4     311.1   -17    305.9    d#4     311.1   -30
17       291.1   d4      293.7   -16    288.9    d4      293.7   -29
18       275.8   c#4     277.2   -9     273.7    c#4     277.2   -22
19       262     c4      261.6   +3     260      c4      261.6   -11
20       249.5   h3      246.9   +18    247.6    h3      246.9   +5
21       238.2   a#3     233.1   +37    236.4    a#3     233.1   +24
22       227.8   a#3     233.1   -40    226.1    a3      220     +47
23       218.3   a3      220     -14    216.7    a3      220     -27
24       209.6   g#3     207.7   +15    208      g#3     207.7   +2
25       201.5   g3      196     +47    200      g3      196     +34
26       194.1   g3      196     -17    192.6    g3      196     -31
27       187.1   f#3     185     +19    185.7    f#3     185     +6
28       180.7   f#3     185     -41    179.3    f3      174.6   +45
29       174.7   f3      174.6   +1     173.3    f3      174.6   -13
30       169     e3      164.8   +43    167.7    e3      164.8   +30
31       163.8   e3      164.8   -11    162.5    e3      164.8   -25

Distortion: 14                               15
Waveform  : 1111111111111000000000000000000  0010110011111000110111010100001
Clockspeed: CPUclock/114

Pitch   NTSC    Note    Freq    Cent    PAL     Note    Freq    Cent
-----   ----    ----    ----    ----    ---     ----    ----    ----
 0      338.1    e4     329.6    +43    335.5    e4     329.6    +30
 1      169      e3     164.8    +43    167.7    e3     164.8    +30
 2      112.7    a2     110      +42    111.8    a2     110      +28
 3       84.5    e2      82.4    +43     83.9    e2      82.4    +31
 4       67.6    c#2     69.3    -44     67.1    c2      65.4    +44
 5       56.3    a1      55      +39     55.9    a1      55      +27
 6       48.3    g1      49      -25     47.9    g1      49      -39
 7       42.3    e1      41.2    +44     41.9    e1      41.2    +28
 8       37.6    d1      36.7    +41     37.3    d1      36.7    +27
 9       33.8    c#1     34.6    -42     33.5    c1      32.7    +42
10       30.7    h0      30.9    -11     30.5    h0      30.9    -22
11       28.2    a0      27.5    +44     28      a0      27.5    +31
12       26      g#0     26      0       25.8    g#0     26      -13
13       24.1    g0      24.5    -29     24      g0      24.5    -36
14       22.5    f#0     23.1    -46     22.4    f0      21.8    +46
15       21.1    e0      20.6    +42     21      e0      20.6    +33
16       19.9    d#0     19.4    +42     19.7    d#0     19.4    +25
17       18.8    d0      18.4    +40     18.6    d0      18.4    +20
18       17.8    c#0     17.3    +45     17.7    c#0     17.3    +36
19       16.9    c#0     17.3    -44     16.8    c0      16.4    +44
20       16.1    c0      16.4    -30     16      c0      16.4    -40
21       15.4    below                   15.2    below
22       14.7                            14.6
23       14.1                            14
24       13.5                            13.4
25       13                              12.9
26       12.5                            12.4
27       12.1                            12
28       11.7                            11.6
29       11.3                            11.2
30       10.9                            10.8
31       10.6                            10.5

Editing

The document is a republished information originally appearing on the Stella mailing list. As such, the author hasn't explicitly granted permission to edit. Any errors or important supplemental information will appear in the Errata and Notes section.

Errata and Notes

None