Sound
The CDP1869 address and sound generator (which is part of the Video Interface System is used for audio. 2 channels are available, one for tone generation with a span of 8 octaves, and 1 for white noise with a span of 8 frequencies. Volume of both channels is programmable independently in 16 steps.
The OUT 4 instruction is used to control the tone generation, note that in this case the CDP1802 address lines are used and NOT the data bus. As such 16 bits are available in one output instruction:
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
0 |
Tone |
Off |
Range |
Tone volume |
Within each tone frequency range the 'input frequency' (see table 1) is divided by the 'Tone+1' value, producing up to 128 different frequencies. This frequency is then divided by two providing a square-wave signal that is turned on or off by bit 7. A high on bit 7 turns the tone output off.
Tone frequency range |
Input frequency (KHz) |
CPU clock divider |
||
Bit 6 |
Bit 5 |
Bit 4 |
2,813 |
|
0 |
0 |
0 |
5,4941406 |
512 |
0 |
0 |
1 |
10,988281 |
256 |
0 |
1 |
0 |
21,976563 |
128 |
0 |
1 |
1 |
43,953125 |
64 |
1 |
0 |
0 |
87,906250 |
32 |
1 |
0 |
1 |
175,81250 |
16 |
1 |
1 |
0 |
351,62500 |
8 |
1 |
1 |
1 |
703,25000 |
4 |
Table 1: Tone frequency range selection
The OUT 5 instruction is used to control the noise generation, as for the OUT 4 address lines are used but only bit 8 to 15 are used for noise generation the lower bits are used for video formatting functionality:
15 |
14 |
13 |
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
2 |
1 |
0 |
Off |
Range |
Noise volume |
Video bits... |
For noise frequency range eight ranges are available (see table 2). The white noise output is turned on or off by bit 15. A high on bit 15 turns the white noise off.
Noise frequency range |
Top of range frequency (Khz) |
CPU Clock divider |
||
Bit 14 |
Bit 13 |
Bit 12 |
2,813 |
|
0 |
0 |
0 |
0,6867676 |
4096 |
0 |
0 |
1 |
1,373535 |
2048 |
0 |
1 |
0 |
2,747070 |
1024 |
0 |
1 |
1 |
5,494141 |
512 |
1 |
0 |
0 |
10,988281 |
256 |
1 |
0 |
1 |
21,97656 |
128 |
1 |
1 |
0 |
43,95313 |
64 |
1 |
1 |
1 |
87,90625 |
32 |
Table 2: Noise frequency range selection