Debian Codegraph @

doc/1.manual/3.installing.configuring.htm

raw
1 <!DOCTYPE html>
2 <HTML lang="en">
3 <HEAD>
4 <meta name="viewport" content="width=device-width, initial-scale=1.0">
5 <TITLE>Pd Manual - Chapter 3: Installing and configuring Pd</TITLE>
6 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
7 <link rel="stylesheet" type="text/css" href="resources/pdmanual.css" media="screen">
8 <link rel="icon" href="resources/favicon.ico">
9 </HEAD>
10 <BODY>
11
12 <div class="nav nav-top">
13 <div class="nav-back"><A href="2.theory.of.operation.htm">&lt; Chapter 2: Theory of operation</A></div>
14 <div class="nav-home"><A href="index.htm#s3">Table of contents</A></div>
15 <div class="nav-forward"><A href="4.externals.htm">Chapter 4: Externals &gt;</A></div>
16 </div>
17 <div id="corpus">
18
19 <IMG id="logo" src="resources/icon.png" ALT="pd icon">
20
21 <H2>Chapter 3: Installing and configuring Pd</H2>
22
23 <P> The following are instructions on how to get Pd installed, configured
24 and running on your machine.</P>
25
26 <P>Pd runs under Microsoft Windows, Linux, and macOS. How to get Pd up and running
27 depends on your operating system, but the overall strategy is the same. You must
28 first get and install it, and then untangle whatever problems arise in handling
29 audio and MIDI input and output, and finally get Pd to meet its real-time obligations
30 reliably.</P>
31
32 <H3> <A href="#s3.1" id="s3.1"> 3.1. Installing Pd </A> </H3>
33
34 <P> Most commonly, you want to install Pd as a 64 bit application, which is available
35 for download, but a 32 bit version is also available for older OSes. The download
36 page for Pd is <A href="https://msp.ucsd.edu/software.html">
37 https://msp.ucsd.edu/software.html</A>. Binaries are provided for Windows and macOS,
38 while Linux users can get Pd from package managers. The source code is also available
39 in this link for you to build Pd yourself.</P>
40
41 <P> Note that Miller's website only offers Pd compiled for single precision, but Pd
42 can also be compiled and run in double precision. An alternative to Miller's website
43 we have <A href="https://puredata.info/downloads/pure-data">
44 https://puredata.info/downloads/pure-data</A> with Pure Data downloads. Note that
45 besides the official single precision application, this link also offers an experimental
46 download for double precision. Note that the double precision application needs externals
47 compiled speacially for it.</P>
48
49 <P> Installation instructions are platform-specific and described in each case in this
50 section, but Instructions on how to build Pd yourself for all supported OSes in both single
51 or double precision is provided in <a href="6.building.from.source.htm">Chapter 6: Building Pd from source</a>.</P>
52
53 <P> Note that you can have different versions of Pd and also Pd compiled for different
54 architectures and float precision in the same machine/OS. The Pd application is named in
55 a way that it distinguishes itslf from other versions in each case. The "regular" Pd is
56 for 64-bit application and single precision. The double precision Pd application is named
57 "Pd64", which can be confusing, meaning that it is for 64-bit architecture, but it means
58 it uses double precision really (whose float size is "64").</P>
59
60 <P> If you run into any installation trouble you can also consult the Pd mailing list
61 archive on <A href="https://lists.puredata.info/listinfo/pd-list">
62 https://lists.puredata.info/listinfo/pd-list</A>, which often has late-breaking
63 news about configuration problems and solutions.</P>
64
65
66 <H4> <A href="#s3.1.1" id="s3.1.1"> 3.1.1. macOS</A> </H4>
67
68 <P>Pd supports macOS from 10.7 and up. There is a version for 10.7 to 10.9 provided,
69 but the main download binary for more modern OS versions supports 10.10 or newer and
70 is the form of a .dmg file. This is a universal binary, for both intel or apple silicon
71 chips. Just double click on this disk image so it opens and you can then drag the Pd app
72 where you want (most likely in the Applications folder). An old 32-bit version is also
73 provided for 10.7 up to 10.14, which is suited if you need to run some old external.</P>
74
75 <P>You might get various warnings about Pd trying to open an internet port.
76 This is normal although some system administrators will prevent you from
77 doing this (in which case you can't run Pd on that machine).</P>
78
79 <H4> <A href="#s3.1.2" id="s3.1.2">3.1.2 Microsoft Windows </A> </H4>
80
81 <P> For Windows, you can download a .zip package for manual install or an executable
82 installer (a ".exe" file). Run the installer if you are not sure how to install
83 manually and select a destination directory when prompted, such as <b>\pd</b> or
84 <b>Program Files\pd</b>. The 64-bit executable works for Windows Vista or newer.
85 An old 32-bit version is also provided and works for XP or later (this is suited
86 if you need to run some old external or use a 32-bit machine).</P>
87
88 <P> If for example you install Pd in <b>C:Program Files\pd</b>, the executable
89 program will be <b>C:Program Files\pd\bin\pd/</b>. You can simply adjust your path
90 to include <b>C:\pd\bin</b> and then invoke "pd" in a command prompt window. You can
91 also make a shortcut to the executable program (left-click on it and drag to the
92 desktop, for example).</P>
93
94 <P> Pd requires "TCP/IP networking" to be turned on. This doesn't mean you
95 have to be on a real network, but simply that Pd actually consists of two
96 programs that make a "network link" (locally) to intercommunicate. The first
97 time you run Pd the "Windows Firewall" will ask your permission to allow this
98 intercommunication.</P>
99
100 <H4> <A href="#s3.1.3" id="s3.1.3">3.1.3. Linux </A> </H4>
101
102 <P> Pd is available via the package systems for some Linux distributions,
103 but not always in the most recent version possible. In case you don't find
104 it or want the very latest recent version, you need to compile Pd, which is
105 described in <a href="6.building.from.source.htm#s6.3">6.3. Building Pd for Linux</a>.</P>
106
107
108 <H3> <A href="#s3.2" id="s3.2"> 3.2. Running Pd via the command line </A> </H3>
109
110 <P>Besides opening Pd by clicking on a user friendly icon as usual, you may
111 open and run Pd as a "command line" program from your "terminal emulator",
112 "shell", or "MS-DOS prompt". In Windows, if Pd is started using a "shortcut"
113 it is also run from a command line which you can edit using the "properties"
114 dialog for the shortcut. In any operating system, Pd can be called from a
115 script (called a <I> batch file </I> on Windows or a <I> shell script </I>
116 on macOS or Unix). The command line is just a line of text, which should be
117 of the form:</P>
118
119 <PRE>
120 pd [startup flags] [patches to open]
121 </PRE>
122
123 <P> Although you may have to specify a path (such as "~/pd/bin/pd" or
124 "C:\program files\pd\bin\pd") so your command interpreter can find
125 Pd.</P>
126
127 <P> The <A href=#s3.4.1>3.4.1. Startup flags</A> subsection describes
128 all options.</P>
129
130
131 <H3> <A href="#s3.3" id="s3.3"> 3.3. Testing and configuring Audio and MIDI </A> </H3>
132
133 <P> To test audio and MIDI, start Pd and select "Test Audio and MIDI..."
134 from the <b>Media menu</b>. You should see a window like this:</P>
135
136 <figure>
137 <IMG src="resources/3.3.1.png" ALT="test audio and midi patch">
138 <figcaption><u>Fig. 3.3.1</u> Test Audio and MIDI patch</figcaption>
139 </figure>
140
141 <P> First, try to get Pd to play a sine wave over your speakers. The
142 "OUTPUT MONITOR" section to the left allows you to set an output gain and
143 a test sound (either noise or a sinusoid). By default, the first eight output
144 channels are turned on so that when you should get output on them when you
145 turn the test sound on. If you have fewer than eight output channels open,
146 the extra channels aren't played; and if you have more, you need to use the
147 radio button to test them. Note that the "AUDIO OUTPUT" toggles must be on
148 (which they are by default) for you to hear anything.</P>
149
150 <P> If there's anything wrong, the most likely outcome is that you will hear
151 nothing at all. This could be for any of at least three reasons: Pd might
152 have failed to open the audio device; the audio card's output volume might
153 be set to zero; or your audio system might not be set to amplify the computer
154 output.</P>
155
156 <P> The "INPUT MONITOR" provides VU Meters and number boxes to indicated the
157 levels of incoming audio, in dB, with 100 being maximum. Incoming signals may
158 clip at RMS levels below 100 (for instance, a sinusoid clips at about 97 dB).
159 Any DC present in the input (such as you get with cheap audio hardware)
160 will show up as level unless you turn on the "input highpass" toggle
161 at right; then the DC component is filtered out before metering. In order
162 to hear and monitor the input you need to set the dB level in the "Input
163 Monitor" number box. Whatch out for feedbacks if you have microphone inputs.</P>
164
165 <P> It is easy to get two copies of Pd running by accident; on most machines
166 only one at a time may be inputting and outputting sound. (Some copy of Pd
167 might have audio or MIDI devices open and prevent the copy you're trying to use
168 from getting access to them). Having extra copies of Pd around will also eat
169 CPU cycles uselessly.</P>
170
171 <P> You may be interested in getting only audio output or audio input, or
172 you may need both to run simultaneously. By default, Pd will try to run
173 both, but if you don't need either input or output, you may find that Pd
174 runs more reliably, or at least more efficiently, with the unused direction
175 turned off. This may be specified using the <a href="3.installing.configuring.htm#s3.3.1">Audio
176 Settings</a> dialog panel or <a href="3.installing.configuring.htm#s3.4.1">Startup flags</a>.</P>
177
178 <P> Depending on your application you will have a more or less stringent latency
179 requirement. Ideally, when any input (audio, MIDI, keyboard, network) is
180 available, the outputs (in particular the audio output) should react instantly.
181 In real life, it is necessary to buffer the audio inputs and outputs, trying
182 always to keep some number of milliseconds ahead of real time to prepare for the
183 inevitable occasions where the CPU runs off to service some different task
184 from Pd. How small this latency can be chosen depends on your OS and your
185 audio driver.</P>
186
187 <P> TIP: If Pd starts up but you get distortion or glitches in the audio
188 output, this could be either because the "audio I/O buffer" isn't big enough
189 or because the CPU load of the patch you're running is too great for the
190 machine you have, or else because the ADC and DAC are out of sync or even at
191 different sample rates. To test for the first possibility, try increasing the
192 delay in "Audio Settings" dialog. For the second, start up your favorite
193 performance monitor program; and for the third, try starting Pd up with ADCs
194 disabled.</P>
195
196 <P> In addition to the "Test Audio and MIDI" patch, the <b>Media menu</b>
197 contains items for controlling audio and MIDI settings. The first two
198 items, "DSP On" and "DSP Off" open or close the audio devices and start or
199 stop Pd's audio computation.</P>
200
201
202 <P> If there is a choice of audio API to make, the <b>Media menu</b> will display
203 them. On Linux, they are OSS, ALSA, Portaudio and JACK; on Windows, you get
204 Portaudio and an 'old MMIO system', where Portaudio offers ASIO and Windows
205 WASAPI. On macOS, the default one is Portaudio and you can also use JACK if you
206 have it installed. The <b>Media menu</b> also displays choices for MIDI API.
207 On Linux, they are OSS-MIDI and ALSA-MIDI.</P>
208
209 <figure>
210 <IMG src="resources/3.3.2.png" ALT="API choices in Windows">
211 <figcaption><u>Fig. 3.3.2</u> API choices in Windows</figcaption>
212 </figure>
213
214 <!--- comment out
215 <H3> Testing audio and MIDI in LINUX. </H3>
216
217 <P> We want to know whether audio input and output works, separately and simultaneously.
218 First run "aumix" (or any newer audio mixer app) to check audio input and output gains
219 and learn which input (mic; line; etc.) is "recording". Then test audio output by
220 running</P>
221
222 <PRE>
223 pd -noadc
224 </PRE>
225
226 <P>Selecting "Test Audio and MIDI" from the <b>Media menu</b> to test then quit Pd and
227 test audio input via</P>
228
229 <PRE>
230 pd -nodac
231 </PRE>
232
233 <P> Now see if your audio driver can do full duplex by typing "pd" with no
234 flags. If you see error messages involving /dev/dsp or /dev/dsp2, you're
235 probably not able to run audio in and out at the same time. If on the other
236 hand there's no complaint, and if the audio test patch does what you want, you
237 might wish to experiment with the "-audiobuffer" flag to see what values of
238 audio latency your audio system can handle.</P>
239
240 <H3> Audio hardware in Linux </H3>
241
242 <P> Installing and testing audio and MIDI drivers in Linux can take
243 days or weeks. There appears to be no single place where you can get detailed
244 information on Linux audio.</P>
245
246 <P> There are two widely-used driver sets, called "OSS" and "ALSA". ALSA is
247 included in the standard Linux kernel since 2.4 or so. However, for some
248 audio cards you can find newer versions than are included in the kernel
249 releases. You can get ALSA from <a href="http://www.alsa-project.org/">
250 http://www.alsa-project.org/</A>.</P>
251
252 <P> ALSA is able to emulate OSS, so that you can usually run Pd using the
253 "OSS" driver settings even if it's actually ALSA that's running.</P>
254
255 <P> By default, Pd uses ALSA. You can ask Pd to use ALSA's OSS emulation by
256 adding the "-oss" flag to the command line or fooling with the "media" menu
257 items.</P>
258
259 <P> You can add ALSA devices by name on the Pd command line:
260 <PRE>
261 pd -alsaadd loupgarou
262 </PRE>
263
264 <p>This instructs Pd to offer the 'loupgarou' audio device in the Audio Settings panel.</p>
265
266
267
268 <H3> Experiences with particular soudcards </H3>
269
270 <P> Here are some of my own experiences with sound cards so far. See
271 also the Pd mailing list archives.</P>
272
273 <H6> RME 9652 (Hammerfall) </H6>
274
275 <P> This is the best PCI sound card out there; it costs around $500 and has 3 ADAT
276 I/O ports and one SPDIF. There is a "baby hammerfall" also, which I think is
277 the "9632". DO NOT CONFUSE THE 9652/9632 WITH OTHER RME BOARDS WHICH MIGHT
278 NOT WORK WITH PD.</P>
279
280 <P> The easiest way to use
281 Hammerfall boards in Pd is via ALSA and jack; but you can use ALSA alone:
282 <PRE>
283 pd -alsa -channels 26
284 </PRE>
285 <p>works for me.</p>
286
287 <H6> MIDIMAN </H6>
288
289 <P>Midiman sells PCI devices (delta 44, 66, 1010, and 1010LT)
290 with between 4 and 10 channels in and out, for
291 which there are ALSA drivers. These are also very good, and they are a
292 bit cheaper than Hammerfalls. The driver name is "ice1712".</P>
293
294 <H6> USB sound devices</H6>
295
296 <P> Ed Kelly reports success with the Lexicon series of USB 1.0 devices (e.g.,
297 the Omega Studio; apparently 4 channels in and 4 out). Also known to work well
298 is the Edirol box (2 channels in and out).</P>
299
300 <P> As of Sept. 2011, the only multi-channel USB device I've been able to use
301 with Pd is the Native Instruments Traktor Audio series. (I have the Audio
302 Traktor 10 which does indeed get 10 discrete channels in and out; the box is
303 designed for turntables and the I/O is all RCA. I haven't yet tested whether
304 the inputs are RIAA equalized or flat. To run this device you'll need to
305 compile and install an ALSA snapshot from at least September 2011. This won't
306 start showing up in Linux distros for at least some months.</P>
307
308 <P> The Alsa developer list is reporting progress on the M-audio Ultra series,
309 which goes up to 6 in and out (analog) with 2 more as SP/DIF. Things work
310 OK for input or output separately but "full duplex" (in and out simultaneously)
311 has sync problems.</P>
312
313 /// end comment out -->
314
315
316
317 <H4> <A href="#s3.3.1" id="s3.3.1">3.3.1. Audio settings </A> </H4>
318
319 <P> The <b>Media menu</b> also provides Audio or MIDI settings for the selected
320 API. Clicking on an API also opens the settings window.</P>
321
322 <figure>
323 <IMG src="resources/3.3.3.png" ALT="Windows audio settings dialog">
324 <figcaption><u>Fig. 3.3.3</u> Windows Audio Settings from the Media menu </figcaption>
325 </figure>
326
327 <P> The exact choices you get depend on the operating system and API.
328 The screenshot above is for when you select 'old MMIO system' in Windows.
329 While the screenshot below is for 'portaudio' on macOS.</P>
330
331 <figure>
332 <IMG src="resources/3.3.4.png" ALT="macOS audio settings dialog">
333 <figcaption><u>Fig. 3.3.4</u> macOS Audio Settings from the Media menu </figcaption>
334 </figure>
335
336 <P> The sample rate controls both audio output and input. The "delay"
337 is the nominal amount of time, in milliseconds, that a sound coming into
338 the audio input will be delayed if it is copied through Pd straight to the
339 output. Naturally you would like this to be as small as possible, but,
340 depending on OS, API, and even the specific choice of audio hardware,
341 there will be a limit to how small you can make this.</P>
342
343 <p> Next you get a choice of input and output device. If you don't
344 need either the input or output device you can uncheck the toggle box
345 to the left (which is on by default). Number of input and output
346 channels is 2 channels by default, but you may specify just one if
347 that's all you need or more if your hardware supports it.</p>
348
349 <p> If you plugged or unplugged audio devices after Pd was started, you
350 can update the device list by pressing the "Rescan Devices" button.</p>
351
352 <figure>
353 <IMG src="resources/3.3.5.png" ALT="Linux audio settings dialog">
354 <figcaption><u>Fig. 3.3.5</u> Linux Audio Settings from the Media menu </figcaption>
355 </figure>
356
357 <p>In Linux you're allowed up to 4 input and 4 output devices (note the
358 "Use Multiple Devices" button on the picture above). On Windows you
359 can also do that but you need to be using the 'old MMIO system' API.
360 On macOS, if you want more than a single device, there's a workaround by
361 creating an aggregate device (via the system's "Audio MIDI Setup") and set
362 it in Pd's Audio settings.</p>
363
364 <H4> <A href="#s3.3.2" id="s3.3.2">3.3.2. MIDI settings </A> </H4>
365
366 <p> There's also a MIDI settings dialog for you to configure one or more MIDI
367 input and output devices. If more than one device is chosen for either input and
368 output, they are registered in different MIDI ports. The "channel message" midi
369 objects in Pd (such as <b>[notein]</b> or
370 <b>[pgmout]</b>) will take channels 1-16. Note, however, that the MIDI
371 port is encoded in the channel number, where channels 1-16 mean the first open
372 MIDI port, 17-32 the second one, and so on. The <b>[midiin]</b>,
373 <b>[midirealtimein]</b> and <b>[sysexin]</b>
374 objects output the port number in their right outlet and <b>[midiout]</b>
375 has a separate inlet to specify which MIDI port you want.</p>
376
377 <figure>
378 <IMG src="resources/3.3.6.png" ALT="MIDI settings">
379 <figcaption><u>Fig. 3.3.6</u> The MIDI Settings dialog from the Media menu on macOS</figcaption>
380 </figure>
381
382
383 <P> System exclusive MIDI message input and output are theoretically supported
384 but does not work uniformly across all operating systems..</P>
385
386 <H3> <A href="#s3.4" id="s3.4"> 3.4. Path and startup</A> </H3>
387
388 <P> In addition to the Audio and MIDI settings shown above, you can customize
389 Pd to instruct it where to find files, what font size to use, and much more.
390 Pd has a main "Preferences" window, which you can select from the <b>Pd
391 menu</b> in macOS or the <b>File menu</b> otherwise. The "Preferences" entry
392 opens a submenu with "Edit Preferences..." and more. By selecting this entry,
393 you open the main preferences dialog with different tabs for: "Path", "Startup",
394 "Audio", "MIDI" and "misc". The Audio and MIDI tabs are actually the same settings
395 windows that you can open via the <b>Media menu</b>, so there's nothing really new
396 but the fact they are also found here. There's one difference though, which is
397 that you can get choices for API this way.</P>
398
399 <figure>
400 <IMG src="resources/3.4.1.png" ALT="preferences dialog">
401 <figcaption><u>Fig. 3.4.1</u> The Audio Settings tab in tabbed Preferences on Windows</figcaption>
402 </figure>
403
404 <P> The above picture shows Audio Settings on Windows when you select it from
405 the tabbed Preferences. The difference here is that you have a new entry to
406 select and change API (where 'old MMIO system' is selected.)</P>
407
408
409 <figure>
410 <IMG src="resources/3.4.2.png" ALT="preferences dialog">
411 <figcaption><u>Fig. 3.4.2</u> The Path dialog in the tabbed Preferences</figcaption>
412 </figure>
413
414 <P>The first preference in the tabbed Preferences is the "Path" dialogs.
415 This tab configures search paths that Pd will use to load externals
416 and abstractions (spaces in the path are allowed by the way). This also used
417 for files in objects that load them like <b>[soundfiler]</b>, <b>[text]</b> and
418 even arrays (aka tables). The path must be correctly set before you load a patch
419 or it may fail to find anything. Filenames in Pd are always separated byc(Unix-style)
420 forward slashes, even if you're on Windows (which uses backslashes). Also, note
421 that objects that can load files do expand "~" to your home directory.</P>
422
423 <P> In a nutshell, Pd searches for files and externals relative to the patch
424 directory and, if it fails, it searches next in the paths that are set in this
425 tab. Note you can use things like "../samples" to point to folders and subfolders
426 that are relative to the patch directory and other search paths. Note you can also
427 use <b>[declare]</b> to add paths for particular patches - this and other details about
428 path management is also covered in depth in <a href="4.externals.htm">Chapter 4: Externals</a>,
429 and summarized in <a href="4.externals.htm#s4.6">4.6. Search order in Pd for objects and files</a>.</P>
430
431 <figure>
432 <IMG src="resources/3.4.3.png" ALT="startup dialog">
433 <figcaption><u>Fig. 3.4.3</u> The startup dialog</figcaption>
434 </figure>
435
436 <P> The "Startup" tab has configurations for initializing Pd and an entry for
437 Startup flags. Most of the configurations in Pd may be changed using the
438 various dialogs you can open from Pd's menus. For instance, you can use the
439 Font entry from the <b>Edit menu</b> to set what font size size Pd will use
440 for its main window (this is described in <a href="2.theory.of.operation.htm#s2.1.1">subsection 2.1.1.</a>,
441 by the way). Nevertheless, this and every other configuration in Pd (from
442 Audio and MIDI settings and whatnot) can also be configurable via startup
443 flags. Other than that, some configurations are too cranky to put in a GUI
444 dialog and must be only set via startup flags.</P>
445
446 <P> Startup flags initialize Pd in many ways, but many configurations can
447 be changed while Pd is running. Some configurations, on the other hand,
448 requires Pd to restart, such as setting which external binaries to load
449 (more about external management in <a href="4.externals.htm">Chapter 4</a>.</P>
450
451 <P> The "defeat real-time scheduling" control, if enabled, makes Pd run
452 without its usual effort to become a real-time process (whatever this means
453 in the operating system you are using.) In Unix, Pd must usually be setuid
454 to allow real-time scheduling at all.</P>
455
456 <P> All of Pd's settings may be saved automatically between Pd sessions.
457 Note the "Save All Preferences" entry in the submenu from "Preferences".
458 It is also possible to save preferences to a file, load from one or forget
459 it all.</P>
460
461 <P> Besides being able to set startup flags in "Preferences -> Startup",
462 you can also invoke Pd via the command line using the same startup flags
463 as arguments. Command line settings, if given, override the corresponding
464 settings that were saved from Pd.</P>
465
466 <H4> <A href="#s3.4.1" id="s3.4.1">3.4.1. Startup flags </A> </H4>
467
468 <P> Here's a list of all startup flags that you can use in the "Startup" tab under
469 "Preferences" or by running Pd from the command line.</P>
470
471 <PRE>
472 audio configuration flags:
473 -r &lt;n&gt; -- specify sample rate
474 -audioindev ... -- audio in devices; e.g., "1,3" for first and third
475 -audiooutdev ... -- audio out devices (same)
476 -audiodev ... -- specify input and output together
477 -audioaddindev -- add an audio input device by name
478 -audioaddoutdev -- add an audio output device by name
479 -audioadddev -- add an audio input and output device by name
480 -inchannels ... -- audio input channels (by device, like "2" or "16,8")
481 -outchannels ... -- number of audio out channels (same)
482 -channels ... -- specify both input and output channels
483 -audiobuf &lt;n&gt; -- specify size of audio buffer in msec
484 -blocksize &lt;n&gt; -- specify audio I/O block size in sample frames
485 -sleepgrain &lt;n&gt; -- specify number of milliseconds to sleep when idle
486 -nodac -- suppress audio output
487 -noadc -- suppress audio input
488 -noaudio -- suppress audio input and output (-nosound is synonym)
489 -callback -- use callbacks if possible
490 -nocallback -- use polling-mode (true by default)
491 -listdev -- list audio and MIDI devices
492 -devicename -- device name for this pd session used by audio and midi APIs
493
494 (Linux specific audio:)
495 -oss -- use ALSA audio drivers
496 -alsa -- use ALSA audio drivers
497 -pa -- use portaudio (experimental version 19)
498 -alsadev &lt;n&gt; -- obsolete: use -audiodev
499 -32bit -- (probably obsolete) -- use 32 bit OSS extension
500 -alsaadd &lt;name&gt; -- add a device to the ALSA device list
501
502 (Windows specific audio:)
503 -mmio -- use MMIO drivers and API
504 -asio -- use ASIO drivers and API
505 -pa -- synonym for -asio
506
507 (Using the JACK API:)
508 -jack -- use JACK audio API
509 -jackname &lt;name&gt; -- a name for your JACK client
510 -nojackconnect -- do not automatically connect pd to the JACK graph
511 -jackconnect -- automatically connect pd to the JACK graph [default]
512
513 MIDI configuration flags:
514 -midiindev ... -- midi in device list; e.g., "1,3" for first and third
515 -midioutdev ... -- midi out device list, same format
516 -mididev ... -- specify -midioutdev and -midiindev together
517 -midiaddindev -- add a MIDI input device by name
518 -midiaddoutdev -- add a MIDI output device by name
519 -midiadddev -- add a MIDI input and output device by name
520 -nomidiin -- suppress MIDI input
521 -nomidiout -- suppress MIDI output
522 -nomidi -- suppress MIDI input and output
523 -ossmidi -- use OSS midi API (Linux only)
524 -alsamidi -- use ALSA midi API (Linux only)
525
526 other flags:
527 -path &lt;path&gt; -- add to file search path
528 -nostdpath -- don't search standard ("extra") directory
529 -stdpath -- search standard directory (true by default)
530 -helppath &lt;path&gt; -- add to help file search path
531 -open &lt;file&gt; -- open file(s) on startup
532 -open-with-args &lt;file&gt; &lt;args&gt; -- open file(s) on startup with arguments
533 -lib &lt;file&gt; -- load object library(s) (omit file extensions)
534 -font-size &lt;n&gt; -- specify default font size in points
535 -font-face &lt;name&gt; -- specify default font
536 -font-weight &lt;name&gt; -- specify default font weight (normal or bold)
537 -verbose -- extra printout on startup and when searching for files
538 -noverbose -- no extra printout
539 -version -- don't run Pd; just print out which version it is
540 -d &lt;n&gt; -- specify debug level for inspecting the GUI communication
541 -loadbang -- do not suppress all loadbangs (true by default)
542 -noloadbang -- suppress all loadbangs
543 -stderr -- send printout to standard error instead of GUI
544 -nostderr -- send printout to GUI (true by default)
545 -gui -- start GUI (true by default)
546 -nogui -- suppress starting the GUI
547 -guiport &lt;n&gt; -- connect to pre-existing GUI over port &lt;n&gt;
548 -guicmd "cmd..." -- start alternative GUI program (e.g., remote via ssh)
549 -send "msg..." -- send a message at startup, after patches are loaded
550 -prefs -- load preferences on startup (true by default)
551 -noprefs -- suppress loading preferences on startup
552 -prefsfile &lt;file&gt; -- load preferences from a file
553 -rt or -realtime -- use real-time priority
554 -nrt -- don't use real-time priority
555 -sleep -- sleep when idle, don't spin (true by default)
556 -nosleep -- spin, don't sleep (may lower latency on multi-CPUs)
557 -schedlib &lt;file&gt; -- plug in external scheduler (omit file extensions)
558 -extraflags &lt;s&gt; -- string argument to send schedlib
559 -batch -- run off-line as a batch process
560 -nobatch -- run interactively (true by default)
561 -autopatch -- enable auto-patching to new objects (true by default)
562 -noautopatch -- defeat auto-patching
563 -compatibility &lt;f&gt; -- set back-compatibility to version &lt;f&gt;
564
565 </PRE>
566
567 <P>See next details on a few of the group of flag items.</P>
568
569
570 <H5> <A href="#s3.4.1.1" id="s3.4.1.1"> 3.4.1.1. Font flags</A> </H5>
571
572
573 <P> The flags offer more font configurations than just "size". Note that macOS has,
574 by default, a "normal" font weight, while in Linux and Windows you have "<b>bold</b>"
575 by default. Use "-font-weight" to change that if you don't like your default setting.</P>
576
577 <H5> <A href="#s3.4.1.2" id="s3.4.1.2"> 3.4.1.2. Path flag</A> </H5>
578
579 <P> Paths may contain any number of entries if separated by colons in Unix or
580 semicolons in Windows. Filenames in Pd are always separated by (Unix-style)
581 forward slashes, even if you're on Windows (which uses backslashes). This is
582 so that patches can be ported more easily between operating systems. On the
583 other hand, if you specify a filename on the command line (as in "pd -path
584 c:\pdlib") the file separator should agree with the operating system.</P>
585
586 <H5> <A href="#s3.4.1.3" id="s3.4.1.3"> 3.4.1.3. Flags for Audio and MIDI multiple devices and sleepgrain</A> </H5>
587
588 <P> You can specify multiple MIDI input and output devices via flags. For example,
589 "pd -midiindev 3 -midioutdev 4,2" asks for the third MIDI input device and the
590 second and fourth MIDI output device.</P>
591
592 <P> In Linux, if you ask for "pd -midioutdev 1" for instance, you get /dev/midi0
593 or /dev/midi00 (or even /dev/midi). "-midioutdev 45" would be /dev/midi44. In
594 Windows, device number 0 is the "MIDI mapper", which is the default MIDI device
595 you selected from the control panel; counting from one, the device numbers are
596 card numbers as listed by "pd -listdev".</P>
597
598 <P> The "sleepgrain" controls how long (in milliseconds) Pd sleeps between
599 periods of computation. This is normally the audio buffer divided by 4, but
600 no less than 0.1 and no more than 5. On most OSes, ingoing and outgoing MIDI
601 is quantized to this value, so if you care about MIDI timing, reduce this to 1
602 or less.</P>
603
604 <P> Multiple audio device selection is similar, except that you can also specify
605 channels by device: "-audioindev 1,3 -inchannels 2,8" will try to open device 1
606 (2 channels) and device 3 (8 channels). Note that multiple audio device selection
607 is only possible for Linux and Windows, as noted earlier.</P>
608
609 <H5> <A href="#s3.4.1.4" id="s3.4.1.4"> 3.4.1.4. Sample rate flag</A> </H5>
610
611 <P>The sample rate controls Pd's logical sample rate which need not be that of
612 the audio input and output devices. If Pd's sample rate is wrong, time will
613 flow at the wrong rate and synthetic sounds will be transposed. If the output
614 and input devices are running at different rates, Pd will constantly drop frames
615 to re-sync them, which will sound bad. You can disable input or output if this
616 is a problem.</P>
617
618 <H5> <A href="#s3.4.1.5" id="s3.4.1.5"> 3.4.1.5. Audio buffer size and block size flags</A> </H5>
619
620 <P>You can specify an audio buffer size in milliseconds, typically between 10 and
621 300, depending on how responsive your OS and drivers are. If this is set too
622 low there will be audio I/O errors ("data late"). The higher the value is,
623 on the other hand, the more throughput delay you will hear from the audio
624 and/or control inputs (MIDI, GUI) and the audio coming out.</P>
625
626 <P> You can also specify the audio block size in sample frames. This is 64 by
627 default (except for MMIO for which it's 256), and may be 64, 128, or 256.</P>
628
629
630 </div>
631 <div class="nav nav-bottom">
632 <div class="nav-back"><A href="2.theory.of.operation.htm">&lt; Chapter 2: Theory of operation</A></div>
633 <div class="nav-home"><A href="index.htm#s3">Table of contents</A></div>
634 <div class="nav-forward"><A href="4.externals.htm">Chapter 4: Externals &gt;</A></div>
635 </div>
636 </BODY>
637 </HTML>
638
639
640
641 <!--- comment out
642 <P> In windows, you can Invoke Pd with flags to specify which one to use; either
643 "pd -asio" or "pd -mmio". See details on how to use command line flags in
644 <A href=#s4> Preferences and startup options </A>. Other setting canYou can also specify</P>
645
646 If
647 needed, also specify "-audiodev" and other flags to specify which device. You can
648 also set a "-blocksize" different from the default (256 samples) and "-audiobuf" in
649 milliseconds. Pd will round this down to a power of two buffers, each of "-blocksize"
650 in sample frames.
651
652 <P> TIP: You can use your built-in sound-card with the Universal ASIO Driver For
653 WDM <a href="http://www.asio4all.org/"> http://www.asio4all.org/</a></P>
654
655 /// end comment out -->