From 57045df5fe3ec557e57dc7434ac1a07b5521bffc Mon Sep 17 00:00:00 2001 From: Guenter Geiger Date: Mon, 29 Jul 2002 17:06:19 +0000 Subject: This commit was generated by cvs2svn to compensate for changes in r58, which included commits to RCS files with non-trunk default branches. svn path=/trunk/; revision=59 --- pd/doc/1.manual/1.introduction.txt | 19 + pd/doc/1.manual/fig1.1.jpg | Bin 0 -> 6794 bytes pd/doc/1.manual/fig1.2.jpg | Bin 0 -> 4361 bytes pd/doc/1.manual/fig1.3.jpg | Bin 0 -> 1056 bytes pd/doc/1.manual/fig1.4.jpg | Bin 0 -> 5965 bytes pd/doc/1.manual/fig1.5.jpg | Bin 0 -> 6187 bytes pd/doc/1.manual/fig3.1.jpg | Bin 0 -> 1201 bytes pd/doc/1.manual/fig3.10.jpg | Bin 0 -> 2884 bytes pd/doc/1.manual/fig3.2.jpg | Bin 0 -> 2932 bytes pd/doc/1.manual/fig3.3.jpg | Bin 0 -> 2177 bytes pd/doc/1.manual/fig3.4.jpg | Bin 0 -> 2359 bytes pd/doc/1.manual/fig3.5.jpg | Bin 0 -> 2029 bytes pd/doc/1.manual/fig3.6.jpg | Bin 0 -> 2977 bytes pd/doc/1.manual/fig3.7.jpg | Bin 0 -> 2846 bytes pd/doc/1.manual/fig3.8.jpg | Bin 0 -> 1267 bytes pd/doc/1.manual/fig3.9.jpg | Bin 0 -> 5708 bytes pd/doc/1.manual/fig7.1.jpg | Bin 0 -> 2410 bytes pd/doc/1.manual/fig7.2.jpg | Bin 0 -> 7327 bytes pd/doc/1.manual/fig7.3.jpg | Bin 0 -> 2588 bytes pd/doc/1.manual/fig7.4.jpg | Bin 0 -> 3245 bytes pd/doc/1.manual/fig7.5.jpg | Bin 0 -> 2490 bytes pd/doc/1.manual/fig7.6.jpg | Bin 0 -> 7758 bytes pd/doc/1.manual/fig8.1.jpg | Bin 0 -> 2551 bytes pd/doc/1.manual/fig8.2.jpg | Bin 0 -> 2414 bytes pd/doc/1.manual/fig8.3.jpg | Bin 0 -> 2036 bytes pd/doc/1.manual/fig8.4.jpg | Bin 0 -> 3428 bytes pd/doc/1.manual/fig8.5.jpg | Bin 0 -> 5182 bytes pd/doc/1.manual/fig8.6.jpg | Bin 0 -> 7549 bytes pd/doc/1.manual/fig9.1.jpg | Bin 0 -> 15267 bytes pd/doc/1.manual/fig9.2.jpg | Bin 0 -> 17390 bytes pd/doc/1.manual/fig9.3.jpg | Bin 0 -> 38881 bytes pd/doc/1.manual/index.htm | 161 +++++ pd/doc/1.manual/x1.htm | 112 ++++ pd/doc/1.manual/x2.htm | 1215 +++++++++++++++++++++++++++++++++++ pd/doc/1.manual/x3.htm | 854 +++++++++++++++++++++++++ pd/doc/1.manual/x4.htm | 59 ++ pd/doc/1.manual/x5.htm | 1231 ++++++++++++++++++++++++++++++++++++ 37 files changed, 3651 insertions(+) create mode 100644 pd/doc/1.manual/1.introduction.txt create mode 100644 pd/doc/1.manual/fig1.1.jpg create mode 100644 pd/doc/1.manual/fig1.2.jpg create mode 100644 pd/doc/1.manual/fig1.3.jpg create mode 100644 pd/doc/1.manual/fig1.4.jpg create mode 100644 pd/doc/1.manual/fig1.5.jpg create mode 100644 pd/doc/1.manual/fig3.1.jpg create mode 100644 pd/doc/1.manual/fig3.10.jpg create mode 100644 pd/doc/1.manual/fig3.2.jpg create mode 100644 pd/doc/1.manual/fig3.3.jpg create mode 100644 pd/doc/1.manual/fig3.4.jpg create mode 100644 pd/doc/1.manual/fig3.5.jpg create mode 100644 pd/doc/1.manual/fig3.6.jpg create mode 100644 pd/doc/1.manual/fig3.7.jpg create mode 100644 pd/doc/1.manual/fig3.8.jpg create mode 100644 pd/doc/1.manual/fig3.9.jpg create mode 100644 pd/doc/1.manual/fig7.1.jpg create mode 100644 pd/doc/1.manual/fig7.2.jpg create mode 100644 pd/doc/1.manual/fig7.3.jpg create mode 100644 pd/doc/1.manual/fig7.4.jpg create mode 100644 pd/doc/1.manual/fig7.5.jpg create mode 100644 pd/doc/1.manual/fig7.6.jpg create mode 100644 pd/doc/1.manual/fig8.1.jpg create mode 100644 pd/doc/1.manual/fig8.2.jpg create mode 100644 pd/doc/1.manual/fig8.3.jpg create mode 100644 pd/doc/1.manual/fig8.4.jpg create mode 100644 pd/doc/1.manual/fig8.5.jpg create mode 100644 pd/doc/1.manual/fig8.6.jpg create mode 100644 pd/doc/1.manual/fig9.1.jpg create mode 100644 pd/doc/1.manual/fig9.2.jpg create mode 100644 pd/doc/1.manual/fig9.3.jpg create mode 100644 pd/doc/1.manual/index.htm create mode 100644 pd/doc/1.manual/x1.htm create mode 100644 pd/doc/1.manual/x2.htm create mode 100644 pd/doc/1.manual/x3.htm create mode 100644 pd/doc/1.manual/x4.htm create mode 100644 pd/doc/1.manual/x5.htm (limited to 'pd/doc/1.manual') diff --git a/pd/doc/1.manual/1.introduction.txt b/pd/doc/1.manual/1.introduction.txt new file mode 100644 index 00000000..c8fa88a8 --- /dev/null +++ b/pd/doc/1.manual/1.introduction.txt @@ -0,0 +1,19 @@ +PD_VERSION + +A real-time graphical programming environment for live interactive +computer music, Pd works on SGI machines, Microsoft Windows, +Linux, and Max OSX. + +Pd is copyrighted, but is free for you to use for any reasonable purpose. +See the file: + PD_BASEDIR/LICENSE.txt + +HTML documentation for Pd lives in: + file:PD_BASEDIR/doc/1.manual/index.htm +or: + http://www.crca.ucsd.edu/~msp/Pd_documentation/index.htm + +The Pd mailing list archive lives in: + http://iem.kug.ac.at/mailinglists/pd-list/ + +Many more useful links are listed in the HTML documentation, section 1.2. diff --git a/pd/doc/1.manual/fig1.1.jpg b/pd/doc/1.manual/fig1.1.jpg new file mode 100644 index 00000000..bfc76f64 Binary files /dev/null and b/pd/doc/1.manual/fig1.1.jpg differ diff --git a/pd/doc/1.manual/fig1.2.jpg b/pd/doc/1.manual/fig1.2.jpg new file mode 100644 index 00000000..c33c755c Binary files /dev/null and b/pd/doc/1.manual/fig1.2.jpg differ diff --git a/pd/doc/1.manual/fig1.3.jpg b/pd/doc/1.manual/fig1.3.jpg new file mode 100644 index 00000000..caf29b2d Binary files /dev/null and b/pd/doc/1.manual/fig1.3.jpg differ diff --git a/pd/doc/1.manual/fig1.4.jpg b/pd/doc/1.manual/fig1.4.jpg new file mode 100644 index 00000000..28a29dc6 Binary files /dev/null and b/pd/doc/1.manual/fig1.4.jpg differ diff --git a/pd/doc/1.manual/fig1.5.jpg b/pd/doc/1.manual/fig1.5.jpg new file mode 100644 index 00000000..4b01c59f Binary files /dev/null and b/pd/doc/1.manual/fig1.5.jpg differ diff --git a/pd/doc/1.manual/fig3.1.jpg b/pd/doc/1.manual/fig3.1.jpg new file mode 100644 index 00000000..f8348970 Binary files /dev/null and b/pd/doc/1.manual/fig3.1.jpg differ diff --git a/pd/doc/1.manual/fig3.10.jpg b/pd/doc/1.manual/fig3.10.jpg new file mode 100644 index 00000000..4625ce0c Binary files /dev/null and b/pd/doc/1.manual/fig3.10.jpg differ diff --git a/pd/doc/1.manual/fig3.2.jpg b/pd/doc/1.manual/fig3.2.jpg new file mode 100644 index 00000000..994d41c7 Binary files /dev/null and b/pd/doc/1.manual/fig3.2.jpg differ diff --git a/pd/doc/1.manual/fig3.3.jpg b/pd/doc/1.manual/fig3.3.jpg new file mode 100644 index 00000000..91cac54a Binary files /dev/null and b/pd/doc/1.manual/fig3.3.jpg differ diff --git a/pd/doc/1.manual/fig3.4.jpg b/pd/doc/1.manual/fig3.4.jpg new file mode 100644 index 00000000..e2f2fe53 Binary files /dev/null and b/pd/doc/1.manual/fig3.4.jpg differ diff --git a/pd/doc/1.manual/fig3.5.jpg b/pd/doc/1.manual/fig3.5.jpg new file mode 100644 index 00000000..9a79a2b3 Binary files /dev/null and b/pd/doc/1.manual/fig3.5.jpg differ diff --git a/pd/doc/1.manual/fig3.6.jpg b/pd/doc/1.manual/fig3.6.jpg new file mode 100644 index 00000000..fcbcf3da Binary files /dev/null and b/pd/doc/1.manual/fig3.6.jpg differ diff --git a/pd/doc/1.manual/fig3.7.jpg b/pd/doc/1.manual/fig3.7.jpg new file mode 100644 index 00000000..84dcd7f7 Binary files /dev/null and b/pd/doc/1.manual/fig3.7.jpg differ diff --git a/pd/doc/1.manual/fig3.8.jpg b/pd/doc/1.manual/fig3.8.jpg new file mode 100644 index 00000000..ab03a207 Binary files /dev/null and b/pd/doc/1.manual/fig3.8.jpg differ diff --git a/pd/doc/1.manual/fig3.9.jpg b/pd/doc/1.manual/fig3.9.jpg new file mode 100644 index 00000000..6e9655c7 Binary files /dev/null and b/pd/doc/1.manual/fig3.9.jpg differ diff --git a/pd/doc/1.manual/fig7.1.jpg b/pd/doc/1.manual/fig7.1.jpg new file mode 100644 index 00000000..b677f6bd Binary files /dev/null and b/pd/doc/1.manual/fig7.1.jpg differ diff --git a/pd/doc/1.manual/fig7.2.jpg b/pd/doc/1.manual/fig7.2.jpg new file mode 100644 index 00000000..54690d0e Binary files /dev/null and b/pd/doc/1.manual/fig7.2.jpg differ diff --git a/pd/doc/1.manual/fig7.3.jpg b/pd/doc/1.manual/fig7.3.jpg new file mode 100644 index 00000000..a3b70ed3 Binary files /dev/null and b/pd/doc/1.manual/fig7.3.jpg differ diff --git a/pd/doc/1.manual/fig7.4.jpg b/pd/doc/1.manual/fig7.4.jpg new file mode 100644 index 00000000..88ba5b40 Binary files /dev/null and b/pd/doc/1.manual/fig7.4.jpg differ diff --git a/pd/doc/1.manual/fig7.5.jpg b/pd/doc/1.manual/fig7.5.jpg new file mode 100644 index 00000000..f9de4b3b Binary files /dev/null and b/pd/doc/1.manual/fig7.5.jpg differ diff --git a/pd/doc/1.manual/fig7.6.jpg b/pd/doc/1.manual/fig7.6.jpg new file mode 100644 index 00000000..5f24af7a Binary files /dev/null and b/pd/doc/1.manual/fig7.6.jpg differ diff --git a/pd/doc/1.manual/fig8.1.jpg b/pd/doc/1.manual/fig8.1.jpg new file mode 100644 index 00000000..57e59313 Binary files /dev/null and b/pd/doc/1.manual/fig8.1.jpg differ diff --git a/pd/doc/1.manual/fig8.2.jpg b/pd/doc/1.manual/fig8.2.jpg new file mode 100644 index 00000000..1dd48cd9 Binary files /dev/null and b/pd/doc/1.manual/fig8.2.jpg differ diff --git a/pd/doc/1.manual/fig8.3.jpg b/pd/doc/1.manual/fig8.3.jpg new file mode 100644 index 00000000..165c1c88 Binary files /dev/null and b/pd/doc/1.manual/fig8.3.jpg differ diff --git a/pd/doc/1.manual/fig8.4.jpg b/pd/doc/1.manual/fig8.4.jpg new file mode 100644 index 00000000..afc89a73 Binary files /dev/null and b/pd/doc/1.manual/fig8.4.jpg differ diff --git a/pd/doc/1.manual/fig8.5.jpg b/pd/doc/1.manual/fig8.5.jpg new file mode 100644 index 00000000..6fa3d0d1 Binary files /dev/null and b/pd/doc/1.manual/fig8.5.jpg differ diff --git a/pd/doc/1.manual/fig8.6.jpg b/pd/doc/1.manual/fig8.6.jpg new file mode 100644 index 00000000..2823e032 Binary files /dev/null and b/pd/doc/1.manual/fig8.6.jpg differ diff --git a/pd/doc/1.manual/fig9.1.jpg b/pd/doc/1.manual/fig9.1.jpg new file mode 100644 index 00000000..bab4b689 Binary files /dev/null and b/pd/doc/1.manual/fig9.1.jpg differ diff --git a/pd/doc/1.manual/fig9.2.jpg b/pd/doc/1.manual/fig9.2.jpg new file mode 100644 index 00000000..88ef528c Binary files /dev/null and b/pd/doc/1.manual/fig9.2.jpg differ diff --git a/pd/doc/1.manual/fig9.3.jpg b/pd/doc/1.manual/fig9.3.jpg new file mode 100644 index 00000000..ecb66004 Binary files /dev/null and b/pd/doc/1.manual/fig9.3.jpg differ diff --git a/pd/doc/1.manual/index.htm b/pd/doc/1.manual/index.htm new file mode 100644 index 00000000..ddaa292d --- /dev/null +++ b/pd/doc/1.manual/index.htm @@ -0,0 +1,161 @@ + + +Pd Documentation + + + +
+ +
+ +Pd Documentation
+
+

+This is the HTML documentation for Pd, a patchable environment for audio +analysis, synthesis, and processing, +with a rich set of multimedia capabilities. The latest version of this page +can be found at: + + http://www.crca.ucsd.edu/~msp/software.html . +

    +
  1. introduction +
      +
    1. guide to the documentation +
    2. other resources +
    + +
  2. theory of operation +
      +
    1. overview +
        +
      1. main window, canvases, and printout +
      2. object boxes +
      3. message, number, and symbol boxes +
      4. patches and files +
      +
    2. how to edit patches +
        +
      1. edit and run mode +
      2. creating boxes +
      3. the selection +
      4. deleting, cutting, and pasting +
      5. changing the text +
      6. connecting and disconnecting boxes +
      7. properties and help +
      +
    3. messages +
        +
      1. anatomy of a message +
      2. depth first message passing +
      3. + hot and cold inlets and right to left outlet order +
      4. message boxes +
      +
    4. audio signals +
        +
      1. sample rate and format +
      2. tilde objects and audio connections +
      3. converting to and from messages +
      4. switching and blocking +
      5. nonlocal signal connections +
      +
    5. scheduling +
        +
      1. audio and messages +
      2. computation load +
      3. determinism +
      +
    6. semantics +
        +
      1. creation of objects +
      2. persistence of data +
      3. message passing +
      4. inlets and lists +
      5. dollar signs +
      +
    7. subpatches +
        +
      1. abstractions +
      2. graph-on-parent subpatches +
      +
    8. numeric arrays +
    9. data structures +
        +
      1. abstractions +
      2. graph-on-parent subpatches +
      3. limitations +
      + +
    + +
  3. getting Pd to run +
      +
    1. IRIX (SGI) +
    2. Microsoft Windows +
    3. Linux +
    4. Mac OSX +
    5. graphics rendering using GEM +
    6. The Pd command line +
    7. dealing with files +
    +
  4. writing Pd objects in C + +
  5. current status +
      +
    1. release notes +
    2. known bugs +
    3. differences from Max/MSP +
    + +
+ + + + + diff --git a/pd/doc/1.manual/x1.htm b/pd/doc/1.manual/x1.htm new file mode 100644 index 00000000..946949e9 --- /dev/null +++ b/pd/doc/1.manual/x1.htm @@ -0,0 +1,112 @@ + + +Pd Documentation 1 + + + +
+ +
+Pd Documentation chapter 1: introduction +
+
+ back to table of contents +

+

+This is the HTML documentation for the Pd computer program. +Pd is free and can be downloaded from the internet; +go to + + http://www.crca.ucsd.edu/~msp/software.html +to get it. +

1.1. guide to the documentation

+ +

Pd's documentation consists of: + +

    +
  • this HTML manual +
  • "reference" patches, one for each kind of object in Pd +
  • "example" patches showing how to do things +
  • sample C code +
+ +

+This manual has five sections: + +

    +
  1. this overview +
  2. + a theory of operations, explaining how Pd works +
  3. + instructions on installing Pd and getting it to run +
  4. how to write C extensions to Pd +
  5. release notes and known bugs +
+ +

In order to consult the reference and example patches, you'll first have +to get Pd started as explained in this manual. + +

+For a list of all the objects you can use in Pd, see the text file, +"0.INTRO.txt" in the directory, "../5.reference". To get help on any +Pd object you can right click on it; or you can browse the help patches +by choosing "Pure Documentation..." in the Pd help menu and looking in +5.reference. + +

+The example patches are also available from the "Pure Documentation..." item +in Pd's +"help" menu. The example patches appear in subdirectories named +"2.control.examples", "3.audio.examples" and "4.fft.examples." Some additional +patches in "7.stuff" might also be helpful. + +

+To get started writing your own C extensions, refer to chapter 4 of this manual. + +

1.2. other resources

+ +

+Most of the interesting resources related to Pd show up on the Pd mailing list, +maintained by Iohannes Zmoelnig. To subscribe or browse the archives +visit: + + http://iem.kug.ac.at/mailinglists/pd-list/. + +. This is the +best source of recent information regarding installation problems and bugs. It +is perfectly reasonable to post "newbie" questions on this list; alternatively +you can contact msp@ucsd.edu for help. + +

Many extensions to Pd are announced on the mailing list. In particular, +for people interested in graphics, there is a A 3D graphics rendering package, +named GEM, based on OpenGL, was written by Mark Danks, adapted to Linux by +Guenter Geiger, and is now maintained by Iohannes Zmoelnig. GEM runs on +Windows and Linux and probably will run with some coaxing on IRIX. You can get +it from: http://iem.kug.ac.at/GEM . + +

A video processing package, Framestein, is by Juha Vehvilainen. This runs +on Windows only: http://framestein.org . + +

+Here are some more Pd links (in the order I found them):
+ + Miller Puckette's home page
+ Guenter Geiger's home page
+ Mark Dank's home page
+Pd page on Wonk (Klaus)
+ + Johannes M Zmoelnig
+ Norbert Math's Pd page
+ Thomas Musil's IEMLIB
+ jfm3's Pure Data FAQ and downloads +(also available in Japanese translation).
+ +Nicolas Lhommet's WikiWikiWeb page for Pd
+ Norbert's searchable list of all known +Pd objects
+ +Krzysztof Czaja's MIDI file support
+ +David Sabine's Pd Documentation Project: new, highly detailed help windows
+ + diff --git a/pd/doc/1.manual/x2.htm b/pd/doc/1.manual/x2.htm new file mode 100644 index 00000000..cc382e67 --- /dev/null +++ b/pd/doc/1.manual/x2.htm @@ -0,0 +1,1215 @@ + + +Pd Documentation + + + +

+ +
+Pd Documentation chapter 2: theory of operation +
+
+ back to table of contents +

+

+ +

The purpose of this chapter is to describe Pd's design and how it is +supposed to work. Practical details about how to obtain, install, and run Pd +are described in the next chapter. To learn digital audio processing basics +such as how to generate time-varying sounds that don't click or fold over, a +good reference is Dodge and Jerse, Computer Music . + +

2.1 overview

+ +Pd is a real-time graphical programming environment for audio and graphical +processing. It resembles the Max/MSP system but is much simpler and more +portable; also Pd has two features not (yet) showing up in Max/MSP: first, +via Mark Dank's GEM package, Pd can be used for simultaneous computer +animation and computer audio. Second, an experimental facility is provided +for defining and accessing data structures. + +

2.1.1. the main window, canvases, and printout

+ +When Pd is running, you'll see a main "Pd" window, and possibly one or more +"canvases" or "patches". The main Pd window looks like this: + +

+ +

+ +

There are peak level and clip indicators for audio input and output; these +report peak levels over all input and all output channels. Note that DC +shows up as an input level; many cards have DC levels which show up in the +50s. To see an RMS audio level, select "test audio and MIDI" from the help +window. The main window display is intended only to help you avoid clipping +on input and output. You can turn the peak meters on and off using the +control at bottom left. + +

At bottom right is a control to turn audio processing on and off globally. +Turning audio off does not relinquish the audio devices, it just stops the +computation. The "audio" menu is also provided, with accelerators "Control-." +to turn audio computation off and "Control-/" to turn it on. When audio is +on, Pd is computing audio samples in real time according to whatever patches +you have open (visible or not.) + +

The DIO (Digital I/O) error indicator flashes if there is a synchronization +error for audio input or output. Click there to see a list of recent errors. +This indicator is normally red at startup, and will turn red whenever the +computation runs late (so that the DAC FIFOs fill and/or the ADC FIFOs empty) +or if audio input and output are not running at the same rate. See + audio and MIDI support . + +

Pd documents are called "patches" or "canvases." +Each open document has one main window and any number of +subwindows. The subwindows can be opened and closed but are always running +whether you can see them or not. Here is a simple Pd patch: + +

+ +

+ +There are four text items in this patch: a number box (showing zero), +an object box showing "print," and two comments. The number box and the object +box are connected, the number box's output to the print box's input. Boxes may +have zero or more inputs and/or outputs, with the inputs on top and the outputs +on bottom. + +

+Pd's printout appears on its standard output. Normally, you'll run Pd in a +"shell" or "terminal" window which you'll keep open to see any printout or +error messages. + +

2.1.2. object boxes

+

Pd patches can have four types of boxes: object, message, GUI, +and comment . + +

You make objects by typing text into object boxes. The text is +divided into atoms separated by white space. The first atom specifies +what type of object Pd will make, and the other atoms, called creation +arguments , tell Pd how to initialize the object. If you type for example, + +

+ +

+ +the "+" specifies the class of the object. +In this case the object will be the kind that carries out addition, +and the "13" initializes the amount to add. Atoms are either numbers or +symbols like "+". + +The text you type into an object box determines how +many and what kinds of inlets and outlets the object will have. Some +classes (like "+" always have a fixed arrangement of inlets and outlets, +and in the case of other classes, the inlets and outlets will depend on the +creation arguments. + +

+Here for example is a simple MIDI synthesizer: + +

+ +

+ +This patch mixes control objects (notein, stripnote, and ftom) with + tilde objects osc~, *~, and dac~. The control objects carry out their +function sporadically, as a result of one or more type of event . In +this case, incoming MIDI note messages set off the control computation. The +result of the computation is, when the note happens to be a "note on" (and not +a "note off", to compute the frequency in cycles per second and pass it on to +the oscillator ("osc~"). + +

The second half of the patch, the osc~, *~, and dac~ objects, compute audio +samples, in the same way as an analog synthesizer works. The osc~ object is +acting as the interface between the two regimes, in that it takes control +messages to set its frequency but talks to "*~" using an audio signal. Audio +signals aren't sporadic; they are continuous streams of numbers. As a result +tilde objects act under very different rules from control objects. The audio +portion of the patch is always running, whether MIDI messages arrive or not; +the function of control computations is to insert calculations between the +audio computation which may change audio computation parameters such as +the frequency of an oscillator. + +

2.1.3. message and GUI boxes

+ +The border of a box tells you how its text is interpreted and how the box +functions. Object boxes use the text to create objects when you load a +patch. Message boxes interpret the text as a message to send whenever +the box is activated (by an incoming message or with the mouse.) In the example +below the message box, when clicked, sends the message "21" to an object +box which adds 13 to it. + +

+ +

+ +The third box shown is a GUI box. GUI boxes come in many forms including +number boxes (as in this example), toggles, sliders, and so on. Whereas the +appearance of an object or message box is static 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. (There are also shift- and alt-click +actions; see getting help to find out how to look +this up). + +

You can also create a "symbol" box which is like a number box but deals +in symbols like "cat." You can type your own strings in (followed by "enter") +or use it to display strings which arrive as messages to its inlet. + +

2.1.4. patches and files

+ +When you save a patch to a file, Pd doesn't save the entire state of all the +objects in the patch, but only what you see: the objects' creation arguments +and their interconnections. Certain data-storage objects have functions for +reading and writing other files to save and restore their internal state. + +Pd finds files using a path which can be specified as part of Pd's +startup arguments. The path specifies one or more directories, separated by +colons (semicolons if you're using windows.) Most objects which can read files +search for them along the search path, but when Pd writes files they go to +the directory where the patch was found. + +

2.2. editing Pd patches

+ +

2.2.1. edit and run mode

+ +

A patch can be in edit or run mode; this really only affects how mouse +clicks affect the patch. In edit mode, clicking and dragging selects and +moves boxes or makes and cuts connections; in run mode clicking on boxes sends +them messages which they react to in different ways. In run mode, number and +message boxes can be used as controls. Normally, when you are in a performance +you will stay in run mode; to change the patch you go to edit mode. + +

2.2.2. creating boxes

+ +

You can create boxes (objects, messages, GUIs, and comments) using the +"put" menu. Note the handy accelerators. Object and message boxes are empty +at first; drag them where you want them and type in the text. The GUI +objects (which come in several flavors) require no typing; just create and +place them. + +

You will often find it more convenient to select a box and "duplicate" it +(in the Edit menu) than to use the "Put" menu. If you select and duplicate +several items, any connections between them will be duplicated as well. + +

2.2.3. the selection

+ +Boxes in a Pd window may be selected by clicking on them. To select more +than one object you may use shift-click or click "outside" and select all +objects within a rectangle. You can't select lines, only boxes. + +Clicking on an unselected object, message, or comment box makes the text +active, i.e., ready to be text edited. If you select using the rectangle +method, the text isn't activated. This affects whether further clicks will +displace teh object or select text within it. + +

2.2.4. deleting, cutting, and pasting

+ +If you select a box but don't activate the text in it, you can "delete" it +by hitting the backspace key. You can "cut" "copy" and "paste" using menu +items. Notice that pasting puts the new object(s) right down on top of the +old ones. + +The "duplicate" menu item performs a copy and paste with a small offset so you +can see the new boxes. You can drag them together to a new place on the +screen. + +You can cut and paste between windows within Pd but cut/paste isn't +integrated with the OS in any way. Cut/copy/paste for text strings isn't +implemented yet, although in Linux and Irix at least you can "X-paste" into +and out of "text" dialogs (created with the "edit text" menu item.) + +

2.2.5. changing the text

+ +

To change a text item, you can select it and then edit the text. If you +only click once, the entire text is selected and your typing will replace +everything. Click again and drag to select a portion of the text to retype. + +

If there's +more than a small amount of text (in a comment, for example) you might want to +select the text and choose "text editor" from the Edit menu, which opens a text +editing window with a copy of the text in it. Hitting "send" in that window is +exactly equivalent to retyping the text into Pd; you can send it to more than +one box in sequence if you want. + +

If you click a box and move the mouse without releasing the button this +displaces the entire box. If you wish to displace a box which is already +sepected, first deselect the box by clicking outside it; otherwise you will be +selecting text instead of moving the box. + +

The updated text only becomes part of the patch when you deselect the +object. Changing the text in an "object" box actually deletes the old +object and creates a new one; the internal state of the old one is lost. + +

2.2.6. connecting and disconnecting boxes

+ +To make a connection between two boxes, click on any outlet of the first +one, drag toward an inlet of the second one, and release. You can actually +release the mouse button anywhere within the target object and the connection +will be made to the nearest inlet. + +Connections are broken simply by clicking on them (the cursor changes to an +"X" when appropriate.) + +

2.2.7. Properties and help

+ +

all the "clicking" mentioned above is done with the left mouse button. +The right button, instead, gives a popup menu for "properties" and "help". +Properties are enabled for number boxes and graphs (and in the future may +be available for other things as well.) Selecting "help" on an object gets +a Pd patch that demonstrates how to use it. "Help for the canvas as a whole +(click outsize any object) gives a list of all built-in objects. + +

2.2.8. miscellaneous

+ +

Control-q "quits" Pd, but asks you to comfirm the quit. To quit without +having to confirm, use command-shift-Q. + +

2.3. messages

+ +

In Pd, objects intercommunicate by sending messages and/or audio signals. +Pd messages are sporadic, like MIDI messages or music N "Note cards." + +

2.3.1. anatomy of a message

+ +Messages contain a selector followed by +any number of arguments. The selector is a symbol, which appears in the patch +as a non-numeric string with no white space, semicolons, or commas. The +arguments may be symbols or numbers. Numbers in Pd are kept in 32-bit floating +point, so that they can represent integers exactly between -8388608 and +8388608. (In Max, there are separate data types for integers and floating +point numbers; Pd uses only float.) + +

When a message is passed to something (which is often an inlet of a box +but could be anything that can receive a message), the selector of the message +is checked against the receiver. If the receiver recognizes messages of that +selector, it carries out some corresponding action. For instance, here is a +"float" object: + +

+ +

+ +

The two rectangles at the top are usually both called "inlets" but +the one at the left directs incoming messages to the "float" object itself, +whereas the one at the right directs messages to an auxilliary "inlet" +object. The float object proper (represented by the left-hand inlet) accepts +messages with selector "float" and "bang". The right-hand inlet takes only +the message selector "float". These two selectors, along with "symbol" and +"list", are usually used to denote an object's main action, whatever it may be, +so that objects can be interconnected with maximum flexibility. + +

It is possible to type messages which start with a number, +which cannot be used as a selector. A single number is always given the +"float" selector automatically, and a message with a number followed by other +arguments is given the selector "list". + +

2.3.2. depth first message passing

+ +

In Pd whenever a message is initiated, the receiver may then send out +further messages in turn, and the receivers of those messages can send yet +others. So each message sets off a tree of consequent messages. This tree is +executed in depth first fashion. For instance in the patch below: + +

+ +

+ +

the order of arrival of messages is either A-B-C-D or A-C-D-B. The "C" +message is not done until the "D" one is also, and the "A" is not done until +all four are. It is indeterminate which of "B" or "C" is done first; this +depends on what order you made the connections in (in Max, it's automatically +sorted right to left). + +

Message-passing can give rise to infinite loops of the sort shown here: + +

+ +

+ +

Here the left-hand "+" can't finish processing until the right-hand one has +been sent the result "2", which can't finish processing that until the +left-hand one has been sent "3", and so on. Pd will print an error message +reporting a "stack overflow" if this happens. + +

However, it is legal to make a loop if there is a "delay" object somewhere +in it. When the "delay" receives a message it schedules a messsage for the +future (even if the time delay is 0) and is then "finished;" Pd's internal +scheduler will wake the delay back up later. + +

+2.3.3. hot and cold inlets and right to left outlet order

+ +

With few exceptions (notably "timer"), objects treat their leftmost +inlet as "hot" in the sense that messages to right inlets can result in output +messages. So the following is a legal (and reasonable) loop construct: + +

+ +

+ +Here the "f" is an abbreviation for "float". Note that the "+ 1" output is +connected to the right-hand inlet of "f". This "cold" inlet merely stores the +value for the next time the "f" is sent the "bang" message. + +It is frequently desirable to send messages to two or more inlets of an object +to specify its action. For instance, you can use "+" to add two numbers; but +to do it correctly you must make sure the right hand inlet gets its value +first. Otherwise, when the left hand side value comes in, "+" will carry out +the addition (since the left hand inlet is the "hot" one) and will add this +value to whatever was previously sitting in the right hand inlet. + +

Problems can arise when a single outlet is connected (either directly or +through arbitrarily long chains of message passing) to different inlets of a +single object. In this case it is indeterminate which order the two inlets will +receive their messages. Suppose for example you wish to use "+" to double a +number. The following is incorrect: + +

+ +

+ +

Here, I connected the left inlet before connecting the right hand one (although +this is not evident in the appearance of the patch.) The "+" thus adds the +new input (at left) to the previous input (at right). + +

The "trigger" object, abbreviated "t", can be used to split out connections +from a single outlet in a determinate order. By convention, all objects in Pd, +when sending messages out more than one outlet, do so from right to left. If +you connect these to inlets of a second object without crossing wires, the +second object will get its leftmost inlet last, which is usually what you +want. Here is how to use "trigger" to disambiguate the previous example: + +

+ +

+ +

"Cold" (non-leftmost) inlets are almost universally used to store single +values (either numbers or symbols.) With the exception of "line" and "line~", +these values are "sticky," i.e., once you set the value it is good until the +next time you set it. (The "line" exception is for sanity's sake.) + +

One more question sometimes comes up in execution order, which is +the order in which two messages are sent to a single "cold" inlet. In this +situation, since the messages are merged, the last value to be received is +the value that is used in the computation. + +

2.3.4. message boxes

+ +Message boxes are text boxes in which you type a message. When the message +box is activated, either by clicking on it or sending something to its inlet, +the message or messages are sent, either to the message box's outlet or +elsewhere as specified. + +

+ +

+ +The first of the message boxes above contains the single number 1.5; this +message has an implicit selector of "float." The second is a list with three +numbers in it, and in the third, the selector is "my" and the two arguments are +the number 5 and the symbol "toes." + +

Multiple messages may be separated by commas as shown: + +

+ +

+Here the three messages are the numbers 1, 2, and 3, and they are sent in +sequence (with no intervening time between them, as with the "trigger" object, +and having depth-first consequences so that whatever chain of actions depending +on "1" takes place before anything depending on "2" and so on.) + +

Semicolons may also separate messages. A message following a semicolon must +specify a symbol giving a destination (in other words, semicolons are like +commas except that they clear the "current destination" +so that the next message specifies a new one). The "current destination" is +at first the message box's own outlet. In the example below, the leading +semicolon immediately redirects messages from the outlet to an object named +"fred" (which is here a receive object), and likewise the next message is sent +to "sue." + + +

+ +

+ +Certain other objects (Pd windows, for example, and arrays) have Pd names and +can be sent messages this way. Also, the special object "pd" is defined to +which you may send messages to start and stop DSP. + +

You can put variables in message boxes as shown below: + +

+ +

+ +Here, "$1", etc., refer to the arguments of the arriving message (and aren't +defined if you send a "bang" message or if you click on the message box to +activate it.) Dollar sign variables are either numbers or symbols depending +on the incoming message; if symbols, you may even use them to specify variable +message selectors or destinations. + +

2.4. audio signals

+ +

+Using Pd you can build audio patches which can synthesize musical sounds, +analyze incoming sounds, process incoming sounds to produce transformed +audio outputs, or integrate audio processing with other media. This section +describes how Pd treats audio signals. + +

2.4.1. sample rate and format

+ +

+Pd's audio signals are internally kept as 32-bit floating point numbers, so +you have all the dynamic range you could want. However, depending on your +hardware, audio I/O is usually limited to 16 or 24 bits. Inputs all appear +between the values of -1 and 1; and output values will be clipped to that range. + +

+Pd assumes a sample rate of 44100 unless you override this in Pd's command line. +Pd doesn't check that this matches the sample rate of audio input or output, +nor does Pd attempt to set your computer's audio sample rate to its own. If +the audio system is running at the wrong sample rate, audio output will +be transposed (you can check this using the "test audio and MIDI" patch; see +the help menu). + +

+Pd can read or write samples to files either in 16-bit or 24-bit fixed point +or in 32-bit floating point, in WAV, AIFF, or AU format, via the soundfiler, +readsf, and writesf objects. + +

2.4.2. tilde objects and audio connections

+ +Audio computations in Pd are carried out by "tilde objects" such as "osc~" +whoswe names conventionally end in a tilde character to warn you what they +are. Tilde objects can intercommunicate via audio connections. When audio +computation is turned on, or when you change the audio network while audio is +on, Pd sorts all the tilde objects into a linear order for running; then this +linear list is run down in blocks of 64 samples each; at 44100 Hz. this means +the audio network runs every 1.45 milliseconds. + +

Inlets or outlets are configured in Pd either for messages or audio; it's +an error to connect an audio outlet to a non-audio inlet or vice versa; usually +these errors are detected at "sort time" when audio is started or the network +changed with audio running. An object's leftmost inlet may accept both audio +and messages; any other inlet is either one or the other. There is no quick +way to tell whether an inlet or output is for audio or messages; consult the +help window for the object. + +

+The audio network, that is, the tilde objects and their interconnections, +must be acyclic. If there are loops, you will see the error message at "sort +time." When errors are reported at sort time there is no easy way to +find the source of the error. You can build algorithms with feedback using +nonlocal signal connections. + +

+Your subpatches can have audio inlets and outlets via the inlet~ and outlet~ +objects. + +

2.4.3. converting audio to and from messages

+ +

If you want to use a control value as a signal, you can use the sig~ object +to convert it. The +~, -~, *~, /~, osc~, and phasor~ objects can be configured +to take control or signal inputs. + +

The other direction, signal to control, requires that you specify at what +moments you want the signal sampled. This is handled by the snapshot~ object, +but you can also sample a signal with tabwrite~ and then get access it via +tabread or tabread4 (note the missing tildes!). There are also analysis +objects, the simplest of which is "env~", the envelope follower. + +

2.4.4. switching and blocking

+ +You can use the switch~ or block~ objects to turn portions of your audio +computation on and off and to control the block size of computation. There +may be only one switch~ or block~ object in any window; it acts on the entire +window and all of its subwindows, which may still have their own nested +switch~/block~ objects. Switch~ and block~ take a block size and an overlap +factor as arguments; so for instance, "block~ 1024 4" specifies 1024 sample +blocks, overlapped by a factor of 4 relative to the parent window. Switch~ +carries a small computational overhead in addition to whatever overhead is +associated with changing the block size. + +

Larger block sizes than 64 should result in small increases in run-time +efficiency. Also, the fft~ and related objects operate on blocks so that +setting the block size also sets the number of FFT channels. You may wish +to use block sizes smaller than 64 to gain finer resolutions of message/audio +interaction, or to reduce "block delay" in feedback algorithms. At the +(untested) extreme, setting the block size to one allows you to write your +own recursive filters. + +

You can use switch~ to budget your DSP computations; for instance you might +want to be able to switch between two synthesis algorithms. Put each algorithm +in its own subpatch (which can have sub-sub patches in turn, for a voice bank +for instance), and switch each one off as you switch the other one on. Beware +of clicks; if you have a line~ controlling output level, give it time to ramp to +zero before you switch it off or it will be stuck at a nonzero value for the +next time it comes back on. + +

When a subpatch is switched off its audio outputs generate zeros; this costs a +fairly small overhead; a cheaper way to get outputs is to use throw~ inside +the switched module and catch~ outside it. + +

2.4.5. nonlocal signal connections

+ +You may wish to pass signals nonlocally, either to get from one window to another, or +to feed a signal back to your algorithm's input. This can be done using +throw~/catch~, send~/receive~, or delwrite~/delread~ pairs. Throw~ and catch~ +implement a summing bus; throw~ adds into the bus and catch~ reads out the +accumulated signal and zeros the bus for the next time around. There can be +many throw~ objects associated with a single catch~, but a throw~ can't talk to +more than one catch~. You can reset the destination of a throw~ if you want to. + +

Send~ just saves a signal which may then be receive~d any number of times; but +a receive~ can only pick up one send~ at a time (but you can switch between +send~s if you want.) + +

Don't try to throw~ and catch~ or send~ and receive~ between windows with +different block sizes. The only re-blocking mechanisms which are well tested +are inlet~ and outlet~. + +

When you send a signal to a point that is earlier in the sorted list of tilde +objects, the signal doesn't get there until the next cycle of DSP computation, +one block later; so your signal will be delayed by one block (1.45 msec by +default.) Delread~ and delwrite~ have this same restriction, but here the 1.45 +msec figure gives the minimum attainable delay. For nonrecursive algorithms, a +simple flanger for example, you might wish to ensure that your delread~ is +sorted after your delwrite~. The only way to ensure this is to create the +delread~ after you created the delwrite~; if things get out of whack, just +delete and re-create the delread~. + +

2.5. scheduling

+ +Pd uses 64-bit floating point numbers to represent time, providing sample +accuracy and essentially never overflowing. Time appears to the user +in milliseconds. + +

2.5.1. audio and messages

+ +Audio and message processing are interleaved in Pd. Audio processing is +scheduled every 64 samples at Pd's sample rate; at 44100 Hz. this gives a +period of 1.45 milliseconds. You may turn DSP computation on and off by +sending the "pd" object the messages "dsp 1" and "dsp 0." + +

In the intervals between, delays might time out or external conditions +might arise (incoming MIDI, mouse clicks, or whatnot). These may cause a +cascade of depth-first message passing; each such message cascade is completely +run out before the next message or DSP tick is computed. Messages are never +passed to objects during a DSP tick; the ticks are atomic and parameter changes +sent to different objects in any given message cascade take effect +simultaneously. + +

In the middle of a message cascade you may schedule another one at a delay +of zero. This delayed cascade happens after the present cascade has finished, +but at the same logical time. + +

2.5.2. computation load

+ +

The Pd scheduler maintains a (user-specified) lead on its computations; +that is, it tries to keep ahead of real time by a small amount in order to be +able to absorb unpredictable, momentary increases in computation time. This +is specified using the "audiobuffer" or "frags" command line flags (see getting Pd to run ). + +

If Pd gets late with respect to real time, gaps (either occasional or +frequent) will appear in both the input and output audio streams. On the +other hand, disk strewaming objects will work correctly, so that you may use +Pd as a batch program with soundfile input and/or output. The "-nogui" +and "-send" startup flags are provided to aid in doing this. + +

Pd's "realtime" computations compete for CPU time with its own GUI, which +runs as a separate process. A flow control mechanism will be provided someday +to prevent this from causing trouble, but it is in any case wise to avoid +having too much drawing going on while Pd is trying to make sound. If a +subwindow is closed, Pd suspends sending the GUI update messages for it; +but not so for miniaturized windows as of version 0.32. You should really +close them when you aren't using them. + +

2.5.3. determinism

+ +All message cascades that are scheduled (via "delay" and +its relatives) to happen before a given audio tick will happen as scheduled +regardless of whether Pd as a whole is running on time; in other words, +calculation is never reordered for any real-time considerations. This is done +in order to make Pd's operation deterministic. + +

If a message cascade is started by an external event, a time tag is given +it. These time tags are guaranteed to be consistent with the times at which +timeouts are scheduled and DSP ticks are computed; i.e., time never decreases. +(However, either Pd or a hardware driver may lie about the physical time an +input arrives; this depends on the operating system.) "Timer" objects which +meaure time intervals measure them in terms of the logical time stamps of the +message cascades, so that timing a "delay" object always gives exactly the +theoretical value. (There is, however, a "realtime" object that measures real +time, with nondeterministic results.) + +

If two message cascades are scheduled for the same logical time, they are +carried out in the order they were scheduled. + +

2.6. semantics

+ +This section describes how objects in Pd are created, how they store data and +how object and other boxes they pass messages among themselves. + +

2.6.1. creation of objects

+ +The text in a box has a different function depending on whether it is a message, +atom (number/symbol), or object box. In message boxes the text specifies the +message or messages it will send as output. In atom boxes the text changes +at run time to show the state of the box, which is either a number or a symbol. + +

In an object box, as in a message box, the text specifies a message; but +here the message is to be passed to Pd itself, once, and the +message's effect is to create the object in question. When you open a file, +all the objects created are created using their text as "creation messages." +If you type a new message into an object box (or change it), the old object is +destroyed and the message is used to create the new one. + +

The selector of the message (the first word in the message) is a selector +which Pd interprets to mean which type of object to create. Any message +arguments (called "creation arguments") are used to parametrize the object +being created. Thus in "makenote 64 250" the selector "makenote" determines +the class of object to create and the creation arguments 64 and 250 become the +initial velocity and duration. + +

2.6.2. persistence of data

+ +Among the design principles of Pd is that patches should be printable, in the +sense that the appearance of a patch should fully determine its functionality. +For this reason, if messages received by an object change its action, since the +changes aren't reflected in the object's appearance, they are not saved as part +of the file which specifies the patch and will be forgotten when the patch is +reloaded. In the same way, if you delete and then recreate an object the +original object's state is not retained but is instead reinitialized (possibly +as specified by creation arguments.) + +

An exception is made for subpatches whose "state" is the configuration of +the subpatch; as a special case, this configuration is restored when the +patch is read from a file. Also, if you rename the subpatch, for instance +typing "pd jane" instead of "pd spot," the contents of the patch are preserved +and only the text in the object box and the window title of the subpatch are +changed. + +

It is probably bad style to specify creation arguments ala "makenote 64 250" +if you are going to override them later; this is confusing to anyone who tries +to understand the patch. + +

2.6.3. message passing

+ +Messages in Pd consist of a selector (a symbol) and zero or more arguments +(which may be symbols or numbers). To pass a message to an object, Pd first +checks the selector against the class of the object. Message boxes all are +of one class and they all take the same incoming messages and dispense them +according to their state, that is, the text typed into the box. The same +holds for atom boxes (number or symbol) except that their state may change +(it consists of the number or symbol showing). + +

Object boxes may have many different classes. The class is usually +determined by the selector of the creation message, i.e., the first atom of the +creation message which is usually a symbol. + +

Each class comes with a fixed collection of messages it may be sent. For +esxample, the "float" or "f" object takes "bang" and "float." These messages +are sent to "float" objects (objects whose class is float) via the leftmost, +hot inlet. (The right inlet is a separate, auxiliary object.) Objects of +class "float" respond to the message "bang" by outputting their current value, +that is, by sending a "float" message to their outlet. They respond to "float" +messages by setting their value and then outputting it. + +

Each other class (like "float") in Pd has its own protocol for responding +to messages it is sent, and may take "float" and "bang" messages, or others +in addition or instead of them. + +

2.6.4. inlets and lists

+ +The leftmost connection point at the top of most objects represents the object +itself. Any other dark rectangle is a separate object called an "inlet" +although in Pd there are 4 individual inlet classes. The class of the inlet +determines which messages it will take: symbol, float, or other; and the inlet +forwards the message either to the object proper or to some proxy, usually +one that the object creates for the occasion. + +

Unless they arrange otherwise by defining a "list" method, objects respond +to the "list" message by distributing the arguments of the message to their +inlets, except for the first argument which is passed as a "float" or +"symbol" message to the object proper. + +

2.6.5. dollar signs

+ +In message or object boxes, message arguments starting with a dollar sign +and a number (like "$1" or "$3-bazoo") are variables which are substituted +with values supplied as part of the environment the message is passed in. +In the case of message boxes, the environment consists of the arguments of +the "list" message (possibly extrapolated from "bang," "float," +or other) that the message box is responding to. Thus, if a message box gets +"23 skidoo" and if it contains the text, "$2 until $1," out comes the message, +"skidoo until 23." + +

Object boxes contain text wwhich forms a message to be sent to Pd to create +and initialize the object. Here, $1, etc., are taken from the context in which +the patch was loaded. When the patch is a new document or opened from a file +the "$" variables are undefined. But if the patch is an abstraction (see the +next section) they are +taked from the abstractions' creation arguments. + +

Constructions such as "$1-x" are expanded by string concatentation. This +is the mechanism for making local variables. In particular, $0 in an abstraction +is a counter which is guaranteed to be unique to that abstraction, so sends and +receives with names like "$0-bear" can be used as local send/receive pairs. + +

2.7. subpatches

+ +Pd offers two mechanisms for making subpatches, called "one-off subpatches" +and "abstractions." In either case the subpatch appears as an object box +in a patch. If you type "pd" or "pd my-name" into an object box, this creates +a one-off subpatch. For instance, in this fragment: + +

+ +the box in the middle, if clicked on, opens the sub-patch shown here: + +

+ +

The contents of the subpatch are saved as part of the parent patch, in +one file. If you make several copies of a subpatch you may change them +individually. + +

The objects, "inlet,", "inlet~," "outlet," and "outlet~,", when put in a +subpatch, create inlets and outlets for the object box containing the subpatch. +This works equally for one-off subpatches and abstractions. The inlet~ and +outlet~ versions create inlets and outlets for audio signals. You can't mix +messages and audio in a subpatch inlet or outlet; they must be one or the other +exclusively. Inlets and outlets appear on the invoking box in the same left-to-right +order as they appear in the subpatch. + +

2.7.1. abstractions

+ +

To make an abstraction, save a patch with a name such as "abstraction1.pd" +and then invoke it as "abstraction1" in an object box: + +

+ +

Here we're invoking a separate file, "abstraction1.pd", which holds the +patch shown here (the border is the same as for the subpatch above): + +

+ +You may create many instances of "abstraction1" or invoke it from several +different patches; and changing the contents of "abstraction1" will affect all +invocations of it as they are created. An analogy from the "c" programming +language is that one-off subpatches are like bracketed blocks of code and +abstractions are like subroutines. + +

Abstractions are instantiated by typing the name of a patch (minus the ".pd" +extension) into an object box. You may also type arguments; for instance if +you have a file "my-abstraction.pd" you may type "my-abstraction 5" to set the +variable $1 to 5. This is defined only for object boxes (not for messages) in +the abstraction. (For message boxes, "$1", etc, have a different meaning as +described above.) If you want to send a message with a $1 in the sense of a +creation argument of an abstraction, you must generate it with an object box +such as "float $1", "symbol $1", or perhaps "pack $1 $2", which may then be +sent to a message box. + +

The corresponding feature in Max (both Opcode and Ircam) was the "#1" +construct. In a Max abstraction, "#1", etc., are replaced by the creation +argument. This has the disadvantage that you can't edit the abstraction as +instantiated in the patch since the "#" variables are substituted. In Pd the +"$" variables in object boxes are spelled literally as "$" variables so that +it's meaningful to edit them from within their calling patch. On the Pd side, +however, there is the disadvantage that it's confusing to have "$" expanded at +a different time in an object box than in a message box. In an object box, the +"$" argument is expanded at creation time, and in a message box, at message +time. + +

2.7.2. Graph-on-parent subpatches

+ +If you open the "properties" dialog for a subpatch or an abstraction, you can +check the "graph on parent" box to have the controls of the subpatch/abstraction +appear on the parent. For instance, here is an invocation of "abstraction2": + +

+ +where the patch "abstraction2.pd" contains: + +

+ +Here, the number box in the abstraction shows up on the box that invoked +the abstraction. The "graph on parent" flag is set in the abstraction +(and is saved as part of the abstraction); to set it, open the "properties" +dialog for the "abstraction2" canvas by right-clicking on any white space +in the patch. + +

To open the subpatch, right click on the object and select "open". (On +Macintoshes without a 2-button mouse, you can double-click in edit mode +instead.) It doesn't work just to click on the object in run mode since clicks +are sent to visible controls and/or arrays. + +

When the sub-patch is closed, all controls in it appear on the object +instead; so the number box in the sub-patch in the example above is the same +one as you see in the box. Only controls are made visible in this way + +

2.8. numeric arrays

+ +Linear arrays of numbers recur throughout the computer musician's bag of tricks, +beginning with the wavetable oscillator. The wavetable oscillator later was +reinvented as the looping sampler. Also, table lookup is used for nonlinear +distortion of audio signals. In the domain of control, arrays of numbers +can specify control mappings, probability densities, voicing data, and much +more. + +

Arrays in Pd should be allocated (and possible read in from a file) before +beginning to make sound, since memory allocation and disk operations may take +long enough to cause audio buffer overruns or underruns. Pd provides two ways +to define new arrays, as "graphs" and "tables". In either case the array +has a pre-defined name and size (i.e., number of points). Elements of the +array are stored as floating-point numbers, 4 bytes apiece + +

If you use an array to store a one-second sound at 44.1 kHz you will need +176 kilobytes, or a one-minute sound, 10.6 megabytes. To store a sound with +two or more channels, use a separate array for each channel. + +

Arrays are also useful as transfer functions, for example for nonlinear +distortion of an audio signal, or to map a control onto a synthesis parameter. +In situations like this one typically uses much shorter arrays, of no more +than a few hundered elements. They are also useful for storing measured +spectra derived from the fft~ objects, and probably for many other uses. + +

Arrays usually appear within subpatches created to house them, whether +in "graph on parent" form (so that you see them within a rectangle drawn on +the containing patch), or as a regular subpatch (which you see as a text box.) +In the "graph on parent" form, an array appears as shown: + +

+ +

Arrays are indexed from 0 to N-1 where N is the number of points in the +array. You can read an array value using the tabread object: + +

+ +Here we see that the third point of the array (index 2) has the value 0.4. +To write into the array you can use the tabwrite object: + +

+ +In this example, sending the message sets the third element to 0.5. (You +may also send the two numbers to the two inlets separately.) + +

The two previous examples showed control operations to read and write from +and to arrays. These may also be done using audio signals. For example, +the patch below creates a 440 Hz. tone with "array1" as a waveform: + +

+ +Here phasor~'s outputs a sawtooth wave, repeating 440 times per second, whose +output range is from 0 to 1. The multiplier and adder adjust the range from +1 to 11, and then the values are used as indices for tabread4~, which is a +4-point interpolating table lookup module. (Much more detail is available in +the audio example patches in the "pure documentation" series.) + +

To create a new array, select "array" from the "put" menu. Up will come +a dialog window to set initial properties of the array. By default, a +new graph is created to hold the array, but it may also be housed in the +most recently created graph instead. Other properties may be specified there +and/or changed later using the "properties" dialog. + +

If you select "properties" on an array in a graph, you two dialogs, one +for the array and one for the graph. The array dialog looks like this: + +

+ +You may use this to change the name and size, in addition to another property, +"save contents". If "save contents" is selected, the array's values are stored +in the containing patch; otherwise they're initialized to zero each time the +patch is reloaded. If you intend to use arrays to store sounds, you will +probably not wish to store them in the patch but as separate soundfiles. This +will be more efficient, and you may also then use a sound editor to modify them +outside Pd. + +

If you check "delete me" and then "OK", the array wil be deleted. This is +an odd interface for deleting an object, and is only provided because Pd +lacks a mechanism for selecting arrays (so that "cut" could serve). + +

The graph dialog (which also pops up) is shown here: + +

+ +

The X bounds initially range from 0 to the number of points in the table +minus one (this is a good choice for arrays, although graphs holding other +kinds of objects might require other X bounds.) The Y bounds should be +chosen to reflect the natural range of the table, so that stored sounds +would naturally range from -1 to 1, but a sequence of frequency values might +range from 0 to 20,000. Finally, you choose the screen size of the graph, +width and height, in screen pixels. + +

Many other operations are defined for arrays; see the related patches +in the tutorial (starting at 2.control/15.array.pd) for more possibliities. + +

2.9. Data structures

+(Note: this section is adapted from an article submitted to ICMC 2002.) + +

The original idea in developing Pd was to make a real-time computer music +performance environment like Max, but somehow to include also a facility for +making computer music scores with user-specifiable graphical representations. +This idea has important precedents in Eric Lindemann's Animal and Bill Buxton's +SSSP. An even earlier class of precedents lies in the rich variety of paper +scores for electronic music before it became practical to offer a +computer-based score editor. In this context, scores by Stockhausen ( +Kontakte and Studie II) and Yuasa (Toward the Midnight Sun) +come most prominently to mind, but also Xenakis's Mycenae-alpha, which, +although it was realized using a computer, was scored on paper and only +afterward laboriously transcribed into the computer. + +

Pd is designed to to offer an extremely unstructured environment for +describing data structures and their graphical appearance. The underlying +idea is to allow the user to display any kind of data he or she wants to, +associating it in any way with the display. To accomplish this Pd introduces +a graphical data structure, somewhat like a data structure out of the C +programming language, but with a facility for attaching shapes and colors to +the data, so that the user can visualize and/or edit it. The data itself can +be edited from scratch or can be imported from files, generated +algorithmically, or derived from analyses of incoming sounds or other data +streams. + +Here is one simple +example of a very short musical sketch realized using Pd: + +

+ +The example, which only lasts a few seconds, is a polyphonic collection of +time-varying noise bands. The graphical ``score" consists of six objects, each +having a small grab point at left, a black shape to show dynamic, and a colored +shape to show changing frequency and bandwidth. The horizontal axis represents +time and the vertical axis, frequency (although, as explained later, this +behavior isn't built into pd). The dynamic and frequency shapes aren't +constrained to be connected or even to be proximate, but since they pertain to +the same sound their horizontal positions line up. In this example the last +(furthest-right) object is percussive (as seen by the black shape) and has a +fixed frequency and bandwidth, whereas the large, articulated shape in the +center has a complicated trajectory in both frequency and dynamic. The color +of the frequency trace determines the voice number used to realize it. + +

Each object is thus composed of a combination of scalar values (color; +aggregate position in X and Y coordinates) and array values (time/value +pairs for the black traces and time/frequency/bandwidth triples for the +colored ones.) This is all specified by the user using Pd's ``template" +mechanism. + +

Here is the template associated with the graphical objects +shown above: + +

+ +Templates consist of a data structure definition (the "struct" object) and +zero or more drawing instructions ("filledpolygon" and "plot"). The "struct" +object gives the template the name, "template-toplevel." The data structure +is defined to contain three floating point numbers named "x", "y", and +"voiceno," and two arrays, one named "pitch" whose elements belong to another +template named "template-pitch," and similarly for the array "amp." + +

In general, data structures are built from four data types: scalar floats +and symbols, arrays (whose elements share another, specified template) and +lists (whose elements may have a variety of templates). The contents of a Pd +window themselves form a list. Pd's correlate of Max's "table" object is +implemented as a top-level array whose elements are scalars containing a single +floating-point number. + +

Data structures in Pd may nest arbitrarily deeply using the array and list +types. For example, a collection of sinusoidal tracks from an analysis engine +could be implemented as an array of arrays of (pitch, amplitude) +pairs; this appears as example 12 in Pd's FFT object online tutorial. + +

After the "struct" object in the template shown above, the remaining +three objects are drawing instructions , first for a rectangle +("filledpolygon"), and then for two arrays. The various graphical +attributes that are specified for drawing instructions may be numerical +constants or data structure field names; in the latter case the value varies +depending on the data. For instance, the second creation argument to +"plot" is the color. The first "plot" plots the "amp" field and the +color is given as 0, or black. The second one plots "pitch" using the color +"voiceno". In this way the color of the second trace is attached to the +"voiceno" slot in the data structure, so that color will vary according to its +"voiceno" slot. + +

2.9.1. Traversal

+ +

Pd objects are provided to traverse lists and arrays, and to address +elements of data structures for getting and setting. Here is a patch showing +how these facilities could be used, for example, to sequence the graphical +score shown above: + +

+ +

Pd has no built-in sequencer, nor even any notion that "x" values should be +used as a time axis. (However, a "sort" function is provided, which reorders +a list from left to right, on the assumption that users might often want to use Pd +data collections as x-ordered sequences.) Recording sequences of events into +lists, and/or playing the lists back as sequences, are functionalities that the +user is expected to supply on top of Pd's offerings, which, it is hoped, would +allow those functionalities within a much larger range of possibilities, to +include random reorderings of events, score following, self-modifying scores, +reactive improvisation, and perhaps much more. + +

Traversal of data is made possible by adding a new type of atom, "pointer", +to the two previously defined types that make up messages, to wit, numbers and +symbols. Unlike numbers and symbols, pointers have no printed form and thus +can't be uttered in message boxes. Traversal objects such as "pointer" and +"get" (among several others) can generate or use pointers. The pointer data +type is also integrated into pipe-fitting objects such as "pack", +"unpack", +and "route". + +

In the patch shown above, the topmost "pointer" object holds a pointer to +the next object to "play" (by sending it to one of the "voice" +abstractions at bottom.) The pointer object takes a "traverse" message to +set it to the head of the list (named "pd-data"), and "next" messages to +move to (and output) the next datum in the list (i.e., the next in the list of +six objects in the score). Another "pointer" object is also used, further +down, as a storage cell for pointers just as "float" is for numbers. + +

The center of any sequencer is always the "delay" object, which must be +fed the time difference between each event (including the non-event of hitting +"start") and the next. As we extract each of the six objects in the score, we +must wait the delay for playing that object, and then send its pointer to one +of the "voice" abstractions to play it. However, we have to inspect the +object itself to know the delay before playing it. So, in the loop, we peel off +the first remaining object to play and inspect the time difference between it +and the previous one, using this value to set the delay, but also storing the +pointer in the lower "pointer" and "pack" objects. + +

The time difference needed to set the delay object is obtained using the +"get template-toplevel x" object. (This is converted to incremental time +("-"), corrected for tempo, and fed to the delay.) Pd provides +the "get" and "set" +objects for reading and writing values from data structures. +The two "get" objects shown here obtain the "x" and "voiceno" fields +of the current object. The template name (template-toplevel) is supplied +to the "get" objects so that they can look up the offset of the necessary +field(s) in advance, for greater run-time efficiency. + +

Once the delay has expired, the object's pointer is recalled (the lower +"pointer" object), and the voice number is recalled. This is packed with +the pointer itself and routed, so that the pointer goes to the appropriate +voice. The voice number is shown as the color of the frequency trace in +"999" units (first digit red, second green, third blue) and the "route" is +arbitrarily set up to select among the six primary and secondary colors plus +black. + +

The details of extracting the pitch and dynamic breakpoints from the arrays +defined in the template are managed in the "voice" abstraction. +The "voice" +abstraction receives a +pointer to a given object and manages the sequencing of the arrays; so it +contains two sequencers itself. The nesting of the overall structure of +the sequencer patch mirrors the nesting of the original data structures. +Finally, the voice abstraction puts its audio output on a summing bus. + +

More general patches can easily be constructed which access heterogeneous lists +of objects (having different templates). In this way, an arbitrarily rich +personal "score language" can be developed and sequenced. + +

2.9.2. Accessing and changing data

+ +

In general, accessing or changing data is done via "pointers" to +"scalars". Numbers and symbols withing scalars are accessed using the +"get" object and changed, in the same way, using "set". Since lists +and arrays are composed of scalars, every actual number or symbol in a data +heap will be a number or symbol element of some scalar. To access them, it +suffices to have objects to chase down elements of lists and arrays (given +either a global name or a pointer to the containing scalar). + +

Lists are traversed in the way shown above; to get to a sublist of a scalar, +the "get" object will provide a pointer, in the same way as it provides +"float" or "symbol" elements of scalars. For arrays, an +"element" object is provided which, given a scalar, a field name and +a number, chases down the numbered, scalar, element of the named array field. + +

To alter "float" or "symbol" elements of scalars is straightforward +using the "set" object, but arrays and lists can't be set by assignment; +there is no suitable data type available withing messages. Lists could +possibly be "settable" by passing pointers to other lists, but permitting this +would have required either automatically doing deep copies of data structures +to carry out the assignments, or else implementing a garbage collecting memory +management system, either of which would be difficult to realize within +real-time computation time constraints. Instead, all the data hanging from a +scalar is considered as belonging to that scalar, and is left in memory until +the scalar is deleted; the data may be changed atom by atom, but primitives +are not provided which would imply unpredictable execution times. + +

The "getsize" and "setsize" objects are provided to access or change +the number of elements in the array. For lists, an "append" object +appends a new scalar for a given template to a list, after the element pointed +to. (To insert a scalar at the beginning of a list, the pointer can be set to +the "head" of the list, a formal location before the first list item.) +Deletion is less flexible; the only operation is to delete an entire list. +(There's no reason not to provide finer-grain deletion mechanisms except that +it's not clear how to protect against stale pointers efficiently, except by +voiding the entire collection of pointers into a list.) + +

2.9.3. Editing

+ +

The graphical score shown above can be edited by dragging breakpoints, or +by adding and deleting them, using mouse clicks. Also, entire objects or +collections of them may be copied, pasted, and dragged around the screen. +Alternatively, there is an editable (or computer generate-able or parse-able) +text representation for the data, which may be seen or changed in a dialog +window or read and written to external text files. + +

Since the graphical presentation of data objects is determined by drawing +instructions, the drawing instructions are interpreted backwards to alter data +as a result of mouse operations. If a given graphical dimension is controlled +by a variable, that variable is then controlled by dragging along that +dimension; if the dimension is constant, it can't be altered by dragging. + +

Tricky situations can arise when the user changes the contents of templates. +A change in drawing instructions can be accommodated by simply tracking +down and redrawing all data objects using the template. However, changing +the "struct" object itself make for less straightforward situations. The +user might wish to reorder fields, delete them, add new ones, or rename them. +When a "struct" object changes, Pd automatically conforms the data from the old +structure to the new one. Fields with the same name as previously are maintained +(reordering them as necessary); and if a field disappears but another of the +same type appears, the new one(s) are taken to be renamings of the old one(s) +in order of appearance. New fields which cannot be matched in this way with +previously existing ones are assumed to be new and are initialized. + +

It can happen that two "struct" objects compete to define the same data +structure, or that the user reads in data from a file which expects a different +version of the structure, or alternatively, that the "struct" object for +existing data objects disappears. For this reasn, Pd maintains a private +representation of the last active version of a "struct" until all +similarly named "structs," as well as all data using that "struct", have +disappeared. If the user introduces a new version of the "struct" and only +later deletes the "current" one, the data is only conformed to the new version +once the old one is deleted. In this way we avoid getting into situations +where data is left hanging without its structure definition, or where data ends +up belonging to two or more structures of the same name. The worst that can +happen is that data may lose their drawing instructions, in which case Pd +supplies a simple default shape. + +

2.9.4. Limitations

+ +

When examples get more complicated and/or dense than the one shown here, it +becomes difficult to see and select specific features of a data collection; +more work is needed to facilitate this. +There should be some facility for turning drawing instructions on and off, or +perhaps for switching between versions of a template, depending on the user's +desired view. There should also be a callback facility in the template for +when an object is edited with the mouse, so that the user can bind actions to +mouse clicks. + +

More generally, the collection of traversal objects that Pd provides is +adequate to support a variety of modes of data collection and use, such as +analysis and sequencing. But the patches required to traverse the data +collections are not always simple. It would be desirable to find a more +straightforward mechanism than that provided by the "pointer", "get" +and "set" objects. + +

The "data" facility, although part of the original plan for Pd, has only +recently been implemented in its current form, and as (hopefully) the user base +grows there will surely be occasions for many further extensions of the data +handling primitives and the graphical presentation and editing functions. + + + diff --git a/pd/doc/1.manual/x3.htm b/pd/doc/1.manual/x3.htm new file mode 100644 index 00000000..18d220a6 --- /dev/null +++ b/pd/doc/1.manual/x3.htm @@ -0,0 +1,854 @@ + + +Pd Documentation 3 + + + +

+ +
+Pd Documentation chapter 3: Getting Pd to run +
+
+ back to table of contents +

+ +Pd runs under Irix, Windows, and Linux. +How to get Pd up and running depends on your operating system, +but the overall strategy is the same. +You must first get and install it, and +then untangle whatever problems arise in handling audio and MIDI input +and output, and finally get Pd to meet its real-time obligations reliably. + +In case of trouble also consult the Pd mailing list archive on + + http://iem.kug.ac.at/mailinglists/pd-list/ +, which often has late-breaking news about configuration problems and solutions. + + +

+You may be interested in getting only audio output or audio input, or +you may need both to run simultaneously. By default, Pd will try to run +both, but if you don't need either input or output, you may find that Pd +runs more reliably, or at least more efficiently, with the unused direction +turned off. This is controlled by Pd's command line flags. + +

+Depending on your application you will have a more or less stringent latency +requirement. Ideally, when any input (audio, MIDI, keyboard, network) is +available, the outputs (in particular the audio output) should react instantly. +In real life, it is necessary to buffer the audio inputs and outputs, trying +always to keep some number of milliseconds ahead of real time to prepare for the +inevitable occasions where the CPU runs off to service some different task +from Pd. How small this latency can be chosen depends on your OS and your +audio driver. + +

+To test audio and MIDI, start Pd and select "test Audio and MIDI" from the +"help" menu. + +

TIP: If Pd starts up but you get distortion or glitches in the audio +output, this could be either because the "audio I/O buffer" isn't big enough, +or else because the CPU load of the patch you're running is too great for the +machine you have, or else because the ADC and DAC are out of sync or even at +different sample rates. To test for the first possibility, try increasing the +"-audiobuf" parameter in the command line (but see also under your OS below.) +For the second, start up your favorite performance monitor program; and for the +third, try starting Pd up with ADCs disabled. + +

Here are instructions for getting and installing Pd for the four +operating systems it runs on: IRIX, MS Windows, Linux, and Max OSX. + +

3.1. IRIX (SGI machines)

+ +

Download Pd, which will be a "tar.Z" file. You can unpack this by +typing "zcat [name].tar.Z | tar xf -" to a shell. This creates a directory +named "pd". + +

+Starting with release 0.25, Pd should come in "n32" and "o32" versions. +"o32" is the default and will run on IRIX 5.x and up. "n32" runs faster, +but only on 6.x and up. Also, "externs" have to be updated for n32. The +"pd" executable (bin/pd in the distribution) is a symbolic link to either +"pd-o32" or "pd-n32." + +

NOTE: "externs" appear to be broken in the N32 version... I'm not sure +how long this has been true. If you want to use external objects, you have +to use the O32 version. + +

+Please note that the path to the Pd executable program can't contain +space characters; don't put it in a directory named "Program Files" +for example. + +

+If for example you put Pd in ~, the executable program +will be ~/pd/bin/pd. The program looks at its command line to +figure out where it is, so it's best to invoke Pd by its full pathname. +You should always invoke Pd from a Unix shell because many important +messages appear on the standard error. + +

+The simplest way to invoke Pd is to +make an alias in your ".cshrc" file (assuming you use the "c" shell) such as: +

+
+    alias pd ~/pd/bin/pd
+
+
+(assuming your Pd distribution landed in ~, for example). + +

+Pd will open the "default" audio input and output devices, without regard +for whether they are in sync or not. This will be bad if they aren't; use +the "-noadc" or "-nodac" flag to disable either the input or output. Pd is +supposed to handle up to 8 channels of audio in and/or out. (But at least +one user had to recompile Pd on his Onyx to get 8 channels working.) + +

+As to MIDI, Pd simply attempts to open all available MIDI devices for input and +output, which is probably very bad on anything more recent than my Indy. If +any MIDI ports fail to open either for input or output, all MIDI is disabled. + +

Pd has not been fixed to request real-time priority from Irix; it will +compete with all other processes on your machine for CPU time. + +

Audio and MIDI in IRIX
+ +

+Pd takes command line arguments to set the number of input and output channels +and the sample rate. These don't affect the SGI's audio settings, which you +have to set separately using the "audio panel." Pd does detect the audio +sample rate if you don't specify one on the command line. + +

+On SGI machines, you have to work to get MIDI running. Before you start Pd, verify +that least one MIDI port is configured open. Pd opens the FIRST MIDI port +that's open. You might want to get rid of the "software" MIDI port if you're +running 6.x. On Indys, the usual practice is to open serial port number 2 +because some systems configure port 1 as "console" by default. You can use the +GUI if you want, or else just type +

+
+    startmidi -d /dev/ttyd2
+
+
+to get port 2 speaking MIDI, and +
+
+    stopmidi
+
+
+to stop it. You can test whether MIDI is configured by typing, +
+
+    ps -dafe | grep midi
+
+
+and looking for "startmidi" processes. +

+It's a good idea to connect your serial port to your MIDI interface before +typing the "startmidi" command, not afterward, at least in 5.x. We use the +Opcode Studio 3 interface but in principle any Mac-compatible one should work. + +

+The O2 apparently has RS232 ports, not RS422. I think SGI's web site says +something about how to deal with this. + +

3.2. Microsoft Windows

+ +

Pd is compiled under NT, but shoould work under any version of Windows +since 95. Pd will appear as a "zip" file. Unzip this, creating a directory +such as \pd. (You can put it wherever you like but the path should have no +spaces in it; so "Program Files" would be a bad place.) + +

+If for example you put Pd in C:\pd, the executable program will be +C:\pd\bin\pd. You can simply adjust your path to include C:\pd\bin and just +invoke "pd" in a command prompt window. You can also make a "command prompt" +shortcut to start Pd. + +

Pd requires "TCP/IP networking" to be turned on. This doesn't mean you +have to be on a real network, but simply that Pd actually consists of two +programs that make a "network link" to intercommunicate. + +

The vanishing window
+ +

Pd is a "command line" program. Most error and diagnostic +messages from Pd appear on the command prompt window Pd runs from. + +

If you start Pd from the "run" menu or as a shortcut, and if there's +a problem with run-time flags (see the Pd command line below), Pd will +print an error and exit. You won't see this error unless you arrange for the +"command prompt" or "msdos" window to stay open after Pd exits. One way +to do this is to make a "batch" file ("run.bat", say) containing the Pd +command line. + +

Audio in Microsoft Windows
+ +

+You can ask for a list of audio and MIDI devices by typing +"pd -listdev"; you can then specify which audio and MIDI device to use. +Type "pd -help" (or make any mistake) to get the syntax for specifying +which device to use. + +

+Most PC sound cards seem to have MIDI built in; you don't seem to have to +do anything special to get Pd to send and receive MIDI. You can list and +choose MIDI devices in the same way as audio. + +

+MIDI timing is very poor if you are using simultaneous audio input and output; +if you suppress either audio input or output things will improve somewhat under +NT; you can apparently get the jitter down to ~40 msec. On W95 performance is +simply terrible. W98, with either audio input or output suppressed, offers +fairly good MIDI timing (~5 msec jitter) but crashes occasionally. + +

Some NT and W98 drivers greet you with a constant trail of "resyncing +audio" messages. Sometimes you can fix this by invoking Pd with the "-noresync" +flag. + +

ASIO
+ +

As of version 0.35 Pd supports ASIO. Invoke Pd as "pd -asio" and, if +needed, specify "-sounddev" (etc.) flags to specify which device (see +"the Pd command line" below.) You can also specify a "-blocksize" different +from the default (256 samples) and "-audiobuf" in milliseconds. Pd will +round this down to a power of two buffers, each of "-blocksize" in sample +frames. + +

Using an RME Hammerfall, and specifying "-audiobuf 5 -blocksize 32" I +was able to get about 7 milliseconds of throughput delay (as measured by +the latency-measurement patch in 7.stuff/tools.) As always, you can specify +"-channels" to any even number up to the maximum (32, I think) or can specify +channel count separately for input and output (-inchannels and -outchannels). + +

The special joys of Windows 95
+ +

+On Windows 95 you can expect a hard time. Every user who tries it seems to +encounter a new problem. The best way to run Pd is to get into the "MSDOS +Prompt" program and type \pb\bin\pd to it (or whatever the path ends up being.) +You can probably put pd's "bin" directory in your path so that you just type +"pd" to the prompt. + +

+You don't want to run Pd from the "run" menu because if it fails to start up +the window holding the error message will disappear instantly. Ditto for +clicking on "batch files" or on the Pd executable itself. + +

+The most common reason Pd might fail to start up in W95 is not having +"networking" turned on. Pd is actually two programs that establish an IP +interconnection. Beware that this sometimes fools Windows into calling your +ISP for no reason. + +

+It is often necessary to specify a huge audio buffer to get steady audio +output in W95; see the command line arguments below. + +

3.3. Linux

+ +

What to do depends on which flavor of Linux you are running (e.g., Debian +or Red Hat). The instructions here should work for Pd 0.33 and up regardless of +your situation, but if you have any trouble just mail msp@ucsd.edu and I'll try +to figure out what's wrong and update the instructions accordingly. + +

Before you start, you might want to check that you have the resources Pd +needs. The main things you need are the C compiler, X windows (including +the X development package for Pd to link against) and TK. If you're running +Redhat or Mandrake 7.x or up, I think these are all present by default. +The RedHat X client developer "RPM" package is called XFree86-devel. + +

You don't absolutely have to have the X server package running; you can run +Pd on the microprocessor in your refrigerator as long as it can connect to an X +server on another machine. + +

If you're running RedHat you might want to use RPM to install Pd. For +other linux distributions, download the "tar.gz" version and compile it. + +

Getting Pd as an RPM
+ +

Download Pd, perhaps from + + http://www.crca.ucsd.edu/~msp/software.html , +to a file such as "pd-0.33-0.i386.rpm". +Open a "shell" window, cd to +the directory containing the file, and type the command, +

+    rpm -i pd-0.33-0.i386.rpm
+
+ +

(substituting the real file name.) Then you should be able to type "pd" +to a shell and watch the Pd main window appear. + +

Getting Pd as a .tar.gz
+ +

+Download Pd, perhaps from + + http://www.crca.ucsd.edu/~msp/software.html , +to file such as "pd-linux-033.tar.gz". Open a "shell" +window, cd to +the directory containing the file, and type the command, +

+    zcat pd-linux-033.tar.gz | tar xf -
+
+which creates a directory named "pd". I do this from my home directory. +Next, compile it. "CD" to pd and read the INSTALL.txt, or else just cd +to "pd/src" and type + +
./configure +
make depend +
make + +

You can pass flags to "configure" to customize your compilation: + +

+    To enable ALSA 0.9x (the latest one), add "--enable-alsa".
+    To enable the older ALSA 0.5x, add "--enable-old-alsa". 
+    To enable Ritsch's RME 9652 driver, add --enable-rme".
+    To put Pd in /usr/bin instead of /usr/local/bin, add "--prefix=/bin".
+
+ +

After "make", just type "~/pd/bin/pd" to run pd. + +

Alternatively, as superuser, you can run "make install" after "make depend" +and then anyone on your system can just type "pd" to run it. + +

TK support trouble
+ +Some people have reported a problem with Pd findind the shared libraries, +"libtcl.so" and "libtk.so". I don't know what causes this, but apparently you +can fix it, as root, by linking /usr/lib/libtcl8.3.so to /usr/lib/libtcl.so and +similarly for tk: + +
+
+# cd /usr/lib
+# ln -s libtk8.3.so libtk.so
+# ln -s libtcl8.3.so libtcl.so
+
+
+ +
Testing audio and MIDI.
+ +

+Next try audio. We want to know whether audio output works, whether audio +input works, and whether they work simultaneously. First run "aumix" to +see audio input and output gains and which device is "recording". +Then test audio output by running +

+    pd -noadc
+
+and selecting "test audio and MIDI" from the "help" menu. You should see a +patch. Turn on the test tone and listen. Do the usual where's-the-signal +business. + +

+Then quit Pd and test audio input via +

+    pd -nodac
+
+Re-open the test patch and hit "meter"; look at the levels. 100 dB is a +hard clip; arrange gains so that the input signal tops out around 80 or 90, +but no higher. + +

Now see if your audio driver can do full duplex by typing "pd" with no +flags. If you see error messages involving /dev/dsp or /dev/dsp2, you're +probably not able to run audio in and out at the same time. If on the other +hand there's no complaint, and if the audio test patch does what you want, you +might wish to experiment with the "-audiobuffer" flag to see what values of +audio latency your audio system can handle. + +

Audio hardware in Linux

+ +

+Be forewarned: installing and testing audio and MIDI drivers in Linux can take +days or weeks. There apears to be no single place where you can get detailed +information on Linux audio. In addition to the information here, you should +see what's posted on Guenter's page, + + + http://gige.epy.co.at/ . + + +

+Depending on your hardware and software, you might or might not be able to +run "full duplex," i.e., use audio input and output at the same time. For +many applications it's important to be able to do this, but if by any chance +you don't need simultaneous input and output you will have much less trouble +than if you do. + +

+There are two widely-used driver sets, called "OSS" and "ALSA". OSS is +included in the standard Linux kernels since version 2.2. However, for some +audio cards you can find newer versions than are included in the kernel +releases. You can get ALSA from + + + http://www.alsa-project.org/ . + +

+(There is also a commercial version of the OSS drivers which costs $30 (slightly +more for certain audio cards.) Hit + + + http://www.opensound.com/ . + +These might be easier to use than the free OSS drivers, but I've never tried +them.) + +

ALSA is able to emulate OSS, so that you can usually run Pd using the +default "OSS" settings even if it's actually ALSA that's running. + +

Installing and configuring FREE OSS
+ +

+OSS is really a collection of loadable device drivers. The commands +for loading and unloading the drivers are "insmod" and "rmmod". +You can see if the audio drivers are +running using "lsmod" (as root.) If you see something like: +

+
+Module         Pages    Used by
+eepro100           3            1 (autoclean)
+opl3               3            0
+opl3sa2            1            0
+ad1848             4    [opl3sa2]       0
+mpu401             5    [opl3sa2]       0
+sound             15    [opl3 opl3sa2 ad1848 mpu401]    0
+soundcore          1    [sound] 6
+soundlow           1    [sound] 0
+aic7xxx           23            2
+
+
+then OSS is running, and if all you see is: +
+
+eepro100           3            1 (autoclean)
+aic7xxx           23            2
+
+
+then it isn't. You can turn OSS off by running "rmmod" repeatedly, starting +with "opl3" (or whatever) so as not to remove any module before you remove +all the modules that depend on it. In the above listing, "opl3*" is device +dependent and you might see different names. + +

+The file, "/etc/modules.conf" apparently controls which sound drivers are +started at boot time. The sndconfig program updates this file but you can +also change things manually, for instance to switch between two different sound +cards. In Redhat 6.x and earlier, the file is named "conf.modules." + +

Here is a modules.conf file for OSS: + +

+
+alias eth0 e100
+alias parport_lowlevel parport_pc
+alias char-major-81 bttv
+alias usb-controller usb-uhci
+alias sound-slot-0 i810_audio
+alias sound-slot-1 es1371
+
+
+ +Here the two sound cards are the (motherboard resident) i810 driver and an +ensoniq es1371. + +

In RedHat at least, the "sndconfig" program tries to automatically search +for your soundcard. Unfortunlately it only finds the "first" one which is +often not the one you want to use! + +

Under OSS, programs can stream sound using either +"block" or "stream" mode. Stream mode is the more modern and better of the +two, but the majority of drivers, even for new sound cards, only +support "block." Pd makes "block" the default. + +

ALSA (Advanced Linux Sound Architecture)
+ +

ALSA is newer, hence less stable and harder to use, than OSS. +Alsa comes in a "finished" version (0.5.x) and a +different, redesigned, "beta" version, 0.9. Installing ALSA can be tricky +and/or confusing. + +

As of version 0.33 Pd works with either 0.5.x or 0.9.x versions. +The RPM version of Pd is compiled for 0.9.x. If you're starting from the +".tar.gz" version, you have to "./configure --enable-alsa" to get it; see +the "INSTALL.txt" file in the installation. + +

By default, Pd uses OSS. If you are running ALSA, Pd will use ALSA's OSS +emulation. To make Pd use ALSA "natively", i.e., the way ALSA is designed +to be used, include the "-alsa" flag in the command line. + +

In ALSA, you can specify which sound card to use using the "-alsadev" +flag. So, for instance, "-alsadev 3" means your third card, counting from +one. You can also specify it the ALSA way: "-alsadev hw:3,0". + +

Which sound card?
+ +

+Here's a rundown on my experiences with sound cards so far. See +also the Pd mailing list archives. + +

opl3sa
+ +This is the old ISA "Yamaha" audio system. It comes on many Dell machines and +seems to offer reasonable consumer quality audio, at least under NT. I +believe the current version of OSS can get full duplex operation out of an +OPL3sa audio system. +This is an ISA ("plug and play" device and you have to deal with I/O +addresses and all that. + +
cs4232
+ +The 1999 vintage dual-processor Dell machines have "cs4232" audio, which I +couldn't get working. + +
es1370 (old Creative PCI128s; Ensoniq AudioPCI)
+ +

+The audio inputs and outputs on my PCI128 aren't clearly labelled and various +documents give them inconsistent names. On my card there are 4 stereo +mini jacks and a joystick port, in this order: + +

+joystick    black            green       red       blue
+            bidirectional    line-out    mic-in    line-in
+
+ +

It used to be possilbe to get quadraphonic audio in and out +of this card, but I haven't tried this in years. + +

Creative SBLive
+ +This seems to work fine either with ALSA or OSS as of Pd version 0.35; earlier +versions of Pd didn't see MIDI input under OSS (the driver's fault, not Pd's, +but I figured out a workaround.) + +
Sonorus Stud I/O
+ +This $1000 card is supposed to do multichannel digital I/O +in Linux, via a beta version of a commercial OSS driver ($40). +I don't know if anyone has used it with Pd. + +
RME 9652 (Hammerfall)
+ +

This is the best sound card out there; it costs around $500 and has 3 ADAT +I/O ports and one SPDIF. There is a "baby hammerfall" also, which I think is +the "9632." DO NOT CONFUSE THE 9652/9632 WITH OTHER RME BOARDS WHICH MIGHT +NOT WORK WITH PD. + +

Guenter Geiger has an OSS driver for Hammerfall for 2.4 kernels (such as +RedHat 7.1 and up). You have to download and compile it: + + + http://gige.xdv.org/pages/rme . + +

You must then run Pd using the "-32bit' flag, because this uses a +non-standard extension of OSS to 32 bit samples. + +

There's an older driver by Winfried Ritsch, invoked using the "-rme" +flag to Pd. This only works on 2.2 kernels, and you probably shouldn't +try it. It will probably be discontinued after Pd version 0.35. + +

Hammerfalls now have an ALSA driver; from what I hear +it won't work yet with Pd. I was unable to install the ALSA driver on the +two machines I tried ("no such device"). + +

MIDIMAN
+ +Midiman sells devices with between 4 and 12 analog channels in and out, for +which there are ALSA drivers. It seems to work fine with the old ALSA driver +(0.5). I'm running mine in Alsa 0.9 beta 10. The driver name is "ice1712". + +

Alsa provides an "envy24control" program (in "utils". You should run +this and check that your ice1712's sync source is internal if you have no +SPDIF input, or "SPDIF" if you do. I think the default is now "internal" +but don't take it for granted... + +

i810/i815
+ +In RedHat 7.0, motherboards with native i810 audio systems don't work in +full duplex (they crash linux). Either run Pd -noadc or else (better) install +ALSA. + +
Yamaha YMF724
+ +The OSS driver for this card appears not to support MIDI. I haven't +tried with ALSA. + +
ES1371
+ +In OSS, audio and MIDI seem both to work fine with this chipset. + +

3.4. Macintosh OSX

+ +Pd version 0.35 supports Macintosh OSX, although there are still various +problems. You can either download Pd with Mac OSX binaries, or just download +the sources and compile it yourself. + +
To install the binary OSX release:
+ +

First download and install TK for OSX +(http://sourceforge.net/projects/tcl/). Get a recent one compiled for +OSX, by chasing through "Mac OS X Tk Snapshots." I got +version 8.4a4-2, in a file named "MacOSXTk8.4a4-2.tar.gz ". Unpacking this +yields three directories: ./Applications/Wish Shell.app, +./Library/Frameworks/Tcl.framework, +and ./Library/Frameworks/Tk.framework. These must be moved, either to: +

+    ~/Applications/Wish Shell.app
+    ~/Library/Frameworks/Tcl.framework
+    ~/Library/Frameworks/Tk.framework
+
+or, if you wish to make them available to other users (or make it possible to +recompile Pd), in /Applications and /Library instead. + +

Then download and unpack the Pd binary distribution for OS X. This will +create a directory with a name like ~/Desktop/pd-0.35-test22. You can move +this elsewhere if you wish (to ~/pd, for example). To a shell window, type +either "~/Desktop/pd-0.35-test22/bin/pd" or, if you moved it as suggested, +"~/pd/bin/pd" . If you wish you can put the line, + +

+    alias pd ~/pd/bin/pd
+
+ +in the file, ~/.tcshrc, so that you can later just type "pd" to a shell. (The +shell only reads the ~/.tcshrc file onstartup, so this won't take effect in +any existing shells unless you specially type +
+    source ~/.tcshrc
+
+to them.) + +

In some cases you have to explicitly give "-soundindev" and "-soundoutdev" +flags for Pd to open audio correctly; "pd -listdev" should show you the +correct device numbers. + +

To get MIDI working, you have to do the Mac OSX magic to get a USB +MIDI interface installed. I've seen this done with Midisport devices and +I think you just download the OSX driver and follow directions. + +

On the machine I tried, it was necessary to type, + +

+    pd -midiindev 1 -midioutdev 2
+
+ +to get MIDI working. At the moment, using a midiman Midisport 2x2, I'm getting +several lines of debugging printout for each incoming MIDI message; it seems to +be the driver printing it out. I don't know how to turn this off. + +

To get Pd running at high priority, so that you'll get fewer skips in the +audio input and output, you must "renice" it. The easiest way to do this is +to make it SETUID and use the "-rt" flag. To do this, become root (you might +have to add a root account to do this) and type: + +

+    chown root ~ferguson/pd/bin/pd
+    chmod 4755 ~ferguson/pd/bin/pd
+
+(assuming your username is "ferguson"). + +
To compile your own Pd in OSX:
+ +Whether you've downloaded the source or the OSX binary distribution you can +always Pd for yourself, whether to make your own improvements, or possibly +so that you can get the newest version before it shows up compiled +for Mac OS X. + +

To be able to compile Pd, you must have installed Tcl/Tk + specifically in +/Applications/Wish Shell.app +and /Library/Frameworks/Tk.framework and /Library/Frameworks/Tcl.framework. + +You must also get the "h" files from XFree86 and put them in +/usr/X11R6/include. You can download just the H files from: +

+    http://www.crca.ucsd.edu/~msp/x.tgz
+
+(the individual files seem to have adequate copyright notices so that +I can just redistribute them.) + +Then, just as for linux, just unload pd-whatever.tar.gz into a directory +such as ~/pd-0.35-test17 , cd to pd-0.35-test17/src, type "./configure" +and "make". + +then type ~/pd-0.35-test17/bin/pd to a shell and enjoy! + + +

3.5. graphics rendering using GEM

+ +

+GEM, originally by Mark Danks but now supported by Iohannes Zmoelnig, is essentially an extension of Pd that allows you to do OpenGL programming +using a suite of "GEM objects" roughly parallel to the tilde objects built +into Pd for audio. Find out more from + Johannes's page. + + +

3.6. The Pd command line

+ +Pd is a "command line" program. The best way to run it is from your +"terminal emulator," "shell," or "MSDOS prompt." The command line is: + +
+
+    pd [options] [patches to open]
+
+
+ +although you may have to specify a path so your command interpreter can find +Pd (OS dependent.) Possible options include: + +
+
+audio configuration flags:
+-r            -- specify sample rate
+-inchannels ...  -- number of audio in channels (by device, like "2" or "16,8")
+-outchannels ... -- number of audio out channels (by device)
+-channels ...    -- specify both input and output channels
+-audiobuf     -- specify size of audio buffer in msec
+-blocksize    -- specify audio I/O block size in sample frames
+-sleepgrain   -- specify number of milliseconds to sleep when idle
+-nodac           -- suppress audio output
+-noadc           -- suppress audio input
+-noaudio         -- suppress audio input and output (-nosound is synonym) 
+-listdev          -- list audio and MIDI devices
+-audioindev ...  -- sound in device list; e.g., "2,1" for second and first
+-audiooutdev ... -- sound out device list, same as above 
+-audiodev ...    -- specify both -audioindev and -audiooutdev together
+
+(linux specific audio:)
+-frags        -- specify number of audio fragments (defeats audiobuf)
+-fragsize     -- specify log of fragment size ('blocksize' is better...)
+-stream          -- use stream mode audio (e.g., for es1370 audio cards)
+-alsa            -- use ALSA audio drivers
+-alsadev      -- ALSA device # (counting from 1) or name: default hw:0,0
+
+MIDI configuration flags:
+-midiindev ...   -- midi in device list; e.g., "1,3" for first and third
+-midioutdev ...  -- midi out device list, same format
+-mididev ...     -- specify -midioutdev and -midiindev together
+-nomidiin        -- suppress MIDI input
+-nomidiout       -- suppress MIDI output
+-nomidi          -- suppress MIDI input and output
+
+general flags:
+-path      -- add to file search path
+-open      -- open file(s) on startup
+-lib       -- load object library(s)
+-font         -- specify default font size in points
+-verbose         -- extra printout on startup and when searching for files
+-d            -- specify debug level
+-noloadbang      -- suppress all loadbangs
+-nogui           -- suppress starting the GUI
+-guicmd "cmd..." -- substitute another GUI program (e.g., rsh)
+-send "msg..."   -- send a message at startup (after patches are loaded)
+-rt or -realtime -- use real-time priority (needs root privilege)
+
+-frags        -- specify number of audio fragments (defeats audiobuf)
+-fragsize     -- specify log of fragment size ('blocksize' is better...)
+-blocksize    -- specify audio I/O block size in sample frames
+-stream          -- use stream mode audio (e.g., for es1370 audio cards)
+-alsa            -- use ALSA audio drivers
+-alsadev      -- ALSA device # (counting from 1) or name: default hw:0,0
+
+(MS Windows specific audio:)
+-resync           -- resynchronize audio (default if more than 2 channels)
+-noresync         -- never resynchronize audio I/O (default for stereo)
+-asio             -- use ASIO audio driver (and not the 'MMIO' default)
+
+MIDI configuration flags:
+-midiindev ...   -- midi in device list; e.g., "1,3" for first and third
+-midioutdev ...  -- midi out device list, same format
+-nomidiin        -- suppress MIDI input
+-nomidiout       -- suppress MIDI output
+-nomidi          -- suppress MIDI input and output
+
+general flags:
+-path      -- add to file search path
+-open      -- open file(s) on startup
+-lib       -- load object library(s)
+-font         -- specify default font size in points
+-verbose         -- extra printout on startup and when searching for files
+-d            -- specify debug level
+-noloadbang      -- suppress all loadbangs
+-nogui           -- suppress starting the GUI
+-guicmd "cmd..." -- substitute another GUI program (e.g., rsh)
+-send "msg..."   -- send a message at startup (after patches are loaded)
+-rt or -realtime -- use real-time priority (needs root privilege)
+
+
+ +Here are some details on some of the audio and MIDI options (but see also the +next section on file management.) + +
sample rate
+ +The sample rate controls Pd's logical sample rate which need not be that of +the audio input and output devices. If Pd's sample rate is wrong, time will +flow at the wrong rate and synthetic sounds will be transposed. If the output +and input devices are running at different rates, Pd will constantly drop frames +to re-sync them, which will sound bad. You can disable input or output if this +is a problem. + +
audio buffer size
+ +You can specify an audio buffer size in milliseconds, typically between 10 and +300, depending on how responsive your OS and drivers are. If this is set too +low there will be audio I/O errors ("data late"). The higher the value is, +on the other hand, the more throughput delay you will hear from the audio +and/or control inputs (MIDI, GUI) and the audio coming out. + +

In Linux and Windows, you can also specify the audio block size in sample +frames (but in Windows, this is only effective when using ASIO). + +

MIDI devices
+ +

You can specify multiple MIDI input and output devices. For example, +"pd -midiindev 3 -midioutdev 4,2" asks for the third MIDI input device and the +fourth and second MIDI output device. The "channel message" midi objects in Pd +such as notein or pgmout will take channels 1-16 to mean the first open MIDI +port, 17-32 the second one, and so on. The midiin, sysexin, midiout objects +give you a separate inlet to specify which of the open MIDI port numbers +you want. + +

In Linux, if you +ask for "pd -midioutdev 1" for instance, you get /dev/midi0 or /dev/midi00 +(or even /dev/midi). "-midioutdev 45" would be /dev/midi44. In NT, device +number 0 is the "MIDI mapper", which is the default MIDI device you selected +from the control panel; counting from one, the device numbers are card +numbers as listed by "pd -listdev." + +

3.7. dealing with files

+ +Pd has a search path feature; you specify the path on the command line +using the "-path" option. Paths may contain any number of files. If you +specify several files in a single "-path" option they're separated by colons +in unix or semicolons in NT. When Pd searches for an abstraction or an +"extern" it uses the path to try to find the necessary file. The "read" +messages to qlists and arrays (aka tables) work the same way. NO SPACES MAY +APPEAR ANYWHERE IN THE SEARCH PATH, e.g., "c:\my nonsense\goobers" won't +work. + +

Filenames in Pd are always separated by (unix-style) forward slashes, even +if you're on Windows (which uses backslashes). This is so that patches can be +ported more easily between operating systems. On the other hand, if you +specify a filename on the command line (as in "pd -path c:\pdlib") the file +separator should agree with the operating system.
+ +

If a filename in a patch has any "/" characters in it, the "path" is not +used; thus, "../sounds/sample1.wav" causes Pd only to look relative to the +directory containing the patch. (You may also invoke externs that way.) + +

As of version 0.35, there may be spaces in the path to Pd itself; also, +the "openpanel" and "savepanel" objects can handle spaces. But still not +the search path. + + + + + diff --git a/pd/doc/1.manual/x4.htm b/pd/doc/1.manual/x4.htm new file mode 100644 index 00000000..5fe5d25d --- /dev/null +++ b/pd/doc/1.manual/x4.htm @@ -0,0 +1,59 @@ + + +Pd Documentation + + + +

+ +
+Pd Documentation chapter 4: writing Pd objects in C +
+
+
back to table of contents
+

+

+ +You can write your own objects that you and others can use in their Pd +applications. You can write them in C or (if you're smart and brave) in C++ or +FORTRAN. + +

HOW EXTERNS ARE LOADED + +

Whenever you type the name of an object +(into an "object" text box) that Pd doesn't yet know about, Pd looks for a +relocatable object file, named, for instance, "profile.pd_irix5". Pd looks +first in the directory containing the patch, then in directories in its +"path." Pd will then add whatever object is defined there to its "class list," +which is the set of all Pd classes you can use. If all this works, Pd then +attempts again to create the object you asked for, this time perhaps +sucessfully. There is no difference between an object defined this way and an +object built into Pd. + +

Once you load a new object into Pd, it's there for the duration of your Pd +session. If you load another Pd document which supplies a different version of +some Pd object, the object won't be updated. IF you're working on a new object +and decide to change it, you have to exit and re-enter Pd to get the change to +take. + +

In the "externs" subdirectory of the documentation you +can find simple examples of "externs" with their source code and test patches; +there are many other on the web (see section 1.2 ). + +

Iohannes Zmoelnig has written an excellent guide to writing externs at + + http://iem.kug.ac.at/pd/externals-HOWTO/ . + +

A paper by Theo Stojanov on the subject is at: + +http://www.music.mcgill.ca/~theo/html/audio/pd_externs.pdf . + +

NT HINT: In NT, Pd is compiled using Visual C 6.0. If you have VC 5.x +your externs won't compile against Pd; you'll get an error about "disk full +or bad DLL." Simply recompile Pd under 5.x and the problem goes away. Externs +compiled under 5.x and 6.x are binary compatible; it's just the compilation +that's sensitive. + + + + diff --git a/pd/doc/1.manual/x5.htm b/pd/doc/1.manual/x5.htm new file mode 100644 index 00000000..2203ebc7 --- /dev/null +++ b/pd/doc/1.manual/x5.htm @@ -0,0 +1,1231 @@ + + +Pd Documentation + + + +

+ +
+Pd Documentation chapter 5. current status +
+

+This section tracks changes in Pd's current implementation. +
+

back to table of contents
+ +

5.1. release notes

+ +

------------------ 0.35 ------------------------------- + +

An experimental new feature called graph-on-parent allows subpatches and abstractions to show +GUI features; so, for instance, you can make an oscillator with a number box to +control the frewuency. This is described in section 2.7.2 of the HTML +documentation and an example is shown in 7.stuff/synth1/. + +

Spaces are allowed in pathnames to Pd and to patches; however, the "path" +variable still can't have spaces. (You can address path directories using +relative pathnames as in "../sound" (or ..\sound on Windows), even if there +are spaces further "up" the path to the patch. See 3.7, "dealing with files." + +

The soundfile reading routine (used in readsf~ and soundfiler) is much +better at opening wav files with different header sizes and odd chunks. +You can now read floating-point "wav" files -- although you can't write them +yet. + +

Templates and data structures are extensively reworked. A "struct" +object replaces "template", so that you specify the name of the structure as +the first argument to "struct" (previously it was derived from the +window name.) You can now have multiple "structs" of the same name; the +oldest one is the "real" one, but if you delete that, the structures are +all conformed to the next-oldest one, and so on. You can alter the contents of +a "struct" and all the associated data will be modified to fit the new +structure definition. Data are persistent, i.e., saved with the containing +patch. You can copy and paste data between patches. If you save data to a file +explicityly, you can read it into another patch and the data are conformed +automatically to the new data structures. + +

A new version of Thomas Musil's GUI objects was merged in. + +

The testtone patch works for up to 6 channels of audio input and output. + +

Lots of improvements got made to audio I/O in general. In NT you may +specify "-asio" to use ASIO drivers; see HTML documentation section 3.2. +You may specify lists of audio input and output devices. In Linux, Pd +will now attempt to open each /dev/dsp* only once, even if it's requested +for reading and writing. + +

The "extra" directory is now searched after the directories in the +search path, not before (so now you can override objects like "fiddle~"). + +

A bug in paf~ is fixed. + +

In Linux, the ".pdrc" is now read before the command line arguments, so +that command line arguments override the .pdrc (it was backwards before.) + +

In Linux, "help" now can invoke either mozilla or netscape to start +up the HTML documentation. This doesn't work in Windows or Mac land yet. + +

In Linux, the "-32bit" flag was added, which you must now use if +running Guenter's OSS RME Hammerfall driver. (This was necessary because +OSS went and used the same "bit" for a different purpose, so taht Pd tried +to open some other cards in 32bit mode inappropriately.) + +

In Linux, MIDI is now opened "-NODELAY" ... this makes the OSS Creative +driver take MIDI input correctly which it didn't before. + +

In MS windows, you can now use "readsf~/writesf~" for spooling sounds to +and from disk. + +

MS Windows bug fixes: -nosound was ignored, and now works. Also, clicking +to open abstractions, when they were already open anyway, used to lose the +keyboard; this should be fixed now. Finally, "netreceive" didn't work when +running "-nogui". This is fixed, and moreover, you should definitely include +a netreceive object in any -nogui patch in MSW, otherwise it eats up all +available CPU time gratuitously. + +

The outlet is removed from the "table" object. + +

In MS Windows, Pd now has "-resync" and "-noresync" flags so that you +can specify how to deal with audio input and output blocksize nonsense in +MMIO. If "resync" is on, whenever the audio input and output seem out +of whack the audio driver resynchronizes all input and output devices; +otherwise the situation is simply ignored. "Noresync" is probably best for +consumer stereo cards (and is the default if you're running only 2 channels in +and out). If you're runnimg more than 2 channels in either direction, the +default is "resync". + +

In soundfiler's read method, if you specify "-maxsize", that implies +"-resize" (as it ought to.) + +

You can use $1-stlye names for arays and tables. + +

Pd will now refuse to make duplicate connections between objects. + +

Pd is (somewhat shakily) running on Macintosh OS/X. See section 3.4 of +the HTML doc. For Macs with one-button mice, you can double-click in edit +mode to simulate a right click. Unfortunately, the "alt" key doesn't work +yet. + +

In Linux, ALSA audio is now fixed to clip, not wrap around, on output +overflows. + +

Various problems were fixed with objects changing size. Number boxes never +wrap to two lines (as they used to), and lines are reconnected appropriately +when objects are resized. + +

A function call is added to retrieve a unique event-dependent number, +so that objects like "buddy" can be written. + +

All the "sound" command-line flags now have "audio" equivalents. + +

The "-listdev" flag now works on Mac and MSW/ASIO. + +

Help file updates for env~, route, and pointer + +

------------------ 0.34.3 ------------------------------- + +

fixed a bug in "udp" netreceive that crashed pd + +

fixed a bug in tabosc4~ that caused gritty sound + +

changed "specfile" for RPM releases (thanks Fernando) + +

adopted Krzysztof's glob_setfilename bug fix + +

bug fixes from "the joy of global variables" thread in Pd list + +

made a help window for "table". + +

------------------ 0.34.2 ------------------------------- + +

fixed ".pdrc" bug + +

added an experimental "pd restart-audio" feature for (new) Alsa + +

------------------ 0.34.1 ------------------------------- + +

Bug fixes: + +

1. Closing a window with objects selected crashed Pd. + +

2. "find" when it opened a window to show the found object crashed Pd. + +

3. (Linux only) Oversized .pdrc files crashed pd... + +

Also, I updated Thomas Musil's IEM GUI objects and their help files. + + +

------------------ 0.34 ------------------------------- + +

NEW FEATURES: + +

I incorporated Thomas Musil's GUI objects (slider, button, etc.) into +the Pd release so Thomas won't have to publish patches to Pd anymore. I +didn't take the graphical inlets and outlets for reasons explained elsewhere, +but Thomas might decide to continue supplying them on a patch basis. + +

Many new examples were added to the "2.control" amd expecially +"3.audio" example patches. A list of differences batween Max/MSP and Pd +now appears at the end of this section. + +

Finally, I fixed Pd to notice window iconification and suspend graphical +updates for iconified windows. + +

Numbering of versions of Pd will now be as in "0.34.2" instead of +"0.34PATCH2" which was confusing. + +

BUGS FIXED: + +

I incorporated Krzysztof Czaja's menuclose bug fix in g_canvas.c. + +

(lunix) the configure script is more rational. + +

the qlist and pack objects were fixed to handle reentrancy correctly. + +

Pd now complains about running out of memory (before it dies.) I intend +to provide advance warning and automatically back out of loading patches that +woudl run out of memory, but that's not in place yet. + +

Typing into a message box sometimes left you with lines from the output +pointing to the wrong location. Fixed. + +

Reading of "wav" and nextstep soundfiles now handles the headers better. + +

------------------ 0.33 ------------------------------- + +

AUDIO AND MIDI: + +

MIDI time jitter is reduced. Theoretically, it could now be +as low as the audio blocksize (and so if you care about MIDI timing, keep your +audio blocksize low.) If you run Pd with audio in stream mode or without +audio at all, and perhaps in some cases in block more too (?), +the controlling parameter for MIDI jitter is "-sleepgrain", which specifies +the interval of time Pd sleeps when it believes it's idle. + +

You can now specify multiple MIDI input and output devices. For example, +"pd -midiindev 3 -midioutdev 4,2" asks for the third MIDI input device and the +fourth and second MIDI output device. The "channel message" midi objects in Pd +such as notein or pgmout will take channels 1-16 to mean the first open MIDI +port, 17-32 the second one, and so on. The midiin, sysexin, midiout objects +give you a separate inlet to specify which of the open MIDI port numbers +you want. + +

(linux only) By default, Pd now reads and write audio in "block mode." +Previously you have to specify "-frags" and/or "-fragsize" to get this. +As of this version you have to specify "-streammode" to get the opposite, +streaming mode. This mode seems only to work with a small number of sound +cards, notably Ensoniq ens1370 and ens1371. + +

(linux only) Also, "-fragsize" is replaced with a more convenient +"-blocksize" which you specify in sample frames. It defaults to 64 which is +Pd's audio computation block size but may be larger or smaller. Typically you +would specify "-audiobuf" and "-blocksize" and Pd will compute "-frags" for +you; but you can also specify "-frags" explicitly. + +

(linux only) OSS and ALSA audio support are improved. You can now talk to +RME9652 using Guenter's OSS driver; this is different from the "-RME" support +which uses Winfried's older driver. Other multichannel OSS drivers might now +work as well. Pd also seems to work with ALSA 0.9 Beta 4; I've tested this +with Midiman Delta 66 and Soundblaster live. I plan to update the linux audio +setup documentation accordingly. + +

NEW FEATURES: + +

I've put in Shahrokh's new expr, expr~, and fexpr~ objects. The latter +allows you to make expressions referring to prior input and output samples in +case you're interested in writing your own recursive filters, oscillators, +or chaotic sound generators... + +

In support of expr, you can now use commas in "object" boxes; they just +become symbols. + +

sqrt~ is fixed so that it apparently has 24-bit accurate mantissas. +It turned out to be easier to just make it accurate than to confront the +question of how a reduced-accuracy version should be named. + +

The bizarre framp~ object which does phase vocoder analysis got a help +window. The phase vocoder example doesn't use framp~ and I had forgotten +what it did until Guenter dug it back up. + +

(linux only) I finally got around to incorporating Guenter's autoconf +stuff, and learned about rpms. Major new linux releases will probably be +in .tar.gz and .rpm formats; "test" releases will probably just be in .tar.gz. +I also fixed it so that the installation prefix is overridden if you invoke +pd by its full pathname, so that you can still use compilations with +installation prefixes before you actually install them. + +

(NT only) I added support for directX using the portaudio package +by Ross Bencina and Phil Burk. I couldn't discover any way this would ever +outperform the old "multimedia" API Pd uses. So the release contains the sources, +but you have to recompile Pd to use directX. Use "makefile.nt.portaudio". Only +1 or 2 channels of audio are supported. THe interesting thing is that the same +code will run on Macintosh. There are a couple of other obstacles to a +MacOS port of Pd though; it's hard to predict when this will be feasible. + +

BUG FIXES: + +

"drawnumber" was broken in 0.32 -- fixed. + +

new arrays in 0.32p6 got ill-fitting graphs -- fixed. + +

------------------ 0.32 PATCH 6 ------------------- + +

Got array and graph dialogs to behave better when there are more +than one. + +

put in mtof~, etc. + +

made Pd search the "extra" directory without having to specify it in "path." + +

bug fix in exporting patches to Max + +

------------------ 0.32 PATCH 5 ------------------- + +

Reversed the order of these release notes so that the newest appear first. + +

Arrays can save their content with containing patch; the properties +dialog selects this. The dialog shows up when you create a new array from +the menu, and allows you to set the name and size. Only floating point arrays +can be created and edited this way. + +

Bug fix: the figures in the NT web doc were garbage. + +

Bug fix: large tables (> 800 pixels and points) no longer crash the GUI. +A related problem remains; large arrays are truncated to either 1000 points +or 1000 pixels. + +

Bug fix: doing "save as" on an instantiated abstraction no longer sets +the window title. + +

in linux, a couple of status messages on opening /dev/dsp only appear now +if Pd is run "-verbose". + + +

+

------------------ 0.32 PATCH 2, 3, 4 ------------------- + +

Hassled more with font size differnces between NT and Linux, and updated +many help files. Minor bug fixes here and there. + +

the table object now takes a second argument to set size in points. + +

Improved underflow protection in some DSP objects. + +

pointer now has a "vnext" traversal method which goes forward to the +next SELECTED object. + +

improvements to throw~ (it now sums) and receive~ fixed to be settable. + +

bug fix in which RME driver always thought sample rate was 44100. + +

+

------------------ 0.32 PATCH 1 ------------------- + +

bug fixes (bugs flagged by mik): vcf~ help window crashed; writesf~ +only wrote 1 channel soundfiles; "table" object didn't open when clicked +on; + +

new object: tabosc4~ -- finally, a real wavetable oscillator for Pd. + +

much work on "data" editing; go to 7.stuff/data-structures, open patches +5 and 7, and try clicking on things. Alt clicks delete or add points; regular +clicks drag values around. The cursor changes to show you what will happen +if you click. + +

+------------------- 0.32 ----------------- + +

New objects: + +

midiin, sysexin, midiout. (I don't think MIDI sysex is working +in Windows yet though.) + +

threshold~ as in Jmax, triggers from audio level. + +

value as in Max and Jmax. + +

writesf as in Jmax. + +

New startup flags: + +

-sleepgrain: if you aren't using audio I/O, this can reduce time jitter in +MIDI I/O. Otherwise, MIDI I/O jitter is limited by the audio buffer size. + +

-noloadbang: cancels loadbangs. + +

-nogui: supress starting the GUI. You can then still talk to Pd using, +perhaps among other possibilities, the new network connection programs now +included in the release. + +

-guicmd: lets you specify the command string Pd calls to start the GUI, +in case you've written your own GUI to replace the TK one Pd comes with. + +

-send: after loading all the patches specified in the command line, +you can specify "startup" messages to send. For example, if you want to use +Pd just to play 50-channel soundfiles from a shell, this is how you can specify +the soundfile name on the command line. + +

bug fixes. + +

A readsf~ problem got fixed. + +

hitting the tab key used to cause Pd windows to relinquish the keyboard. + +

The $0 feature apperas now to work. + +

Inlets and outlets of subpatches sometimes got out of left-to-right order. + +

Scrollbars are less out of whack than they were before. + +

Pd now knows to de-iconify windows if you "vis" them from the parent. + +

in general: + +

In Linux the treatment of MIDI input is now much more efficient. Also, +bugs were fixed in notin and (for SGI) bendin. + +

You can "select all" from the Edit menu. + +

standalone programs "pd-send" and "pd-receive" are provided that can send +mesages to Pd or receive messages from Pd via the netsend~ and netreceive~ +objects. This should allow you to interface a wide variety of other programs +with Pd either on the same machine or over the network. Also you should be +able to hack the code into your own programs to make them interoperate with +Pd and/or each other. The underlying protocol is called FUDI. + +

"Properties" for scalars, graphs, and number boxes: left click on them. +In particular, number boxes can have fixed widths and finite ranges; if you +make them one character wide they act as toggles. Later you'll be able to +configure them as sliders. + +

As to scalars, the properties dialog lets you edit the data in the raw. +Don't try to edit the template though; you can't. + +

You can now type into a "pd" object to change its name without losing the +contents. + +

An experimental "scalar" _text_ object now allows abstractions to draw +primitive control panels on their parents when you invoke them, as if they were +Moog or Buchla modules. See the "7.stuff/data" examples. + +

New help windows for the "data" classes (pointer, append, template, etc.) +and for send/receive which somehow I had neglected. + +

When you hit "copy" with nothing selected, the copy buffer used to be +cleared. This is fixed to do nothing. + +

+------------------- 0.31 ----------------- + +

ALSA support in Linux has been completely overhauled. It now works with +Midiman (up to 10 in/12 out!) and es1370. There are problems with SBLive under +ALSA but it works in OSS emulation with a "-frags" setting. See the "getting +started" documentation. + +

In NT, the default is now "noresync" if you're running stereo. You can +override this with the "-resync" flag. If you're running more than 2 channels +it's the opposite (as it was before.) + +

"symbol" boxes now display symbols and let you type them in. + +

There was a bug when you renamed a patch from outside Pd; the old filename +still showed in the title bar (and there were other bad side effects.) FIxed. + +

Protection was added against patches opening themselves as abstractions. + +

The "route" object's handling of leading symbols was improved. I'm not +sure whether it's Max compatible or not. + +

You can draw into arrays with the mouse, at least in the case where there's +at least one pixel per point. (I'm not sure if the other case even makes +sense.) + +

Abstractions display their "$1", etc., arguments in the window title bar. + +

A "sort" method was added for lists to make them easier to use as +sequencers. + +

The "save as" dialog makes a more reasonable choice of start-up directory. + +

"Trigger i" is now disallowed (it used to crash Pd.) + +

Getbytes and resizebytes now zero out new memory. + +

A memory leak reported by Hannes has been partly, hopefully mostly, fixed. + +

The "signal_free 2" bug reported by Fogar is fixed. + +

New graphs now reliably avoid using already-taken "graph%d" names. + +

The old bug which showed up as ".xxxxxxxxx: no such object" is fixed. + +

The FFT examples have been reworked and the "pique" and "shift" objects +are moved to "extra". + +

+------------------- 0.30 ----------------- +

in Linux, you can get Pd to promote itself to "real time" priority. +A "watchdog" process protects you from having Pd lock your machine up. You +must request real time by running "pd -rt" or "pd -realtime". You must either +be superuser or make Pd a root-owned SETUID program (chown root .../pd/bin/pd; +chmod 4755 .../pd/bin/pd). For security reasons, Pd relinquishes root +privelige immediately after setting its priority, before loading +any patches or externs. + +

Protection was added against message loops. + +

loadbang was fixed so that loadbangs in abstractions go off before loadbangs +in the owner patch. Within each patch, loadbangs go off forst in subpatches. + +

new object: tabplay~, a non-imterpolating sample reader. + +

new objects (in "extra" library): loop~; rev1~. + +

The "toys" library was renamed "extra" and incorporated in the Pd release. + +

In Linux, timeouts were added to the driver opening and closing code +(which used to hang under some conditions.) + +

the "field" object was replaced by "template"; see "data.structures" +examples in 7.stuff. Data lists can be read from and written to files now. + +

You can invoke an external object by pathname, as in "../../extra/loop~". + +

hip~, etc. should no longer get stuck when they get a NAN on input. + +

a bug was fixed in expanding symbols such as "$1-foo". + +

+------------------- 0.29 ----------------- + +

readsf~ - a MAX/FTS style soundfile player, which reads multichannel +soundfiles in wave, aiff, or next formats. The files must be 16 or 24 bit +fixed point or 32 bit floating point (only nextstep headers understand the +latter.) You can also override the header. A "skip" flag lets you read +starting anywhere in the file. (Sorry: linux only for now; I can't find +Posix threads packages for the other platforms.) + +

soundfiler - support for reading and writing soundfiles (wave, aiff, +nextstep) to and from arrays. Multichannel soundfiles can be read into or +written from several arrays at once. When reading you can ask that the tables +be automatically resized; in any event the object obligingly outputs the number +of samples actually read. When writing you can specify a sub-segment of the +arrays, and/or request that the soundfile's maximum amplitude be normalized to +one. + +

tabplay~ - a non-interpolating sample player + +

Garry Kling reports having compiled Pd for "yellowdog" linux on Macintosh +computers. One "fix" has been made to s_linux.c to facilitate this. I don't +have access to a Mac running linux at the moment so I can't verify whether +any particular repease of mine actually works there. + +

Signal objects now automatically convert scalars to vectors, so that you +can just run a number box into a signal input. One caveat is that the binops +"+~", "-~", "*~", "/~", "max~", "min~" run slightly faster if you give them +an argument to tell them that their right inlet will be scalar; so the +construction "+~ 0" is still meaningful. This will get fixed at some later +date... + +

Font sizes work in what I hope will be a more machine-portable way. On +any machine, the point sizes 8, 10, 12, 14, 16, 24 are DEFINED to be the +largest fonts Pd can find that don't exceed their size on my linux machine. +This way I can write patches that everyone else can read, and others will +at least have fewer portability problems than before. The downside is that +your old patches may appear with a different type size than you want; use the +"font" menu item to fix them. + +

The OSS support no longer asks the audio driver whether full duplex +is needed; it just tries to open it. Apparently some drivers (such as +ALSA's OSS emulation) might do full duplex but not implement the call Pd +used to query for it. + +

You can give "-nomidi" as a flag (previously you had to type "-nomidiin +-nomidiout".) + +

A GUI bug reported by Iain Mott was fixed. + +

You can now type symbols such as "$3-poodle" and the "$3" portion gets +expanded properly. Someone was also asking about the FTS-style #0 feature, +but I couldn't figure out how to reconcile it with Pd's usage of "$" for "#" +in abstractions. So I'm still searching for a good way to provide local +symbols. + +

the GUI now protects itself from "\", "{" and "}" characters by dropping +them. I wonder how many NT users have crashed Pd trying to type in filenames +with backslashes... + +

samphold_set and tabwrite_stop methods added. There turned out to be +no help window for samphold~ so one was supplied. + +

+------------------- 0.28 ----------------- + +

Version 0.28 has a primitive in-box text editor... about time! + +

the "front panel" now gives you information on audio levels and +sync errors. + +

Message boxes flash, sort of, when you click them. + +

+Support has been added for RME 9652 soundcards; see the Linux soundcard section of +the documentation. Support files for RME and PCI128 (Ensoniq es1370) cards +are released separately from Pd. + +

The delete and backspace keys clear the current selection. There is +unfortunately no "undo" though; I'm not sure this is a good thing to have +put in. + +

The "until" object has a "float" method which limits the number of bangs +it will output. + +

The audio setup is better documented for NT and Linux. + +

The externs in 4.fft and 6.externs got recompiled and tested. + +

BUG FIX: the "read16" message to tables was broken on NT and is now fixed. + +

BUG FIX: In Linux, starting Pd up sometimes changed the audio mixer +setting. + +

BUG FIX: sending "floats" to inlets expecting lists now works correctly. + +

BUG FIX: "route" on symbols now deals better with symbols, floats and lists. + +

+------------------- 0.27 ----------------- +

+The main new feature is the "find" menu stuff. You can search for boxes +containing specified atoms, including semicolons or commas. Most errors are +now trackable, allowing you to "find last error". Look in the "Find" menu. + +

+New objects written: change, max, max~, min, min~, and swap. + +

+I looked in 0.INTRO.txt in 5.reference, and found that the objects +bag, cputime, realtime, pipe, symbol, poly, and bang were missing. + +

+Five or six bug fixes. + +

+Some audio problems in 0.25 were addresses. In Linux, audio drivers that +don't support the GETISPACE/GETOSPACE ioctl calls can be called using the +(inferior) "-frags/-fragsize" mechanism. If you specify either a "-frags" +or a "-fragsize" option, the GETIOSPACE calls are cancelled. + +

+Under NT, for some audio drivers the 0.26 release gave a constant stream of +"resync" events. I don't know what causes this but I added a "-noresync" +option which simply never resyncs at all. + +

+------------------- 0.26 ----------------- +

+phasor~ and osc~ can be configured to take floating point messages to set +their frequencies, as an alternative to having an input signal to do the +same. Also, +~, etc, can take floating point arguments (and messages) to +add or multiply scalars. THe +~, etc, loops were unrolled to make them +run faster. + +

+A switch~ object is provided to let you switch sub-patches on and off. The +inlet~ and outlet~ objects were re-written to avoid adding any overhead when +moving signals in or out of sub patches. + +

+In Linux at least, the audio latency is much reduced. It's possible to poll +for audio I/O lateness errors by sending "pd audiostatus". + +

+When reading a sample using tabread4~, you can switch between sample tables +using the "set" message. + +

+A new "textfile" object is like qlist but more flexible. + +

+Many help windows got updated (but at least a dozen more need work urgently). + +

+A dsp_addv function was added to allow variable-length DSP calls (for writers +of tilde externs.) + +

+It's possible for a tilde extern to have a name ending in "tilde" now. Name +the setup routine "foo_tilde" for "foo~", etc. + +

+The dac~ object was fixed to clip its output when out of range (before it +wrapped around.) + +

+A first line of protection was added against getting numerical underflow +in delay feedback loops. Before, when a reverberator taled out there was +a sudden jump in CPU usage because the numerical underflows would trap to the +kernel. Now, if any delwrite~ is given a value less than 1e-20 or so, it +records a true zero to avoid this. + +

+Signal division checks for divide by zero. + +

+A "Font bomb" feature is provided for resizing fonts and stretching and +contracting patches to fit. + +

+Pds now bind themselves to the symbol pd- +IN Linux, if Pd is called as root it tries to promote its run-time +priority. You can make pd a setuid root owned program if you want this +behavior for non-root users who start pd. +(Don't make pd-gui setuid though. That would make a security +hole in your system.) + +

+The Pd commend line can take multiple "open" arguments. + +

+The file search path feature was fixed amd generalized. + +

+Alt-clicking a table gives you a dialog to set its x and y range and pixel +size. + +

+------------------- 0.25 ----------------- +

+Lots of minor, under-the-hood improvements and bug fixes... +

+The Netsend/netreceive objects were improved; you can now choose between UDP +and TCP and there's an outlet to tell you whether they're connected. +

+You can now alt click on an object to get its help window (and the help +windows got a fair amount of work.) +

+multichannel audio I/O -- you can get up to 8 audio cnahhelsin and out. +On SGI this is sdone correctly; on NT it's done using sequential "stereo" +devices. I'm not sure of the status of multichannel in linux... +

+The "text" window got new accelerators and a bigger font size +

+there are 3 "tool" patches in 7.stuff: filtering, pvoc, ring mod. +

+In NT, command-line backslashes are converted to forward slashes. +

+There's a load measurement tool in the "help" menu. +

+The SGI version contains an n32 binary (look at the "bin" directory). + +

+------------------- 0.24 --------------- +

+new objects: +
- bang - convert any message to a "bang" +
- qlist - message sequencer +
- textfile - file to message converter +
- makefilename - format a name with a variable field +
- openpanel - "Open" dialog +
- savepanel - "Save as" dialog +

+Bug fixes: +
- Fixed a bug in "const" message to arrays +
- "exp" was broken on NT, now fixed +
- phase vocoder example improved +
- "read" message to arrays now zero out unread samples +
- bug fix in "key" object +
- bug fix in ifft~ (thanks to Peter Lunden) +
- "print" object fixed to distinguish between lists starting with symbols and + other messages +
- polygon, curve, fpolygon, fcurve renamed to fix name clash with Gem +
- improved "new object" placement on screen +
- fixed help dialog to remember previous directory (thanks to Harry Castle) +
- heterogeneous lists +

+ +Arrays can be written to and read from text files or from 16-bit +binary files. See ../2.starter/2G for an overview. +

+ +Guenter Geiger has contributed a Max-style "table" object which +creates an "array" object in a subwindow. +

+ +Guenter has also put in a "search path" feature for externs, abstractions, +etc. +

+ +The Help menu got reworked. +

+ +Select and Route were extended to work Zack-style with symbols. +

+ +"random" takes seeds now (see the "help" window) +

+ +Some more work on graphical lists; you can see the current state in +../7.stuff/data-structures. It's still nascent. + +------------------- 0.23 ------------------- +

+A first cut at the "pure data" feature is now included. See section 6 +of the documentation for a quick introduction to it; see also patches 12 and +14 in the FFT examples. +

+The documentation has been reorganized. The most interesting new features are: +
- some new "tutorial" patches +
- 15 "fft" examples +
- improved help navigation +

+more bug fixes: +
- titles on abstractions no longer saved inside file +
- left-to-right sorting of inlets/outlets now seems to work +
- nt audio setup got confused when driver couldn't do full duplex +
- opening window with audio on is now fixed +
- deleting inlets/outlets deletes connections first (used to crash) +
- 1e20 parsed correctly now +
- osc1~ fixed and optimized +
- resizing arrays with DSP on used to crash; now fixed +
- pasting now adds to the end of the list (used to add to beginning) +
- clicking now selects the most recent object when two or more overlap +
- Pd's "open" and "help" dialogs now maintain separate paths +

+The phasor~ object's "float" method has been REMOVED -- use the right-hand +inlet to set the internal phase. This is so that I can later fix all tilde +objects to convert messages to signals automatically at all signal inputs. + +

+------------------- 0.22 ------------------- +
+bug fixes +
- parsing 1e+006 gave symbol (now float) +
- "." parsed as number, should be symbol +
- change GUI polling loop to TK event dispatch (unix only) +
- improved "tidy up" feature +
- size check added to text boxes (used to crash; still not correct.) +
- occasional bug sending text with CRs to tk +
- binop startup bug +
- key accelerators for creators wrong +
- ftom range to 1500 +
- bug in pack, unpack +
- windows restore bigger than saved +
+
+ +Nt-specific bug fixes: +
- getsockopt for netreceive fails. Just omitted it for NT. +
- put tcl dlls in tcl bin, not pd bin +
--- archive tcl subsystem for easier version updates +
--- fix README accordingly +
- deal with bell sound +
- turn on optimization +
- looked for audio timeout bug but couldn't find it. +

+ +------------------- 0.21 ------------------- + +

+bug fixes: + +

+table size change with DSP on: It used to crash Pd to resize an array +when DSP was turned on. This is now fixed. + +

+deselect all when locking. When you lock a patch the selection is cleared. + +

+unlock when pasting. .. and if you paste into a petch, it's unlocked. + +

+ +lost keyboard events. Version 0.20 lost keyboard events and +forgot window size changes. This should now be fixed. + +
subpatches came up in wrong font size +
dirty flag on window title bar fixed +
improvement to netreceive suggested by Mark Danks +
style notes fleshed out as suggested by Larry Troxler +
fixed Bill Kleinsasser's bug (short and long array in same graph) + +

+new features: + +
phase setting for phasor~ +
fft objects. Also, block~, for specifying block sizes and overlaps for FFTs. +
canvas_makefilename() (used, e.g., by array_read and write) +
"stuff" directory with examples of real Pd applications. + +

+------------------- 0.20 ------------------- + +

+In NT, the 0.19 release turned out not to contain all the files needed to make +TCL run. This problem should now be fixed. + +

+Also, the array_write routine was fixed. + +

+------------------- 0.19 ------------------- + +
+notable new objects: + +
+- vcf~, a bandpass filter with a signal input for center frequency. +
+- delread, delwrite, vd, as in ISPW Max. +
+- various math and midi stuff +
+- catch~, throw~, send~, receive~ for nonlocal signal connections +

+- an experimental facility for array of floats is included. You can make a new +array (from the "put" menu) which will be given a name such as "array1". You +can then send it "read ", "write ", "resize ", and "print" +messages. File reading and writing is in ascii. "resize" changes the size of +the array, and "print" prints its vital signs. You can then use "tabread4~" +to do a 4-point interpolating table lookup, and tabwrite~ to write audio +samples into the table. +

+Numbers now default to floating point, although certain objects like "spigot" +and "metro" still convert their boolean inputs to integers so that 0.5 is +"false." This behavior will probably change later. The "div" and "mod" +objects are introduced for explicit integer division and remainder. +

+Number boxes drag in integer increments, or in hundredths if you hold the +"shift" key down when you click. +

+Pd documents now save their font sizes. The font size is global to an entire +document. New documents come up in the font size Pd was started in (using +the "-font" flag.) If you want to change the font size of an existing +document, use a text editor; the font size is the last argument on the first +line. 8, 10, 12, 14, 16, 18, and 24 are supported. +

+The abbreviations "t," "f," and "i" stand for "trigger,", "float", and "int." +

+Inlets and outlets of subpatches are now sorted correctly; although there is +still a problem deleting inlets/outlets which have connections. +

+The size and screen location of Pd documents is saved correctly. +

+Tilde objects now work in "subpages" although there is no way to send +signals through their inlets and outlets; use throw~/catch~ or send~/receive~. +

+On NT, the default is to open both audio output and input (this used not +to work.) The situation is still shaky; audio seems to hang up sporadically +on my machine; but I seem to have installed my audio driver wrong anyway. +I had to set a huge output FIFO (1/3 sec or so!) to get it to work at all. +You can type "pd -dac", "pd -adc", or "pd -nosound" to get output only, +input only, or no audio at all. +NT's MIDI input and output are supported, but on my machine MIDI output is +flaky. I'm curious how all this will work on other machines... +

+The list of classes is now: +

+ +GENERAL: +field inlet outlet print int float send receive select route pack unpack +trigger spigot moses delay metro line timer makenote stripnote random loadbang +serial get netsend netreceive +

+ +MATH: ++ - * / == != > < >= <= & && | || % +mod div sin cos tan atan atan2 sqrt log exp abs +mtof ftom powtodb rmstodb dbtopow dbtorms +

+ +MIDI: +notein ctlin pgmin bendin touchin polytouchin noteout ctlout pgmout bendout +touchout polytouchout +

+ +SIGNAL: +dac~ adc~ sig~ line~ snapshot~ +~ -~ *~ /~ phasor~ cos~ vcf~ noise~ env~ hip~ +lop~ bp~ biquad~ samphold~ clip~ rsqrt~ sqrt~ wrap~ print~ scope~ tabwrite~ +tabread4~ send~ receive~ catch~ throw~ delwrite~ delread~ vd~ + +

+------------------- 0.18 ------------------- + +
+Release notes now descrie the three platforms Pd runs on: IRIX and +NT (maintained at UCSD) and LINUX, maintained by Guenter Geiger. + +

+menu "close" on a dirty document now checks if you really want to close +without saving (although "quit" will still exit Pd without verification.) + +

+Got rid of "dll" error printout when loading abstractions + +

+------------------- 0.12 - 0.17 ------------------- + +
+got Pd running under NT, although driver problems remain. Gem is also +distributed for both platforms. + +

+------------------- 0.11 ------------------- + +
+Here's a list of all the objects in this release: + +
+general: print int float send receive select pack unpack trigger spigot +
+time handling: delay metro line timer +
+arithmetic: + + - - * * / / == == != != > > < < >= >= <= <= & && | || % +
+midi: notein noteout makenote stripnote +
+other: random get +
+signals: dac~ adc~ sig~ line~ snapshot~ +~ *~ +
+signal oscillators: phasor~ cos~ +
+signal filters: env~ hip~ +
+signal debugging : print~ scope~ +
+
+ +"spigot" replaces "gate" but has the inputs reversed. + +

+------------------- 0.10 ------------------- +
+ +Many bug fixes. This was the first pre-release to be put on the FTP site. + +

+------------------- 0.09 ------------------- + +
set up the "Help" menu +
Bug in DSP sorting fixed +
"Notein" and "noteout" objects +
Comments from the Put menu say "comment" (they were invisible before) +
The scheduler deals better when sound I/O malfunctions + +

+------------------- 0.08 ------------------- + +
metro bug +
scrollbars +
scheduler bug +
text box wraparound at 80 chars. +
fixed boxes to reconnect on retype + +

+------------------- 0.07 ------------------- + +
+- made an adc~ object + +

+------------------- 0.06 ------------------- + +
+- fixed two bugs in DSP sorting +
+- added DSP on/off gui +
+- added lock/unlock and changed the cursor behavior +
+- fixed -font flag to set font pointsize + +

+------------------- 0.05 ------------------- +

+- added scope~, which is just a stopgap until real sound editing comes up. +
+- improved the open panel slightly. +
+- added atoms (int only). +
+- reworked text editing to reside in Pd, not Pd-gui. +
+- included a dbx-debuggable Pd in the distribution. I haven't yet figured + out how to get dbx to work with externs though. + +

+------------------- 0.04 ------------------- +

+fixed "cut" which crashed 0.03 if DSP was running. +added clip~, print~, line~, snapshot~. + + +

+------------------- 0.03 ------------------- +

+"pd dsp 1", "pd dsp 0" messages added. If you edit a patch with DSP on, +PD resorts the DSP network as needed. Unconnected and multiple signal inlets +are allowed. + +

+------------------- 0.02 ------------------- +

+A DSP network mechanism has been added. DSP objects are: +sig~, +~, *~, phasor~, cos~. +

+Loading of externs is provided (although there is no search path mechanism +so the extern has to be in the patch's current directory.) Look in +pd/externs for an example. + +

+ +------------------- 0.01. ------------------- +

+This first release serves mostly to test the "release" mechanism. A Pd +"canvas" object is provided which does both graphing and patch editing. +The editing features apply only to the Max-like part; the graphs have +to be edited into a Pd file via text editor. +

+Four menu items (in the "put" menu) create the four kinds of "patchable" +objects; they can be dragged and connected as in Max; to break a connection, +just click on it (the cursor becomes a turkey to indicate this.) Cut, +paste, and duplicate seem to work, and a "Pd" class offers subwindows. +

+The following max-like objects are included: + + print; + +, *, -, /, ==, !=, >, <, >=, <=, &, |, &&, ||, %; + int, float, pack, unpack, trigger; + delay, metro, timer; + send, receive. +

----------------------------------------- + +

5.2. known bugs

+ +

In the list below, starred items are still things needing attention... + +

*1. Timing of MIDI input/output is very shaky. Audio I/O is primitive, but +there's at least a way to detect errors now for linux and NT. + +

*2. There is no flow control for graphical updates yet; the +real-time process can easily block trying to write too fast to the GUI. + +

3. PD dies if your patch has an infinite loop [fixed in 0.30 release.] + +

*4. If you cut a box which is a "Pd" or abstraction whose subpatch has +items selected, Pd dies. + +

*5. Tables and other drawable items can draw far outside the window; there's +no sanity check, Huge tables (>1000 points) are only partially drawn +(the first 1000 points.) + +

6. There's no way to order force a delread~ to make it read after +a delwrite~ has written. [but see under 3.audio.examples how to do this now.] + +

7. Pd doesn't know to suspend graphics updates when you minimize objects. +Presumably minimization makes things better but it doesn't cut off graphics +computation entirely as it should. [fixed for 0.34] + +

8. If you load a nonexistent extern you get a spurious message, +"consistency check failed: canvas_setargs". [fixed for 0.27 release.] + +

9. Typing backslashes into objects upsets Tk [0.29 should suppress all +backslashes; a real fix might come later.] + +

10. Never type a dollar sign into a comment; you may have trouble +opening your patch afterward... [fixed somewhere around 0.32] + +

*11. You'd better Turn DSP off before you type into a box that currently +holds a "pd" object with tilde objects in the subpatch. + +

*12. In Linux, if you hit control C while Pd is opening MIDI, Pd hangs. + +

*13. In linux, Pd doesn't report audio data-late errors yet. + +

*14. Several objects, notably dac~, adc~, and env~, are incompatible with +uses of block~ or switch~ objects that change block size frmo the default of +64. Using switch~ without reblocking causes no problem. Don't try to +read/write delay lines or use send~/receive~, or throw~/catch~, between +windows with different block sizes. + +

5.3. differences from Max/MSP

+ +

It wasn't anyone's intention to make Pd a Max/MSP clone, but on the +other hand, if there's no reason for a feature to appear differently in +Pd than in Max/MSP, the choices in Pd tend to hew to those in Max/MSP. +Moreover, some effort has been undertaken (but more is needed) to make the +two interoperable. + +

You can use Pd to import and export patches to Max/MSP; just save as +text to a file with extension ".pat", and then open it in Pd. You'll at +least get something. If you stick to common or commonizable features +you can actually develop patches for both platforms. + +

When specific objects exist on one platform and not on the other, it's +often possible to make abstractions to imitate the missing objects, in a +kind of personalized compatibility library. + +

There are, however, differences in semantics you'll want to know about; +a partial list follows. + +

abstraction arguments. +In Pd you can edit instantiations of abstractions and save the result back +to the file of the abstraction. This isn't possible in Max, because the +instantiations are different from the abstraction itself in that "#1", etc., +are replaced by the instantiation arguments. In Pd, these arguments appear +as "$1", etc, and are translated at a slightly later stage of the instantiation +process so that you still see them as "$" variables in the instantiation. + (see Section 2.7. abstractions) + +

In Pd, to make current all instantiations of the +abstraction, either delete and recreate them or close and open the patch; +this is done automatically in Max/MSP. + +

In Pd, if you select "save" while in a subpatch, the parent is saved. In +Max/MSP, if you do this a dialogue box comes up asking if you want to save the +subpatch as a separate file. (if you want to save a subpatch to a file in Pd, +you have to copy and paste the contents to a new document. + +

In Pd, inlets and outlets are ordinary text objects; in Max/MSP they're +"gui" objects from the palette. + +

In Max/MSP, if an object's outlet is connected to several destinations, +corresponding messages are always sent in right-to-left screen order. In +Pd, the messages are sent in the order you made the connections in. In either +case, in situations where you care about the order it's appropriate to use +a "trigger" object to specify. + +

In Pd, there's no "gate"; instead it's "spigot" with the inlets in the +opposite, more natural order. + +

Switching subsets of the DSP patch on and off is done in completely +different ways in Pd and Max/MSP, and block sizes are handled differently as +well. + +

Max offers many "GUI" objects such as sliders, dials, VU meters, piano +keyboards, even "bpatchers." Until version 0.34, the only two in Pd were the +number box and graphical arrays. Starting in version 0.34, Pd incorporates +Thomas Musil's GUI objects: sliders, switches, and so on. (Thanks Thomas!) +Beyond this essential collection of GUI objects, it's unlikely you'll ever find +any commonality between the two. Also, as of 0.34, importing and exporting to +Max doesn't know about the Musil objects; I'll try to get that fixed for 0.35. + +

In Pd there's no "preset" object (I now think it's basically a bad idea) +and you have to use explicit sends and receives to restore values to number +boxes. Then just make a "message" box to re-send the values you want. + +

In Macintosh land, instead of getting tabosc4~ and arrays, you get cycle~ +and buffer~. The only gotcha is that you probably can't draw in buffer~ with +the mouse as you can with arrays, but at least it's possible to +make a patch that copies a "table" into a "buffer~". + +

The "bpatcher" feature in Max has a correlate, "graph on parent" subpatches, +in Pd; however, Pd's version is quite different from Max's. + + + -- cgit v1.2.1