The noise waveform can be used to provide a wide range of sound effects. This example mimics a hand clap using a filtered noise waveform:
EXAMPLE PROGRAM 8:
10 S=54272 20 FORL=0TO24:POKES+L,0:NEXT 30 POKES+0,240:POKES+1,33 40 POKES+5,8 50 POKES+22,104 60 POKES+23,1 70 POKES+24,79 80 FORN=1TO15 90 POKES+4,129 100 FORT=1TO250:NEXT:POKES+4,128 110 FORT=1TO30:NEXT:NEXT 120 POKES+24,0
LINE-BY-LINE EXPLANATION OF EXAMPLE PROGRAM 8:
Line(s) | Description |
---|---|
10 | Set S to start of sound chip. |
20 | Clear all sound chip registers. |
30 | Set high and low frequencies for voice 1. |
40 | Set Attack/Decay for voice I (A=0, D=8). |
50 | Set high cutoff frequency for filter. |
60 | Turn on filter for voice 1. |
70 | Set volume 15, high-pass filter. |
80 | Count 15 claps. |
90 | Set start noise waveform control. |
100 | Wait, then set stop noise waveform control. |
110 | Wait, then start next clap- |
120 | Turn off volume. |
This page has been created by Sami Rautiainen. | |
Read the small print. | Last updated February 10, 2002. |