VIC 20 SOUND FOUR SPEAKERS AND 5 OCTAVES The VIC has 3 tone registers (for music), and one white noise generator (for sound effects). The tone generators cover 3 octaves each but are staggered slightly so you can actually reach a total of 5 separate octaves. The VIC's speakers and volume control are stored in specific memory locations which can be accessed and controlled by reading and writing to these locations. Whenever you write to these locations, you activate that tone generator, or the volume control. When programming sound - especially music - it is often helpful to think of these various sound controls as "speakers", and the volume setting as a standard "volume" control. Here, briefly, is a list of memory locations relating to sound: $900E 36878 VOLUME SETTING $900A 36874 SPEAKER 1 - LOWEST - BASS $900B 36875 SPEAKER 2 - MIDDLE - ALTO $900C 36876 SPEAKER 3 - HIGHEST -SOPRANO $900D 36877 SPEAKER 4 - NOISE There are 15 volume settings. These volume settings are controlled by the bottom four bits of memory location 36878. The top four bits set the auxiliary colour for multicolour graphics and thus have nothing to do with sound. A value of zero in the bottom four bits turns off the volume. A value of fifteen in the bottom four bits gives the loudest volume. The tone registers and noise register all behave in the same way when it comes to programming them. The top bit turns the speaker on or off and the bottom 7 bits adjust the frequency produced. A one in the top bit turns the speaker on and a zero turns it off. The frequency produced by the value in the lower 7 bits is determined using the following formulas: VIC Chip Frequency Formulae Frequency Output (F) = Clock/(255 - N) NTSC PAL Number in Table (N) = 255 - (Clock/F) (N.America) (European) VIC 20 Voice 1 (36874): Clock = 3995 4329 VIC 20 Voice 2 (36875): Clock = 7990 8659 VIC 20 Voice 3 (36876): Clock = 15980 17320 VIC 20 Voice 4 (36877): Clock = 31960 34640 NOTE: When N is equal to 255, the frequency made is not higher than the frequency produced by the N being equal to 254, but is infact lower than the frequency produced by the value 128. To find the exact frequency produced, make N = 127 rather than 255. NOISE REGISTER/WHITE NOISE GENERATOR The noise register is different from the tone registers. It is generally used for special sound effects like explosions. The noise register produces a blank noise sound like that on your television set when you fall asleep late at night. It has the same 3 octave range as the tone generators described above and its frequency changes with each value as given by the table and formulae above.