Skip to main content

Lesson 1 - Welcome to Pure Data

Completion requirements
Download and install Pure Data and introduction to Pure Data core concepts: patch, edit mode, objects and messages, cold and hot inlet, log window and display of arithmetic operations on the “Log” window.

Lesson 1:

edu sharing object


Transcript

00:08 - Lesson 1. Welcome to Pure Data. Welcome to this series of tutorials dedicated to Pure Data. What is Pure Data? Pure Data is a graphical programming environment, first developed in the ‘90s, in order to create interactive computer music and multimedia works. Pure Data is open source, thus free, cross-platform, and due to its “visual” nature is an ideal first step in the world of software programming, providing a more user-friendly and intuitive interface than textual coding. 00:43 - What does it mean: graphical programming environment? It means that in such kinds of programming languages, functions or “objects” are linked or “patched” together through patch-cords, inside of an environment which provides graphical representation to the user, and which models the flow of control data and of audio. This ensures extreme flexibility, and allows the user to execute an arbitrary number of different algorithms inside the environment. What is Pure Data usually used for? It can be used to do “live electronics” or, in other words, real-time processing of external incoming sounds captured, for example, with a microphone. It could also be used to do digital synthesis of signals, or for producing sounds similarily generated by algorithms inside the software. During this series we are going to focus on this latter aspect. I am going to show you the basic techniques of sound synthesis inside Pure Data. Furthermore, we are going to see how it is possible to trigger and control this process interactively using external sensors and, specifically, those contained in a ‘smart device’ such as a phone or tablet. 02:02 - Being an open source software, many different releases of Pure Data are available. We are going to use the main one named “vanilla”. if you go on puredata.info it will be available on “Downloads” so let’s download it and install it! 02:24 - Once the software has been installed, open it and the first thing you will see is this window. 02:32 - This is the “Log” window inside of which you can turn the audio processor on and off and the "Log" window will also display all the messages and errors generated by the software. It is white and empty now because we haven't created a “patch” yet. ‘Patch’ is the name of the file you save when you create an algorithm in Pure Data. Algorithm is a technical term but can be translated simply as ‘set of instructions.’ 03:06 - To create a new patch you need to go to File —> New File (pause), or select ctrl_N or cmd_N for Mac users. The patch we just created doesn’t tell us anything because it is empty. The first thing to know is that is possible to create a large amount of different ‘objects.’ Objects are functions which execute logical-mathematical operations according to their content. 03:34 - To create objects I suggest you always use shortcuts because they are faster and easier. To create an object just select ctrl_1 [one] or cmd_1 for Macs. I got this empty box in which I need to type the name of the object I want. Let’s start with something easy and familiar, an object that is able to sum two numbers, so we just type “+” inside. 04:00 - If you prefer to use the menu instead of the shortcut to create a new object, just go to the “Insert” menu and select “Object”. If you go to the “Help” menu and select “List of objects” you will access the list of all objects available inside Pure Data. 04:21 - By right-clicking on them and selecting “Help,” you can expose the help patch relevant to each object. 04:32 - Let’s go back to our “+” object. We have this tiny box with two inlets on top, representing the incoming left and right operands, and an outlet through which the result of our sum is provided. It is important to point out that the objects in Pure Data have to be scanned from the top to the bottom. We have some incoming data sent to an object through the inlets, and the object gives us the computed result as output. How can I input the numbers? By creating a “number box” or, in other words, a container able to host a value. To do so I need to type ctrl_3/cmd_3, or select from the “Insert” menu “number.” 05:33 - I connect the numbers through wires which we call ‘patch cords.’ To create a patch cord just click on the output and drag the wire down to the input of the "+" object and click again to release it. 05:51 - Let’s create a third number box to display the result of the sum. 05:59 - Pure Data patches are displayed in two modes: an “Edit” mode which allows us to move and edit objects and draw patch cords. 06:09 - This mode is also displayed in the patch’s title bar in square brackets. 06:17 - Pure Data’s “Run” mode allows us to lock the patch but be able to change the numbers as we are doing right now, for example. 06:29 - In order to switch between the modes I suggest you use the shortcut ctrl_E/cmd_E. (pause) 06:40 - If I say now 3+2 we get the result 5. 06:48 - If I move the number corresponding to the right operand the result won’t change. 06:58 - But if I move the left operand the result will be updated. This is because objects can have two kinds of inlets: hot and cold. Data sent through hot inlets immediately update the result, as we just saw. On the other hand, data sent through the cold inlet is stored inside the object without any computation or result. 07:27 - Therefore if I now want to display the result I always have to update the left operand. 07:36 - There is a special object that we need to introduce now and it is the “bang” (pause) and we connect it to our “+” object. 07:52 - Let us then exit the edit mode with ctrl_E/cmd_E. 07:59 - A “bang” is a trigger, or a “starter” that tells an object to execute whatever has been stored inside of it. This is exactly what we need to perform our sum. If I modify the data sent to the cold inlet, nothing happens, but as soon as I press the bang, the right operand plus the last number set in the left operand is displayed as a result. 08:29 - If I now want that both inlets become hot I just need to connect the bang to the right operand too, so each time this number changes, the number gets stored first into the “sum” object and then a “bang” is sent to the hot inlet to make the object update. 08:50 - The last thing we can do is to enter the “edit” mode again with ctrl_E/cmd_E, create a new object with ctrl_1/cmd_1 [one], type “print” inside it and connect it to the outlet of the “+”. 09:12 - This object will allow us to display the result of our sum outside of the patch, in the “Log” window. This is usually a good practice for debugging and checking the correctness of the operations running inside the patch. 09:30 - In the next videos we are going to explore further the different kinds of objects available inside Pure Data.



Example Patch:

 

edu sharing object
 

Last modified: Tuesday, 12 September 2023, 6:06 PM