SSCSSS Version 2.0 - Tutorial - 04

Tutorial 4 - Filters

Example 4

The filters (and formants) in SSCSSS and the EX are implemented differently. The filters in the EX modify a sound generated by something else. The filters in SSCSSS describe how to generate the sound initially. The main result of this difference is that there can be any number of filters in SSCSSS with any slopes, but the SSCSSS filter parameters cannot be changed while you are playing. The parameters of the EX filters can be changed while playing.

SSCSSS starts by assuming that all harmonics will have the same maximum amplitude. The filters modify these initial amplitudes, before the samples are generated.

Note -- really only the relative values of the amplitudes are important. The peak normalization will modify the actual values, while keeping the proportions specified.

# Example  4 starts on the next line --

file ex04

voice ex04 Wv 8 28 103
set
filter lowpass 0 -6
split 4
condition > 0

# Example  4 ends on the previous line --

The second part of the filter line, "lowpass", is the filter type. There are several types described in the reference. This tutorial will only describe a few. Others are highpass, shelf type, band types, and a graph type.

The rest of the filter line has the parameters needed for the filter type. Different filter types, in general, will have different parameters. The order of the parameters determines which parameter they are.

The first parameter here, "0", is the number of octaves from the fundamental, or first harmonic, for the cutoff frequency. This cutoff is therefore relative to the pitch of the sample. Frequency parameters for filters are in general relative to pitch. (Formants are different.) This number may be a fraction, though it must be decimal fraction. For example, .0833 (or one 1 / 12) is one semitone. This number may not be negative. Since it is relative to the first harmonic, there are no lower harmonics.

The second number is the slope in dba. "dba" is decibels amplitude, not power, a difference of 6 dba is roughly twice as loud. This number can be positive or negative, that is the lowpass filter will leave frequencies below the cutoff unchaged (hence the name) but can cut or boost higher frequencies. This number may also be or contain a fraction. You can have a +13.56 dba per octave low pass filter! The filter above, then, is a gentle -6 dba per octave filter starting at the first harmonic for each sample. By itself, it also makes the sample a sawtooth wave.

Example 5

The other filters have similar parameters (see the reference), except for the graph filter which uses multiple lines.

# Example  5 starts on the next line --

file ex05

voice ex05 Wv 8 28 103
set
filter graph
gpoint 2 0
gpoint 3 6
gpoint 4 -6
gpoint 5 6
gpoint 6 0
split 4
condition > 0

# Example  5 ends on the previous line --

This filter type is like a graphic equalizer. There are as many bands as you put in. In the normal case that the frequency for a harmonic falls in between two specified points, the amplitude modification is calculated by linear interpolation (i.e. drawing a straight line between the points). If the frequency falls below the first or above the last point, the first or last point amplitude is used. The examble above has a point with amplitude zero first and last to prevent the filter from doing anything outside of the range.