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 VIS is using 2 CDP 1802 output instructions, OUT 7 to select the register and OUT 4 for actual data output. Note that for VIS register 4 and 5 the CDP1802 address lines are used and NOT the data bus. As such 16 bits are available in one output instruction.
VIS register 4 is used to control the tone generation:
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 |
3,579 |
|
0 |
0 |
0 |
6,9902344 |
512 |
0 |
0 |
1 |
13,980469 |
256 |
0 |
1 |
0 |
27,960938 |
128 |
0 |
1 |
1 |
55,921875 |
64 |
1 |
0 |
0 |
111,843750 |
32 |
1 |
0 |
1 |
223,68750 |
16 |
1 |
1 |
0 |
447,37500 |
8 |
1 |
1 |
1 |
894,75000 |
4 |
Table 1: Tone frequency range selection
VIS register 5 is used to control the noise generation, 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 |
3,579 |
|
0 |
0 |
0 |
0,8737793 |
4096 |
0 |
0 |
1 |
1,747559 |
2048 |
0 |
1 |
0 |
3,495117 |
1024 |
0 |
1 |
1 |
6,990234 |
512 |
1 |
0 |
0 |
13,980469 |
256 |
1 |
0 |
1 |
27,96094 |
128 |
1 |
1 |
0 |
55,92188 |
64 |
1 |
1 |
1 |
111,84375 |
32 |
Table 2: Noise frequency range selection