Preface

Pure Data (Pd) is a programming language for digital audio and more. Written by Miller Puckette in the 1990s and under active development ever since, Pd has established itself as one of the leading open-source packages for computer music, and it remains largely interoperable with its commercial cousin, Max/MSP. A Pd program, called a patch, is a graphical representation of the flow of audio signals and control messages in a piece of music that Pd will execute in real time; changes to a patch take effect immediately. Its interactive and visual nature accounts for much of the appeal of Pd.

Pd has been popular in computer music circles since its appearance in 1996, and recent years have seen its adoption in commercial projects, most notably the computer game Spore by Electronic Arts and Inception the App by Reality Jockey Ltd., which made the London Times list of top 500 iPhone apps.

Inception the App is based on libpd, a thin layer on top of Pd that turns Pd into an embeddable audio library. Since the appearance of libpd in July 2010, a growing number of developers have been using libpd in their projects. Other noteworthy examples include Sonaur for Android, NodeBeat for Android and iOS, and Pugs Luv Beats for iOS.

This book is about libpd as an audio engine for mobile apps. We will focus on musical apps that require sophisticated audio processing capabilities, but libpd also has potential as an audio engine for games. As processors become more powerful, games may reduce their use of canned samples and synthesize music and sound effects instead. Procedural audio in games has much creative and expressive potential, and libpd is an excellent platform for it.

This book is primarily aimed at developers who want to equip their mobile apps with audio capabilities that go beyond the mere triggering of samples, as well as composers and sound designers who want to deploy their work on mobile devices. If you are managing a project with multiple developers, the discussion of the delineation of the interface between audio components and the rest of the app will help you structure roles and responsibilities in your team.

Conventions Used in This Book

The following typographical conventions are used in this book:

Italic

Indicates new terms, URLs, email addresses, filenames, and file extensions.

Constant width

Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.

Constant width bold

Shows commands or other text that should be typed literally by the user.

Constant width italic

Shows text that should be replaced with user-supplied values or by values determined by context.

Tip

This icon signifies a tip, suggestion, or general note.

Caution

This icon indicates a warning or caution.

Using Code Examples

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Making Musical Apps by Peter Brinkmann (O’Reilly). Copyright 2012 Peter Brinkmann, 978-1-4493-1490-3.”

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .

Safari® Books Online

Note

Safari Books Online is an on-demand digital library that lets you easily search over 7,500 technology and creative reference books and videos to find the answers you need quickly.

With a subscription, you can read any page and watch any video from our library online. Read books on your cell phone and mobile devices. Access new titles before they are available for print, and get exclusive access to manuscripts in development and post feedback for the authors. Copy and paste code samples, organize your favorites, download chapters, bookmark key sections, create notes, print out pages, and benefit from tons of other time-saving features.

O’Reilly Media has uploaded this book to the Safari Books Online service. To have full digital access to this book and others on similar topics from O’Reilly and other publishers, sign up for free at http://my.safaribooksonline.com.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at:

http://shop.oreilly.com/product/0636920022503.do

To comment or ask technical questions about this book, send email to:

For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.

Find us on Facebook: http://facebook.com/oreilly

Follow us on Twitter: http://twitter.com/oreillymedia

Watch us on YouTube: http://www.youtube.com/oreillymedia

Acknowledgments

The material discussed in this book grew out of the work of many people, most of whom have been volunteering their time and expertise. Miller Puckette created Pure Data and made it available as open source. Miller was also an early supporter of libpd. Without his willingness to consider libpd-related patches to Pd itself, libpd would not be able to track the development of Pd as closely as it does now.

Naim Falandino, Scott Fitzgerald, Peter Kirn, and Hans-Christoph Steiner developed a partial Android port of Pd that paved the way for libpd. Peter and Hans-Christoph remain deeply involved with the project, and libpd owes much of its success to their work.

Chris McCormick took an early version of libpd and ran with it, creating PdWebkitDroid as well as PdDroidParty, two promising platforms for deploying content created with Pd. He also contributed to the build system and the Python branch.

Martin Roth and Dominik Hierner at Reality Jockey Ltd. created the first version of the iOS components of libpd, and Michael Breidenbrücker approved their release as open source. Joe White and Rob Thomas spent much time answering my questions about RjDj, as did Frank Barknecht, who also donated an RjDj scene for distribution with libpd.

Richard Lawler contributed the first sample projects for iOS and helped maintain the Objective-C bindings.

Dan Wilcox created a C++ wrapper for libpd and integrated it into openFrameworks.

Rich Eakin greatly improved the way libpd manages patch files. He also drove the recent revision of the iOS components, completely revamping the audio glue and updating it for iOS 5.

Shawn Wallace, my editor at O’Reilly, was the first to suggest that libpd deserves book-length treatment, and he saw the project through from proposal to publication. I am grateful for the opportunity to write this book, and for all his work throughout the process. It’s been a great experience.

Thanks also to the technical reviewers, Shawn Greenlee and Chris McCormick, as well as my colleagues at Google, Ananya Misra and Andrew Senior, who performed the internal publication review.

This book ties together several areas that have long been interests of mine, including music, software, and electronics. I wouldn’t have picked up those skills if my parents hadn’t encouraged and supported all my pursuits from an early age. I am grateful to them.

Finally, thanks to my wonderful wife, Shiau-uen, who has remained remarkably tolerant of the long (as well as odd) hours that have gone into the development of libpd and the writing of this book.

Get Making Musical Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.