[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]

LINE-BY-LINE EXPLANATION OF EXAMPLE PROGRAM 6:

Lines(s)Description
10 Set S to beginning of sound chip.
20 Clear all sound chip locations.
30 Set high pulse width for voice 1.
40 Set Attack/Decay for voice 1 (A=2, D=9).
Set Sustain/Release for voice 1 (S=5, R=9).
50 Set low frequency for voice 3.
60 Set triangle waveform for voice 3.
70 Set volume 15, turn off audio output of voice 3.
80 Read frequency and duration of note.
90 If frequency equals zero, stop.
100 POKE start pulse waveform control voice 1.
110 Start timing loop for duration.
120 Get new frequency using oscillator 3 output.
130 Get high and low frequency.
140 POKE high and low frequency for voice 1.
150 End of timing loop.
160 POKE stop pulse waveform control voice 1.
170 Go back for next note.
500-550 Frequencies and durations for song,
560 Zeros signal end of song.

A wide variety of sound effects can also be achieved using dynamic effects. For example, the following siren program dynamically changes the frequency output of oscillator 1 when it's based on the output of oscillator 3's triangular wave:


[Prev] [Next] [Contents] [Commodore] [New] [Search] [Home]
This page has been created by Sami Rautiainen.
Read the small print. Last updated February 10, 2002.