Personal tools
You are here: Home members davigoli's Home PD, Compiling & The Mac OSX Command Line
Document Actions

PD, Compiling & The Mac OSX Command Line

Woefully Incomplete, Partially Erroneous How-To for newbies to get started using the Mac OS X command line. (Please fix me!)

About the OS X Command Line

Turns out you've dug deep enough into the depths of what your Mac can do that you've found yourself reaching for OS X's command line. 'But wait', you tell yourself, 'I started using Macs for the great, sleek, point-and-click user interface. Why would I ever want to interact with my flashy computer with a text-based command line?' There certainly are several reasons:

  • You've heard about this great external, but need to compile it first.
  • You've tweaked PD's source code and need to compile a running copy of it.
  • You want to pass command-line arguments to PD
  • You've heard about the tremendous power waiting to be unleashed at the command line.

Alternatives to Compiling

Before you read much futher, though, it's important to realize that you don't need to do any compiling to use PD. Simply download the latest binary version from any of the following resources:

  • Miller Puckette's website - always the latest, cutting-edge version - with no externals attached
  • Sourceforge
  • pd-extended - Hans-Christoph Steiner's installer page, includes the most recent 'extended' version with externals; however the core app is sometimes a generation behind Miller's most recent version

For the vast majority of PD users, and certainly for anyone just starting out, this is the way to go. Just download PD, install it using the Aqua install shell like any other app, double-click on the icon, and you're in - getting PD is no more difficult to install and operate than Max/MSP, SuperCollider, Csound, or any other OS X software out there.

A word about Externals

Many people who are new to PD expect it to have all kinds of bells and whistles that allow you to make whacky-sounding tracks in minutes, the way flashy commercial apps like Live and Reason do, the way many people learn to rely on VST plugins to make their sounds for them. If this what you're expecting, and if you don't want to get your hands dirty with how the computer acutally puts the sound together, then PD probably isn't for you. Many externals are distributed as easy solutions to these sorts of problems, but it must be emphasize that you don't need any externals to use the full functionality of PD. Try downloading Miller's core version and working through the documentation tutorials first before you reach for any externals. If the techniques used in the tutorial don't make sense to you, grab a copy of:

  • Dodge/Jerse: "Computer Music, Synthesis, Composition, and Performance"
  • Roads, Curtis: "Computer Music Tutorial"

These books will teach you the synthesis techniques which underlie all computer music programs, from PD and SuperCollider to - yes - even Live and Reason.

You're already running Unix

Underneath that flashy, user-friendly, graphical user interface (aka 'Aqua'), Apple has based the underlying structure of OS X - you know, the part that does all the dirty work, behind the scenes, processing incoming signals, managing the file tree, communicating with your network, etc. - since its first release on a variant of the fabled Unix operating system known as BSD. OS X's version of this is called Darwin, and it uses much the same Unix-based functionality that Linux users enjoy. The command-line interface can be intimidating at first, but I hope to bring you up to speed on the stuff you need to have and know to get PD working like you want without too much fuss. Since PD is developed on Linux, there's a lot of similarity and also some potential confusion for Darwin newbies as to how exactly to go about compiling.

How to get there

  1. Look in Applications > Utilities
  2. Drag the icon for Terminal to your Dock. That way, you'll always have it when you need it.
  3. Double-click on Terminal to open the command-line shell

Some Unix Concepts

Now that you're in the shell, here are a few basic commands for finding your way around:

  • ls - Displays all files in the current directory. Type "ls -lp" for more detail on what you're seeing
  • cd "dir" - Change directory to "dir". Use "cd ~" to go to your home directory (usually /Users/yourname/) and cd / to get to the root directory
  • cp "src dest" - Copy file "src" to "dest"
  • rm "file" - Remove (delete) a file
  • mv "src dest" - Move a file (same as: cp "src dest"; rm "src")
  • man "command" - View the manual page for "command"
  • less "file" - Print "file to the screen. Use the arrow keys to navigate in the file; Ctrl-D to exit
  • open "file" - Open a file or program in Aqua from the command line(very useful!)
  • sudo "command" - Log in as root or "superuser" to execute command (more on this later)
  • exit - Close the shell and end your session
  • Here is a comprehensive list of OS X shell commands

For those hardy souls who use Linux as their everyday operating system, compiling is a routine part of adding new software to their system. Darwin, like Linux, is structured on a Unix-based file system tree.

Before you can compile, you need the tools available in Apple's freely distributed Xcode development package. You must first sign up for an account before you can download the tools, but the account itself is free. This package includes a compiler (gcc), a linker, and a basic set of source files and libraries for compiling.

Once you've downloaded the source for Pd and any externals you wish to compile, change to the source directory (usually /Applications/Pd-0.39-2.app/Contents/Resources/src) run the following on the command line:

$ ./configure

$ sudo make; sudo make install

The first step, ./configure, invokes a shell script which checks to make sure all of Pd's build dependencies - i.e. all of the libraries and other external sources it needs to build - can be found on your machine. This script will inform you if you're missing anything. If you need something you're lacking (Tcl/Tk sources for instance), you can probably find it on Sourceforge. With any luck, if ./configure succeeds, the rest will work as well. The semicolon between the commands simply instructs the shell to execute the commands in sequence. You can also type % ./configure; sudo make; sudo make install once you know your build dependencies are met.

by David Golightly last modified 2007-05-06 08:47 PM
Contributors: david golightly

Powered by IEM Powered by Plone Section 508 WCAG Valid XHTML Valid CSS Usable in any browser