04.03.2013 Views

spectrum graphics - OpenLibra

spectrum graphics - OpenLibra

spectrum graphics - OpenLibra

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

+5V<br />

Figure 1 Diagram of 'he 8912 PSG C. i r r u i '<br />

RFiCtSTEK FUNCTION BIT<br />

HO<br />

RI<br />

K2<br />

R3<br />

Channel A - Tone Period<br />

Channel B - Tone Period<br />

7 6 s J 2 1 0<br />

8 Bit Fine Tone A<br />

8 Bit Fine Tone B<br />

K4 8 Bit Fine Tone C<br />

4 Bit Course Tone A<br />

4 Sit Course Tone B<br />

R5 4 Bit Course Tone C<br />

R6 Noise Period J Bit Control<br />

R7 Channel Enable<br />

I/O Noise Tone<br />

C B A C B A<br />

R8 Channel A - Amplitude Env 4 Bit Control<br />

R9 Ch.-innel 8 - Ataplitudi; Env 4 Bit Control<br />

RIO Channel C - Amplitude Env 4 Bit Control<br />

RI t<br />

R12<br />

Envelope Period<br />

8 Bit Fine Control<br />

8 Bit Course Control<br />

RI) Envelope Shape 4 Bit Control<br />

R14 I/O Port 8 Bit Parallel Port<br />

PSC REGISTERS<br />

SOUNDS<br />

PSG CIRCUIT<br />

specified VOLUME. The command<br />

is fairly complex and, to<br />

make full use of its capabilities,<br />

experimentation is required.<br />

There are four variables or integers<br />

involved in the command<br />

with a comma separator between<br />

each. The CHANNEL<br />

selection is pretty straightfor<br />

ward, selecting the channel that<br />

is required. OCTAVE 0 starts at<br />

two below middle C and in<br />

creases from there. (Middle C is<br />

taken as 246.9 Hz). NOTE<br />

selects the required semi-tone<br />

within the chromatic scale and is<br />

the same as the Spectrum's<br />

BEEP command. VOLUME<br />

ranges from 0 to 15. the<br />

amplitude of the output ranges<br />

from 1 (very soft) to 1 5 {very<br />

loud). When the volume is set to<br />

0, control of the output is passed<br />

to the envelope generator the<br />

parameters of which must be<br />

set in an accompanying " PLAY.<br />

"MUSIC must be used with<br />

" PLAY, which selects the channels<br />

being used and the shape of<br />

the sound envelope.<br />

5 * PLAY 1.0.0,0<br />

10 FORo = 0TO 6<br />

20 FOR n: 1 TO 12<br />

30 * MUSIC 1 ,o,n,5<br />

40 PAUSE 20<br />

50 NEXT n<br />

60 NEXT o<br />

70 * PLAY 0,0,0,0:REM turn<br />

channels off<br />

*SOUND<br />

Format; channel, pitch,<br />

volume.<br />

channel 1 -6<br />

pitch 0-65335<br />

volume 0-15<br />

* SOUND lacks the finesse of<br />

* MUSIC, since its output is<br />

not arranged in semitones and it<br />

merely blasts out whatever<br />

values are input. It can be used<br />

to generate complex sounds as<br />

well as pure tones. However, it<br />

does include a noise generator<br />

unlike * MUSIC which allows<br />

the creation of sounds which are<br />

more useful as a background to<br />

games. CHANNEL values 1-3<br />

select a tone channel and values<br />

4-6 select which of the three<br />

channels the single noise<br />

generator will output through,<br />

PITCH is no more than a division<br />

68 ZX COMPUTING DECEMBER JANUARY 1985

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!