EXAMPLE PROGRAM 7:
10 S=54272 20 FORL=0TO24:POKES+L,0:NEXT 30 POKES+14,5 40 POKES+18,16 50 POKES+3,1 60 POKES+24,143 70 POKES+6,240 80 POKES+4,65 90 FR=5389 100 FORT=1TO200 110 FQ=FR+PEEK(S+27)*3.5 120 HF=INT(FQ/256):LF=FQ-HF*256 130 POKES+0,LF:POKES+1,HF 140 NEXT 150 POKES+24,0
LINE-BY-LINE EXPLANATION OF EXAMPLE PROGRAM 7:
| Line(s) | Description |
|---|---|
| 10 | Set S to start of sound chip. |
| 20 | Clear sound chip registers. |
| 30 | Set low frequency of voice 3. |
| 40 | Set triangular waveform voice 3. |
| 50 | Set high pulse width for voice 1. |
| 60 | Set volume 15, turn off audio output of voice 3. |
| 70 | Set Sustain/Release for voice I (S=15, R=0). |
| 80 | POKE start pulse waveform control voice 1. |
| 90 | Set lowest frequency for siren. |
| 100 | Begin timing loop. |
| 110 | Get new frequency using output of oscillator 3. |
| 120 | Get high and low frequencies. |
| 130 | POKE high.and low frequencies for voice 1. |
| 140 | End timing loop. |
| 150 | Turn off volume. |
| This page has been created by Sami Rautiainen. | |
| Read the small print. | Last updated February 10, 2002. |