Personal tools
You are here: Home documentation FAQ for Pd
Document Actions

FAQ for Pd

View entire FAQ in full Up to Table of Contents

Using Objects

How do I get more accurate timing from metro?

If you run pd -noaudio, you will find that the timer error becomes much less, but of course then Pd will not generate audio. There is a discussion on lowering latency in the release notes for version 0.33 that may be helpful. Try reducing the block size, the sleep grain, or try running in stream mode.

How do I accumulate (or sum) audio outlets of several modules without so many connections?

Use [throw~] and [catch~].

See the help patches for those objects.

How do I make a local array?

Give your array a name which includes $0.

How do I make a local variable?

All variable names in Pd are global. There is only one name space for all patches.

The way to hack around this is to use $0 in variable names. For example, $0-foo.

$0 expands to a unique number for each abstraction - but not for each subpatch!

If you need to share a variable name between two abstractions, but no others, you could pass a "group identifier" into each of those abstractions and then use $n in variable names where n is the argument number of the group identifier. For example, "$1-foo". Variable names with $n in them work well with send and receive, but it is difficult (if not impossible) to get them into qlists.

This solution is discussed in the documentation.

How do I record and playback from hard disk?

Use [writesf~] and [readsf~].

For shorter samples you might also want to write to/from your table using [soundfiler]

What is the difference between the [list] and [pack] objects?

What is the difference between the [list] and [pack] objects? Which is the best to use if I want to generate a [X Y( message ?

  • [pack] creates a compound list from input atoms of a preset type (symbol float or pointer).
  • [list] creates (appends) a compound list from two input lists (these could be a floats or symbols because [list] will a convert these input elements to lists automatically).
  • [list] itself is not really an object but a wrapper for [list append], the list family is made up of ![list append], [list prepend], [list split], [list trim] and [list length]

So, for two input floats there is no matter which to use?

If you are using floats it is best practice to use [pack], as it has type recognition and will output errors if a foreign type tries to get calculated. And of course [pack] can handle more than two inputs..

What is the difference between the [pd] and [page] objects?

Actually, the differences are:

  1. When changing the name of a [page], its contents self-destruct.
  2. UNDO doesn't work in that case.
  3. changing back to the original name doesn't either...
  4. therefore, [page] sucks.
  5. notwithstanding the aforementioned issues, [page] would be better if only for its quite descriptive name. The name [pd], imho, doesn't do any help and is confusing with other uses of "pd" that are completely different (the global object pd; the program pd itself; ...).
