A previously used data structure in Pd is the table object. It can be used to store and retrieve values via table indices. In this section, we will learn about a few other data structure objects in Pd.
Pd is written in the C programming language. It offers an object allowing a C-like syntax to help reduce the number of objects necessary to perform a calculation.
Finally, Pd provides a few objects that support recording, playing, and editing of MIDI file data.
- The funbuff object can be used to store and retrieve (x, y) pairs of numbers.
- The coll object can store and retrieve lists of numbers or text, either using integer or symbolic indices.
- If using symbolic indices, the list must begin with the word store. In this case, the first item after store is used as the list address.
- When coll receives the address alone at its inlet, it sends the address out its right outlet (preceded by the word symbol if it is symbolic) and the list contents out the left outlet.
- The contents of a coll object can be stored to and loaded from a file using write and read messages.
- The coll object responds to a variety of other messages that allow one to read, edit, and access its elements.
- The expr object allows one to create C-like mathematical formulas that can include the use of C language math functions.
- Notice the use of the $f1 argument, which converts the input to a floating-point value. The output is converted to an int using the int() function.
- The seq object records and plays back raw MIDI data.
- The text messages record and stop control recording.
- The text messages start and stop control playback.
- The text message start can have an argument to control the speed of playback (1024 = original tempo).
- The message delay 0 makes the sequence start at time = 0 (it removes a non-zero start interval).
- The write message can be used to save your masterpiece sequence to a file.
- The read message can be used to load an existing sequence file.
bourree.sc
- The mtr object can be used to record and playback up to 32 tracks of numbers, lists, or symbols.
- The number of tracks is specified as an argument to the mtr object.
- The mtr object responds to start, play, record, mute, and unmute messages, each of which can have an integer argument specifying a particular track. If no argument is given, the message is applied to all tracks. Or these messages can be sent directly to a particular track inlet.
- The next message causes the next message in each track to be output to the corresponding track outlet. In addition, a two-item list is output from the leftmost outlet indicating the track number and event delta time for each track.
| ©2003-2026 McGill University. All Rights Reserved. Maintained by Gary P. Scavone.
|