The Fl Lter Statement - Commodore 128D User Manual

Hide thumbs Also See for 128D:
Table of Contents

Advertisement

The FILTER
The FILTER statement specifies the cutoff fre-
Statement
quency, the type of filter being used and the
resonance. The resonance is the peaking effect
of the sound wave frequency as it approaches
the cutoff frequency. The resonance determines
the sharpness and clearness of a sound: the
higher the resonance, the sharper the sound.
This is the format of the FILTER statement:
FILTER cf, Ip, bp, hp, res
Here's what the parameters mean:
cf -Cutoff frequency (0-2047)
Ip
-Low-pass filter 0 = off, 1 = on
bp -Band-pass filter 0 = off, 1 = on
hp -High-pass filter 0 = off, 1 = on
res -Resonance (0-15)
You can specify the cutoff frequency to be any
value between 0 and 2047. Turn on the low-pass
filter by specifying a 1 as the second parameter
in the FILTER statement. Turn on the band-pass
filter by specifying a 1 as the third parameter
and enable the high-pass filter with a 1 in the
fourth parameter position. Turn off any of the
three filters by placing a 0 in the respective posi
tion of the filter you want to disable. You can
enable or disable one, two or all three of the
filters at the same time.
Now that you have some background on the
FILTER statement, add this line to your sound
program, but do not RUN the program yet.
45 FILTER 1200,1,0, 0,10
Line 45 sets the cutoff frequency at 1200, turns
on the low-pass filter, disables the high-pass and
band-pass filters and assigns a 10 as the reso
nance level. Now go back and turn the filter on
in your PLAY statements by changing all the X0
filter control characters to X1. Reset the sound
chip by pressing the RUN/STOP and RESTORE
keys and RUN your sound program again.
Notice the differences between the way the
150
USING C128 MODE—Sound and Music in C128 Mode

Advertisement

Table of Contents
loading

Table of Contents