Making Musical Apps
Peter Brinkmann
Copyright 2012 Peter Brinkmann
OReilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (.
Nutshell Handbook, the Nutshell Handbook logo, and the OReilly logo are registered trademarks of OReilly Media, Inc. Making Musical Apps , the image of a lyrebird, and related trade dress are trademarks of OReilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and OReilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.
O'Reilly Media
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 youre 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 OReilly 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 products 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 (OReilly). 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.
OReilly 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 OReilly 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:
OReilly 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.