[thumbuki.com]

I. Bias

Bias is shifting the vertical position of a signal by adding a constant value. This simple fundamental synthesis technique can be used in a myriad of ways for generating intriguing instruments.

The Phantom Bias

This first example demonstrates adding a bias to a sine wave. The oscil opcode generates a sine wave with an amplitude value of 10000 and a frequency of 440 Hz. The signal is then summed with ibias, which has been set equal to parameter-field four (a.k.a. p4.)

aosc = aosc + ibias
Figure 1.1    This code demonstrates how to bias a signal with a constant value.
Figure 1.2    A signal is biased by 10000. The resulting signal maintains the sine wave shape, but with a shifted vertical position.

Render east101.csd and listen. First you'll hear an unbiased signal, then the biased signal. Listen for any audible differences.

instr 1
    ibias =     p4
    aosc  oscil 10000, 440, 1
    aosc  =     aosc + ibias
    out   aosc
endin
f1 0 8192 10 1

i1 0 2 0
i1 3 2 10000
Figure 1.3    Orchestra and score code for east101.csd.

Did you hear a difference between the two signals? If you did, you have better ears than I, as there should be no audible difference. For now, you simply realize that the signal has been biased.

Biased Control Signal

Let's take the same technique and apply it to a control signal. A 220 Hz sine wave is vertically shifted by adding the value of ibias, then used to modulate the amplitude of a 440 Hz sine wave. Three values are used to bias the modulator in the following example: 0, 10000 and 20000.

instr 1
    ibias = p4

    aosc1 oscil 10000, 220, 1
    aosc1 =     aosc1 + ibias
    aosc2 oscil aosc1, 440, 1

    out aosc2
endin
f1 0 8192 10 1

i1 0 2 0
i1 3 2 10000
i1 6 2 20000
Figure 1.4    Orchestra and score code for east102.csd.

Bias is great, though many signals will benefit from dynamic sources. Instead of a constant value, try an envelope to evolve the timbre in this example.

Pitch and Trills

Instead of using a sine wave to modulate amplitude, the following example uses a low-frequency square wave to create a pitch-trill effect. When the first unbiased modulator begins, the base pitch of 262 Hz gives away for two new pitches: one 131 Hz above the base pitch, and one 131 Hz below, spanning an octave and a fifth. The second modulator is biased, causing the second trill to maintain the base pitch of 262 Hz as one frequency, and a pitch one octave above for the second.

Figure 1.5    An unbiased and biased trill.
instr 1
    aosc oscil 10000, 262, 1

    out aosc
endin


instr 2
    ibias = p4
    
    kosc oscil .5, 4, 2
    kosc =     kosc + ibias
    aosc oscil 10000, 262 + (262 * kosc), 1

    out aosc
endin
f1 0 8192 10 1
f2 0 2 -2 1 -1

i1 0 2
i2 2 2 0

i1 4 2
i2 6 2 .5
Figure 1.6    Orchestra and score code for east103.csd.

Too Much Bias

A 16-bit audio file has an amplitude range of -32768 to 32768. Any numbers that fall outside of this range become clipped. If too much bias is added to a signal, the resulting signal will suffer the horrors of digital clipping.

The following example demonstrates a sine wave with the maximum amplitude possible, 32768, that has been biased with a value of -16384. The graph in figure 1.7 reveals the bottom portion of the biased signal has been flattened.

Figure 1.7    Bias has caused this sine wave to clip.
instr 1
    aosc oscil 32768, 440, 1
    aosc =     aosc + -16384

    out aosc
endin
f1 0 8192 10 1

i1 0 4
Figure 1.8    Orchestra and score code for east104.csd.