The Theory And Technique Of Electronic Music

Transcription

The Theory and Technique of ElectronicMusicDRAFT: December 30, 2006Miller Puckette

cCopyright 2007by World Scientific Publishing Co. Pte. Ltd.All rights reserved.

ContentsForewordixPrefacexi1 Sinusoids, amplitude and frequency1.1 Measures of Amplitude . . . . . . . . . . . . .1.2 Units of Amplitude . . . . . . . . . . . . . . .1.3 Controlling Amplitude . . . . . . . . . . . . .1.4 Frequency . . . . . . . . . . . . . . . . . . . .1.5 Synthesizing a sinusoid . . . . . . . . . . . . .1.6 Superposing Signals . . . . . . . . . . . . . .1.7 Periodic Signals . . . . . . . . . . . . . . . . .1.8 About the Software Examples . . . . . . . . .Quick Introduction to Pd . . . . . . . . . . .How to find and run the examples . . . . . .1.9 Examples . . . . . . . . . . . . . . . . . . . .Constant amplitude scaler . . . . . . . . . . .Amplitude control in decibels . . . . . . . . .Smoothed amplitude control with an envelopeMajor triad . . . . . . . . . . . . . . . . . . .Conversion between frequency and pitch . . .More additive synthesis . . . . . . . . . . . .Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .generator. . . . . . . . . . . . . . . . . . . . .134678101215151717171821222223242 Wavetables and samplers2.1 The Wavetable Oscillator . . .2.2 Sampling . . . . . . . . . . . .2.3 Enveloping samplers . . . . . .2.4 Timbre stretching . . . . . . . .2.5 Interpolation . . . . . . . . . .2.6 Examples . . . . . . . . . . . .Wavetable oscillator . . . . . .Wavetable lookup in general . .Using a wavetable as a sampler.27293236374347474850iii.

ivCONTENTSLooping samplers . . . . . . . . .Overlapping sample looper . . . .Automatic read point precessionExercises . . . . . . . . . . . . . . . .525456573 Audio and control computations3.1 The sampling theorem . . . . . . . . . . . . . . . . . . . .3.2 Control . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.3 Control streams . . . . . . . . . . . . . . . . . . . . . . . .3.4 Converting from audio signals to numeric control streams3.5 Control streams in block diagrams . . . . . . . . . . . . .3.6 Event detection . . . . . . . . . . . . . . . . . . . . . . . .3.7 Audio signals as control . . . . . . . . . . . . . . . . . . .3.8 Operations on control streams . . . . . . . . . . . . . . . .3.9 Control operations in Pd . . . . . . . . . . . . . . . . . . .3.10 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . .Sampling and foldover . . . . . . . . . . . . . . . . . . . .Converting controls to signals . . . . . . . . . . . . . . . .Non-looping wavetable player . . . . . . . . . . . . . . . .Signals to controls . . . . . . . . . . . . . . . . . . . . . .Analog-style sequencer . . . . . . . . . . . . . . . . . . . .MIDI-style synthesizer . . . . . . . . . . . . . . . . . . . .Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5959616367686971747778788081828383864 Automation and voice management4.1 Envelope Generators . . . . . . . . . . . . . .4.2 Linear and Curved Amplitude Shapes . . . .4.3 Continuous and discontinuous control changes4.3.1 Muting . . . . . . . . . . . . . . . . .4.3.2 Switch-and-ramp . . . . . . . . . . . .4.4 Polyphony . . . . . . . . . . . . . . . . . . . .4.5 Voice allocation . . . . . . . . . . . . . . . . .4.6 Voice tags . . . . . . . . . . . . . . . . . . . .4.7 Encapsulation in Pd . . . . . . . . . . . . . .4.8 Examples . . . . . . . . . . . . . . . . . . . .ADSR envelope generator . . . . . . . . . . .Transfer functions for amplitude control . . .Additive synthesis: Risset’s bell . . . . . . . .Additive synthesis: spectral envelope controlPolyphonic synthesis: sampler . . . . . . . . .Exercises . . . . . . . . . . . . . . . . . . . . . . .898992949596989899102103103106107110111117.

CONTENTSv5 Modulation5.1 Taxonomy of spectra . . . . . . . . . . . . . . .5.2 Multiplying audio signals . . . . . . . . . . . .5.3 Waveshaping . . . . . . . . . . . . . . . . . . .5.4 Frequency and phase modulation . . . . . . . .5.5 Examples . . . . . . . . . . . . . . . . . . . . .Ring modulation and spectra . . . . . . . . . .Octave divider and formant adder . . . . . . .Waveshaping and difference tones . . . . . . . .Waveshaping using Chebychev polynomials . .Waveshaping using an exponential function . .Sinusoidal waveshaping: evenness and oddnessPhase modulation and FM . . . . . . . . . . . .Exercises . . . . . . . . . . . . . . . . . . . . . . . .1191191221261321341341351381391401411411466 Designer spectra6.1 Carrier/modulator model . . . . . . . . . .6.2 Pulse trains . . . . . . . . . . . . . . . . . .6.2.1 Pulse trains via waveshaping . . . .6.2.2 Pulse trains via wavetable stretching6.2.3 Resulting spectra . . . . . . . . . . .6.3 Movable ring modulation . . . . . . . . . .6.4 Phase-aligned formant (PAF) generator . .6.5 Examples . . . . . . . . . . . . . . . . . . .Wavetable pulse train . . . . . . . . . . . .Simple formant generator . . . . . . . . . .Two-cosine carrier signal . . . . . . . . . . .The PAF generator . . . . . . . . . . . . . .Stretched wavetables . . . . . . . . . . . . .Exercises . . . . . . . . . . . . . . . . . . . . . .1471481511511521541561581631631641671691721727 Time shifts and delays7.1 Complex numbers . . . . . . . . . . . . . . . . .7.1.1 Complex sinusoids . . . . . . . . . . . . .7.2 Time shifts and phase changes . . . . . . . . . .7.3 Delay networks . . . . . . . . . . . . . . . . . . .7.4 Recirculating delay networks . . . . . . . . . . .7.5 Power conservation and complex delay networks7.6 Artificial reverberation . . . . . . . . . . . . . . .7.6.1 Controlling reverberators . . . . . . . . .7.7 Variable and fractional shifts . . . . . . . . . . .7.8 Fidelity of interpolating delay lines . . . . . . . .7.9 Pitch shifting . . . . . . . . . . . . . . . . . . . .7.10 Examples . . . . . . . . . . . . . . . . . . . . . .Fixed, noninterpolating delay line . . . . . . . . .Recirculating comb filter . . . . . . . . . . . . . .175176178179180184189193196196201202208208209.

viCONTENTSVariable delay line . . . . . . . . . . . . . . . . . .Order of execution and lower limits on delay timesOrder of execution in non-recirculating delay linesNon-recirculating comb filter as octave doubler . .Time-varying complex comb filter: shakers . . . . .Reverberator . . . . . . . . . . . . . . . . . . . . .Pitch shifter . . . . . . . . . . . . . . . . . . . . . .Exercises . . . . . . . . . . . . . . . . . . . . . . . . . .2092112142152162182182218 Filters8.1 Taxonomy of filters . . . . . . . . . . . . . . . . . . . . .8.1.1 Low-pass and high-pass filters . . . . . . . . . . .8.1.2 Band-pass and stop-band filters . . . . . . . . . .8.1.3 Equalizing filters . . . . . . . . . . . . . . . . . .8.2 Elementary filters . . . . . . . . . . . . . . . . . . . . . .8.2.1 Elementary non-recirculating filter . . . . . . . .8.2.2 Non-recirculating filter, second form . . . . . . .8.2.3 Elementary recirculating filter . . . . . . . . . . .8.2.4 Compound filters . . . . . . . . . . . . . . . . . .8.2.5 Real outputs from complex filters . . . . . . . . .8.2.6 Two recirculating filters for the price of one . . .8.3 Designing filters . . . . . . . . . . . . . . . . . . . . . . .8.3.1 One-pole low-pass filter . . . . . . . . . . . . . .8.3.2 One-pole, one-zero high-pass filter . . . . . . . .8.3.3 Shelving filter . . . . . . . . . . . . . . . . . . . .8.3.4 Band-pass filter . . . . . . . . . . . . . . . . . . .8.3.5 Peaking and stop-band filter . . . . . . . . . . .8.3.6 Butterworth filters . . . . . . . . . . . . . . . . .8.3.7 Stretching the unit circle with rational functions8.3.8 Butterworth band-pass filter . . . . . . . . . . .8.3.9 Time-varying coefficients . . . . . . . . . . . . .8.3.10 Impulse responses of recirculating filters . . . . .8.3.11 All-pass filters . . . . . . . . . . . . . . . . . . .8.4 Applications . . . . . . . . . . . . . . . . . . . . . . . . .8.4.1 Subtractive synthesis . . . . . . . . . . . . . . . .8.4.2 Envelope following . . . . . . . . . . . . . . . . .8.4.3 Single Sideband Modulation . . . . . . . . . . . .8.5 Examples . . . . . . . . . . . . . . . . . . . . . . . . . .Prefabricated low-, high-, and band-pass filters . . . . .Prefabricated time-varying band-pass filter . . . . . . .Envelope followers . . . . . . . . . . . . . . . . . . . . .Single sideband modulation . . . . . . . . . . . . . . . .Using elementary filters directly: shelving and peaking .Making and using all-pass filters . . . . . . . . . . . . .Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259261262

CONTENTSvii9 Fourier analysis and resynthesis9.1 Fourier analysis of periodic signals . . . . . . . . .9.1.1 Periodicity of the Fourier transform . . . .9.1.2 Fourier transform as additive synthesis . . .9.2 Properties of Fourier transforms . . . . . . . . . .9.2.1 Fourier transform of DC . . . . . . . . . . .9.2.2 Shifts and phase changes . . . . . . . . . .9.2.3 Fourier transform of a sinusoid . . . . . . .9.3 Fourier analysis of non-periodic signals . . . . . . .9.4 Fourier analysis and reconstruction of audio signals9.4.1 Narrow-band companding . . . . . . . . . .9.4.2 Timbre stamping (classical vocoder) . . . .9.5 Phase . . . . . . . . . . . . . . . . . . . . . . . . .9.5.1 Phase relationships between channels . . . .9.6 Phase bashing . . . . . . . . . . . . . . . . . . . . .9.7 Examples . . . . . . . . . . . . . . . . . . . . . . .Fourier analysis and resynthesis in Pd . . . . . . .Narrow-band companding: noise suppression . . .Timbre stamp (“vocoder”) . . . . . . . . . . . . . .Phase vocoder time bender . . . . . . . . . . . . .Exercises . . . . . . . . . . . . . . . . . . . . . . . . . 8629029129229410 Classical waveforms10.1 Symmetries and Fourier series . . . . . . . . . .10.1.1 Sawtooth waves and symmetry . . . . .10.2 Dissecting classical waveforms . . . . . . . . . .10.3 Fourier series of the elementary waveforms . . .10.3.1 Sawtooth wave . . . . . . . . . . . . . .10.3.2 Parabolic wave . . . . . . . . . . . . . .10.3.3 Square and symmetric triangle waves . .10.3.4 General (non-symmetric) triangle wave .10.4 Predicting and controlling foldover . . . . . . .10.4.1 Over-sampling . . . . . . . . . . . . . .10.4.2 Sneaky triangle waves . . . . . . . . . .10.4.3 Transition splicing . . . . . . . . . . . .10.5 Examples . . . . . . . . . . . . . . . . . . . . .Combining sawtooth waves . . . . . . . . . . .Strategies for band-limiting sawtooth waves . .Exercises . . . . . . . . . . . . . . . . . . . . . . . 16.Index319Bibliography323

viiiCONTENTS

ForewordThe Theory and Technique of Electronic Music is a uniquely complete source ofinformation for the computer synthesis of rich and interesting musical timbres.The theory is clearly presented in a completely general form. But in addition,examples of how to synthesize each theoretical aspect are presented in the Pdlanguage so the reader of the book can immediately use the theory for his musicalpurposes. I know of no other book which combines theory and technique sousefully.By far the most popular music and sound synthesis programs in use today areblock diagram compilers with graphical interfaces. These allow the composer todesign instruments by displaying the “objects” of his instrument on a computerscreen and drawing the connecting paths between the objects. The resultinggraphical display is very congenial to musicians. A naive user can design a simpleinstrument instantly. He can rapidly learn to design complex instruments. Hecan understand how complex instruments work by looking at their graphicalimages.The first graphical compiler program, Max, was written by Miller Puckettein 1988. Max dealt only with control signals for music synthesis because thecomputers available at the time were not fast enough to deal with sound. Assoon as faster computers which could compute soundwave samples in real-timewere available, Puckette and David Zicarelli appended MSP to Max (Max/MSP)thus making the computer, usually a laptop computer, into a complete musicalinstrument capable of live performance.Development of Max/MSP

Most of the computer music tools available today have antecedents in earlier generations of equipment. The computer, however, is relatively cheap and the results of using one are easy to document and re-create. In these respects at least, the computer makes the ideal electronic music instrument it is hard to see what future technology could displace it. The techniques and practices of .