CAST Transforms: Rectangular EQ Regions

revised 2/3/98

Introduction

This transform allows the use to specify a frequency response function that will affect the amplitude of each partial according to its frequency. This frequency response function consists of any number of nonoverlapping rectangular regions, each of which is defined by a minimum and maximum frequency and a gain. (Actually, there is a limit of 50 regions per voice. This is easy to increase by recompiling the synth.)

Partials whose frequencies are not in any of a voice's defined regions are unaffected. Partials whose frequencies are in one of the regions have their amplitudes scaled by the gain for that region. It is impossible for a partial's frequency to be in more than one region because they are defined to be nonoverlapping. If a client sets the frequency range of a region to overlap another region, the old region is shrunk or removed entirely to ensure that there is no overlap.

In this implementation, each region is identified by a user-chosen integer ID number. This ID number is the first argument to messages affecting a region. Conceptually, it would be better for the region ID to be part of the address of the OpenSoundControl message rather than an argument; future versions of the synth may switch to that arrangement.

Parameters

Message Argument(s) Type(s) Description
gain Region ID, gain scaler Int, Float Sets the gain for the given region.
freq_range Region ID, lower frequency (Hz), upper frequency (Hz) Int, Float, Float Sets the frequency range for the given region. May shrink or remove other regions if they would overlap.
spew None None Prints a list of all the currently-defined regions from the sever application. Don't do this during a performance! Useful for debugging.

Examples

Boost everything between 1K and 2K by 10%:

/voices/0/regions/freq_range 1 1000. 2000.
/voices/0/regions/gain 1 1.1
/voices/0/tm/goto 0.0

Now increase the boost amount to 50%:

/voices/0/regions/gain 1 1.5
/voices/0/tm/goto 0.0

Now grow the region so it goes from 1K to 3K:

/voices/0/regions/freq_range 1 1000. 3000.
/voices/0/tm/goto 0.0

Now define a new region that cuts everything between 200 and 500 Hertz by 20%:

/voices/0/regions/freq_range 2 200. 500.
/voices/0/regions/gain 2 0.8
/voices/0/tm/goto 0.0

Now define a third region that boosts between 400 and 1100 Hertz by 5%. Note that this will shrink region 1 to the range 1100-3000 Hz, and will shrink region 2 to the range 200-400 Hz.

/voices/0/regions/freq_range 3 400. 1100. 
/voices/0/regions/gain 3 0.95
/voices/0/tm/goto 0.0

Let's see what spew will print at this point:

/voices/0/regions/spew

The synth prints this:

3 regions:
        2: 200.000000 Hz to 400.000000 Hz, gain 0.800000
        3: 400.000000 Hz to 1100.000000 Hz, gain 0.950000
        1: 1100.000000 Hz to 3000.000000 Hz, gain 1.500000

Now grow region 2 so that it goes back up to 500 Hertz. This will shrink region 3 to the range 500-1100 Hertz.

/voices/0/regions/freq_range 2 200. 500.
/voices/0/tm/goto 0.0

Now define a new region that doubles the amplitude of everything from 50 Hz to 600 Hz. This will delete region 2 (since its range, 200-500 Hz, is entirely within the range of the new region), and shrink region 3 to the range 600-1100 Hz.

/voices/0/regions/freq_range 4 50. 600.
/voices/0/regions/gain 4 2.0
/voices/0/tm/goto 0.0

We'll spew again to see how it's going:

/voices/0/regions/spew

The synth prints this:

3 regions:
        4: 50.000000 Hz to 600.000000 Hz, gain 2.000000
        3: 600.000000 Hz to 1100.000000 Hz, gain 0.950000
        1: 1100.000000 Hz to 3000.000000 Hz, gain 1.500000

Now reset everything to make this transform leave all amplitudes alone. We define a single region across the entire spectrum with gain of 1. Since all the other regions' ranges are within the range of the new region, all the old ones are removed.

/voices/0/regions/freq_range 55 0. 30000.
/voices/0/regions/gain 55 1.0
/voices/0/tm/goto 0.0

One last spew for old time's sake:

/voices/0/regions/spew

The synth prints this:

1 regions:
        55: 0.000000 Hz to 30000.000000 Hz, gain 1.000000