勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧【專題】 PD‧三

若說誰最有資格談論『純數據』之設計理念,當然自屬 Pd 的創造者 Miller Puckette 先生本人的了。非但如此,他還寫了一本獨一無二之好書

The Theory and Technique of Electronic Music

DRAFT: December 30, 2006

Miller Puckette

闡述『理論』以及『實務』。首先援引該書的『前言』與『序言』作為 Pd 程式語言介紹串講隨筆之始︰

 

Foreword

The Theory and Technique of Electronic Music is a uniquely complete source of information 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 Pd language so the reader of the book can immediately use the theory for his musical purposes. I know of no other book which combines theory and technique so usefully.

By far the most popular music and sound synthesis programs in use today are block diagram compilers with graphical interfaces. These allow the composer to design instruments by displaying the “objects” of his instrument on a computer screen and drawing the connecting paths between the objects. The resulting graphical display is very congenial to musicians. A naive user can design a simple instrument instantly. He can rapidly learn to design complex instruments. He
can understand how complex instruments work by looking at their graphical images.

The first graphical compiler program, Max, was written by Miller Puckette in 1988. Max dealt only with control signals for music synthesis because the computers available at the time were not fast enough to deal with sound. As soon as faster computers which could compute soundwave samples in real-time were available, Puckette and David Zicarelli appended MSP to Max (Max/MSP) thus making the computer, usually a laptop computer, into a complete musical instrument capable of live performance.

Development of Max/MSP was done by Puckette and Zicarelli at IRCAM in the period 1993 to 1994 . Both have now moved to California. Zicarelli commercialized and sells Max, MSP, and JITTER (an extension to video synthesis) as products. Puckette, now a professor at UCSD, wrote Pd (Pure Data). It is an open source program which is a close equivalent to Max/MSP.

Max and Pd allow almost anyone to synthesize uninteresting timbres almost instantly. Making interesting timbres is much more difficult and requires much additional knowledge. The Theory and Technique of Electronic Music is that body of knowledge. The theory is important for any synthesis program. The Theory and Technique of Electronic Music gives copious examples of how to apply the theory using Pd. The combination of theory plus Pd examples makes this book uniquely useful. It also contains problem sets for each chapter so it is a fine textbook.

I expect Puckette’s book to become THE essential book in any electronic musician’s library.

Max Mathews

 

Preface

This is a book about using electronic techniques to record, synthesize, process, and analyze musical sounds, a practice which came into its modern form in the years 1948-1952, but whose technological means and artistic uses have undergone several revolutions since then. Nowadays most electronic music is made using computers, and this book will focus exclusively on what used to be called “computer music”, but which should really now be called “electronic music using
a computer”.

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 recreate. 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 electronic music can be studied (at least in theory) without making explicit reference to the current state of technology. Still, it’s important to provide working examples. So each chapter starts with theory (avoiding any reference to implementation) and ends with a series of examples realized in a currently available software package.

The ideal reader of this book is anyone who knows and likes electronic music of any genre, has plenty of facility with computers in general, and who wants to learn how to make electronic music from the ground up, starting with the humble oscillator and continuing through sampling, FM, filtering, waveshaping, delays, and so on. This will take plenty of time.

This book doesn’t take the easy route of recommending precooked software to try out these techniques; instead, the emphasis is on learning how to use a general-purpose computer music environment to realize them yourself. Of the several such packages available, we’ll use Pd, but that shouldn’t stop you from using these same techniques in other environments such as Csound or Max/MSP.

To read this book you must understand mathematics through intermediate algebra and trigonometry; starting in Chapter 7, complex numbers also make an appearance, although not complex analyis. (For instance, complex numbers are added, multiplied, and conjugated, but there are no complex exponentials.) A review of mathematics for computer music by F. Richard Moore appears in
[Str85, pp. 1-68].

Although the “level” of mathematics is not high, the mathematics itself is sometimes quite challenging. All sorts of cool mathematics is in the reach of any student of algebra or geometry. In the service of computer music, for instance, we’ll run into Bessel functions, Chebychev polynomials, the Central Limit Theorem, and, of course, Fourier analysis.

You don’t need much background in music as it is taught in the West; in particular, Western written music notation is not needed. Some elementary bits of Western music theory are used, such as the tempered scale, the A-B-C system of naming pitches, and terms like “note” and “chord”. Also you should be familiar with terms of musical acoustics such as sinusoids, amplitude, frequency, and the overtone series.

Each chapter starts with a theoretical discussion of some family of techniques or theoretical issues, followed by a series of examples realized in Pd to illustrate them. The examples are included in the Pd distribution, so you can run them and/or edit them into your own spinoffs. In addition, all the figures were created using Pd patches, which appear in an electronic supplement. These aren’t carefully documented but in principle could be used as an example of Pd’s drawing capabilities for anyone interested in that.

I would like to thank some people who have made it possible for me to write this. Barry Vercoe is almost entirely responsible for my music education. Meanwhile I was taught mathematics by Wayne Holman, Samuel Greitzer, Murray Klamkin, Gian-Carlo Rota, Frank Morgan, Michael Artin, Andrew Gleason, and many others. Phil White taught me English and Rosie Paschall visual composition. Finally, my parents (one deceased) are mighty patient; I’m now 47.

Thank you

 

雖然這本書寫於十年之前,至今依舊魅力不減。作者不過嘗試註解部份 Miller Puckette 篇章,希望能為讀者起個頭而已。由於 Pd 是個『動態』 dynamic 、『即時』 real-time 以及『互動』 interactive 的程式環境,總是得從『實作』中『學習』。假使還沒閱讀過

Johannes Kreidler 之

Chapter 2. Programming with Pd for the first time 》文本

的讀者請先閱讀。最好能補之以 Miller Puckette 書中第一章

Sinusoids, amplitude and frequency

對 Pd 之總論︰

Quick Introduction to Pd

Pd documents are called patches. They correspond roughly to the boxes in the abstract block diagrams shown earlier in this chapter, but in detail they are quite different, because Pd is an implementation environment, not a specification language.

箱子網路

A Pd patch, such as the ones shown in Figure 1.10, consists of a collection of boxes connected in a network. The border of a box tells you how its text is interpreted and how the box functions. In part (a) of the figure we see three types of boxes. From top to bottom they are:

• a message box. Message boxes, with a flag-shaped border, interpret the text as a message to send whenever the box is activated (by an incoming message or with a pointing device). The message in this case consists simply of the number “21”.

Pd_Quick_Introduction

Figure 1.10: (a) three types of boxes in Pd (message, object, and GUI); (b) a simple patch to output a sinusoid.

• an object box. Object boxes have a rectangular border; they interpret the text to create objects when you load a patch. Object boxes may hold hundreds of different classes of objectsincluding oscillators, envelope generators, and other signal processing modules to be introduced later— depending on the text inside. In this example, the box holds an adder. In most Pd patches, the majority of boxes are of type “object”. The first word typed into an object box specifies its class, which in this case is just “+”. Any additional (blank-space-separated) words appearing in the box are called creation arguments, which specify the initial state of the object when it is created.

• a number box. Number boxes are a particular type of GUI box. Others include push buttons and toggle switches; these will come up later in the examples. The number box has a punched-card-shaped border, with a nick out of its top right corner. Whereas the appearance of an object or message box is fixed when a patch is running, a number box’s contents (the text) changes to reflect the current value held by the box. You can also use a number box as a control by clicking and dragging up and down, or by typing values in it.

In Figure 1.10 (part a) the message box, when clicked, sends the message “21” to an object box which adds 13 to it. The lines connecting the boxes carry data from one box to the next; outputs of boxes are on the bottom and inputs on top.

Figure 1.10 (part b) shows a Pd patch which makes a sinusoid with controllable frequency and amplitude. The connecting patch lines are of two types here; the thin ones are for carrying sporadic messages, and the thicker ones (connecting the oscillator, the multiplier, and the output dac~ object) carry digital audio signals. Since Pd is a real-time program, the audio signals flow in a continuous stream. On the other hand, the sporadic messages appear at specific but possibly unpredictable instants in time.

Whether a connection carries messages or signals depends on the box the connection comes from; so, for instance, the + object outputs messages, but the *~ object outputs a signal. The inputs of a given object may or may not accept signals (but they always accept messages, even if only to convert them to signals). As a convention, object boxes with signal inputs or outputs are all named with a trailing tilde (“~”) as in “*~” and “osc~”.

 

How to find and run the examples

To run the patches, you must first download, install, and run Pd. Instructions for doing this appear in Pd’s online HTML documentation, which you can find at

http://crca.ucsd.edu/ ̃msp/software.htm.

This book should appear at

http:/crca/ucsd/edu/ ̃msp/techniques.htm,

possibly in several revisions. Choose the revision that corresponds to the text you’re reading (or perhaps just the latest one) and download the archive containing the associated revision of the examples (you may also download an archive of the HTML version of this book for easier access on your machine). The examples should all stay in a single directory, since some of them depend on other files in that directory and might not load them correctly if you have moved things around.

If you do want to copy one of the examples to another directory so that you can build on it (which you’re welcome to do), you should either include the examples directory in Pd’s search path (see the Pd documentation) or else figure out what other files are needed and copy them too. A good way to find this out is just to run Pd on the relocated file and see what Pd complains it can’t find.

There should be dozens of files in the “examples” folder, including the examples themselves and the support files. The filenames of the examples all begin with a letter (A for chapter 1, B for 2, etc.) and a number, as in “A01.sinewave.pd”.

The example patches are also distributed with Pd, but beware that you may find a different version of the examples which might not correspond to the text you’re reading.

 

,就此展開『箱子世界』之旅的耶!