next up previous contents index
Next: Operations on control streams Up: Audio and control computations Previous: Event detection   Contents   Index


Control computation using audio signals directly

From the tradition of analog synthesis comes an elegant, old-fashioned approach to control problems which can be used as an alternative to the control streams we have been concerned with so far in this chapter. Instead, or in addition to using control streams, we can use audio signals themselves to control the production of other audio signals. Two specific techniques from analog synthesis lend themselves well to this treatment: analog sequencing and sample-and-hold.

The analog sequencer was often used to set off a regularly or semi-regularly repeating sequence of sounds. The sequencer itself typically put out a repeating sequence of voltages, along with a trigger signal which pulsed at each transition between voltages. One used the voltages for pitches or timbral parameters, and the trigger to control one or more envelope generators. Getting looped sequences of predetermined values in digital audio practice is as simple as sending a $\mathrm{phasor}\sim$ into a non-interpolating table lookup. If you want, say, four values in the sequence, scale the $\mathrm{phasor}\sim$ output to take values from 0 to $3.999\cdots$ so that the first fourth of the cycle reads point 0 of the table and so on.

Figure 3.8: Multiplying and wrapping a sawtooth wave to generate a higher frequency.
\begin{figure}\psfig{file=figs/fig03.08.ps}\end{figure}

To get repeated triggering, the first step is to synthesize another sawtooth that runs in synchrony with the $\mathrm{phasor}\sim$ output but four times as fast. This is done using a variant of the technique of Figure 2.8, in which we used an adder and a wraparound operator to get a desired phase shift. Figure 3.8 shows the effect of multiplying a sawtooth wave by an integer, then wrapping around to get a sawtooth at a multiple of the original frequency.

From there is is easy to get to a repeated envelope shape by wavetable lookup fro example (using an interpolating table lookup this time, unlike for the sequence voltages above). All the waveform generation and altering techniques used for making pitched sounds can also be brought to use here.

The other standard control technique from analog synthesizer control is the sample and hold unit. This takes an incoming signal, picks out certain instantaneous values from it, and ``freezes" those values for its output. The particular values to pick out are selected by a secondary, ``trigger" input. At points in time specified by the trigger input a new, single value is taken from the primary input and is output continuously until the next time point, when it is replaced by a new value of the primary input.

Figure 3.9: Sample and hold, using falling edges of the trigger signal.
\begin{figure}\psfig{file=figs/fig03.09.ps}\end{figure}

In digital audio it is often useful to sample a new value on falling edges of the trigger signal; for instance, we can sample whenever the current value of the trigger signal is smaller than its previous value. This is shown in Figure 3.9. Notice that this is especially well adapted for use with a sawtooth trigger, so that we can discretely sample signals in synchrony with any oscillator-driver process.


next up previous contents index
Next: Operations on control streams Up: Audio and control computations Previous: Event detection   Contents   Index
msp 2003-12-08