SACC

/ / navigation

Introduction

Surface Elements
Control Level
Applications
Exercise 1


// Introduction



Pd is free software. Versions exist for Win32, IRIX, GNU/Linux, BSD, and MacOS.

Pd is a real-time graphical programming environment for audio and graphical processing. It resembles the Max/MSP system but is much simpler and more portable.


But what is a graphical programming environment?

Programmers usually write lines of code and then have the computer execute that code. However, in a graphical-programming environment, the programmer describes how the program works by manipulating objects on the screen. You can change the way the objects behave by sending them messages and by connecting them together in different ways by drawing lines between them.

What is cool about Pure Data, or Pd is that it works in real-time. The programmer can change the program, even when it is running, and you can see and hear the results immediately.


The program that you write is called a patch. A patch first appears as a blank white background on which you write a program. This white background is also called a canvas.

Each open document has one main window and any number of subwindows. The subwindows can be opened and closed but are always running whether you can see them or not. Here is a simple Pd patch:
CTRL-E allows you to toggle between Execute and Edit mode.

This is the main window:
main_window.png

This is where messags are sent and what you will use to debug your programs. This is also where you can test whether Pd is functioning properly: In the main menu, click on Media Test Audio and MIDI:
test_audio.png

In testtone, click first on the box next to 80, then on the box next to 60:
testone.png
You should hear a sine tone coming out of the computer's loudspeaker.

In the beginning...
Before you can use Pd to control music and video, you should understand the way that computers and Pd handle data.
  1. Open Pd


  2. In the main window make sure that Compute Audio is selected


  3. Select New from the File menu (⌘+N)


  4. To add an object press ⌘+1 or navigate to the Put menu and select Object
    object.png
    You should see a blue box attached to the mouse cursor
    blue.png


  5. To decouple the mouse from the object box, click somewhere on the blank white surface


  6. Type this into the box:
    osc~ 440
        

    osc.png
    To accept what you have typed into the box, click anywhere outside the box on the white surface:


  7. You should now see a rectangular box with little black rectangles in the top and bottom corners. The upper rectangles are called inlets, the bottom rectangle is an outlet:


    If you place the cursor onto the outlet rectangle, it changes to a circle:


    Clicking on the rectangle and moving the mouse while keeping the mouse button pressed draws a line that can be thought of as a cable:


    Unless you connect the cable to another object, it will disappear.
  8. Make another object and call it dac~.
    dac stands for digital to audio converter


  9. Position dac~ below osc~ 440
    osc stands for oscillator.

  10. Connect a cable from the outlet of osc~ to the left inlet of dac~ (Don't worry, you'll know if you did this correctly)
    tone.png


  11. You can deselect Compute Audio in the main window to stop the tone.

    The tone is A4 (a' in the German system), also called the A440, the standard concert tuning pitch that has a frequency of 440 Hertz.


  12. Now connect the outlet from osc~ 440 with the right inlet of dac~ as well.

    You should hear sound from both of the computer's speakers


  13. Create a Number box ⌘+3.


  14. Attach the Number box's outlet to the inlet of osc~
    num_osc.png

  15. You need to change into what is called Execute mode (Edit> Edit mode, or ⌘-E;. The cursor turns into an arrow.


  16. Click on the number box, hold the mouse button, and move the mouse up and down. This changes the numbers and the pitch/frquency. The value should be at least 100; this range can be more finely adjusted by holding SHIFT while clicking and moving the mouse.

    Another way to enter values into the number box is to click on the number box, enter a value on the keyboard, and press ENTER.
  17. Return from execute mode by pressing ⌘+E again.


  18. Move the cursor, which should have changed back to a hand, over the connection betweenosc~ anddac~. The cursor becomes an X. Click on it, which will turn the cable blue.
    cut_osc_cable.png

  19. Press BACKSPACE to terminate the connection


  20. Do the same with the cable connected to the right inlet


  21. Create a new object in between osc~ and dac~ and call it *~ 0


  22. Make the following connections:
    new_osc_connection.png


  23. Enlarge the window by clicking on its lower right corner, holding the mouse button, and pulling it down and to the right.


  24. Click on the lower right part of the white background near the dac~ object, hold the mouse button, and draw a rectangle that includes the dac~ and the *~ objects.

    This is how you select a part of a patch.

    When you release the mouse button, both objects appear in blue. Click on one of these selected objects, hold the mouse button, and pull them down to free up more space.
    move_objects.png

    To deselect these objects, just click anywhere on the white background.


  25. Create two Message boxes (Put>Message or ⌘-2).Enter 0 in one and 1 in the other.


  26. Connect the outlets of the message boxes to the right inlet of the *~ 0 object
    osc_msg.png


  27. Make sure Compute Audio is selected in the Main window. Change back to execute mode. Click on the two message boxes and see what happens. If you don't hear anything make the number in the Number box larger.





More about the Interface

Pressing ⌘+B opens the help browser:



Source:http://www.pd-tutorial.com/english/
http://en.flossmanuals.net/PureData/