New Objects


Float

Similar to the [int] object, which stores integer numbers, the [float] object can store and output any given float number.

pd-2-01


Send and receive

The following example demonstrates the use of the [send] and [receive] objects. They can replace patch cords and transmit the messages wirelessly. Every message you can send via a patch cord can also be transmitted via send and receive. The example:

pd-2-02

You need the same argument (name) for the send and receive object.


clip

[clip] constrains the input to a certain range. E.g., [clip 0 9] clips everything above 9 and below 0. The output always stays in the specified range.

pd-2-30

 


Random

Another object you might use a lot is the [random] object. The random object puts out a random number:

pd-2-04

All of those random objects put out a random number within the range between 0 and 1 less than the argument specified.


Compare & other relational operators.

The compare object [==] compares two numbers and outputs 1 if they are equal and a 0 if they are not. Also, there is a whole collection of similar objects like [<] (less than),[<=] (less than or equal to)  [>] (greater than), [>=] (greater than or equal to) and [!=] (not equal). Some examples:

pd-2-32


Modulo

The % (modulo) divides two numbers and outputs their reminders.

pd-2-31

 


Prepend and append

Sometimes we want to add something to a message we send. We can add something to a message using the [list prepend] and [list append] objects. The list prepend object is used to add something at the beginning of an object, the list append object to add something at the end. Unfortunately,  both objects also add the word list to all messages. We remove this word with the [list trim] object.

pd-2-03

 


Spigot

[spigot] is like a door that can be opened and closed so that messages can or can not pass. The right inlet is used to specify whether and where the message should go through… Afterwards, the message is send in the left inlet. An example:

pd-2-07


Pack & Unpack

[pack] can combine numbers and symbols. There is also [unpack] which does exactly the opposite.

The examples:

pd-2-35


Route

Route is used to pass the input out a specific outlet. It looks at the first part of an message and tries to match it to its own arguments. If it finds a match, it sends the following part (without the matching argument) of the message out of the corresponding outlet. In short, route routes.

pd-2-08


Table

The table is mainly used to store and graphically edit an array of numbers. You can draw the numbers into the array. If you want to retrieve the numbers you have to use [tabread]. In order to put in numbers without drawing, you can use [tabwrite]. You can also resize the array/table with an internal Pd message (starting with a semicolon). The visual display of the array values ranges from -1.0 to +1.0. This is idea if you store audio in an array. However, you can also put any other value into the array.

pd-2-12

And the table/visual array:

pd-2-11

 


readsf~

The last object we get to know is actually a sound object. You can immediately see this from the tilde behind the object name. You can imagine this tilde as a little soundwave which indicates that this object deals with sound. The readsf~ is used to play a sound file from the hard disk. The object can for example play WAVE and aiff files.  A very simple player could look like this:

pd-2-13

 

We can also open sound files from the hard drive with a file dialog:

pd-2-14

 

Actually, we have cheated here a bit because yous see quite a lot new objects. There is also a slider, which is used to scale the output volume and a [dac~] object, which is used to put on and off the audio output (dac stands for Digital-To-Analog-Converter). You don’t have to understand all this right now, but it is handy to know that sound files can be played back like this.