Programming Sound with Pure Data
Make Your Apps Come Alive with Dynamic Audio
by Tony Hillerson
Version: P1.0 (January, 2014)
Copyright 2014 The Pragmatic Programmers, LLC. This book is licensed tothe individual who purchased it. We don't copy-protect itbecause that would limit your ability to use it for yourown purposes. Please don't break this trustyou can use this across all of your devices but please do not share this copywith other members of your team, with friends, or via file sharing services. Thanks.
Dave & Andy.
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 The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein.
Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://pragprog.com.
The team that produced this book includes:
Jacquelyn Carter (editor)
Potomac Indexing, LLC (indexer)
Candace Cunningham (copyeditor)
David J Kelly (typesetter)
Janet Furlow (producer)
Ellie Callahan (support)
For international rights, please contact .
For the Best Reading Experience...
We strongly recommend that you read this book with the publisher defaults setting enabled for your reading device or application. Certain formats and characters may not display correctly without this setting. Please refer to the instructions for your reader on how to enable the publisher defaults setting.
Table of Contents
Copyright 2014, The Pragmatic Bookshelf.
Early praise for Programming Sound with Pure Data
This book covering Pure Data is pure fun. Where else can you learn how to make lightsaber sounds with code? Its a very nice intro to Pd and basic sound design and focuses on practical things you can use in your own apps.
Jack Moffitt, senior research engineer, Mozilla |
After reading Programming Sound, I had so many ideas running through my head that I couldnt sleep. I learned not only how to synthesize amazing sounds (think oceans, wind, wineglasses, and laser swords), but also why and how to dynamically incorporate those in both web and native mobile applications. Thank you, Tony!
Zebulon Bowles, freelance musician and developer |
Are you a sound designer? Working on a game audio project? Still looking to bring your projects to the next level? Look no further. Pure Data is your new secret weapon. And this is the book that will help you to get the most out of this powerful open source application. Tony delivers!
Benjamin Lemon, composer, sound designer |
Hillerson makes the depth of Pure Data accessible, and in the process teaches the basics of digital sound synthesis. Useful, fun, and highly recommended.
Ben Price, senior developer, DreamQuest Games |
Programming Sound raises the bar for what defines a good audio experience in software. This book will help you see application development through an entirely different lens. It arms you with the tools necessary to provide another avenue to engage and delight your audience.
Dan Berry, iOS developer, Tack Mobile |
Foreword
Increasingly, new arts and media projects require some programming skills. Studies in product design, interaction design, and user experience draw not only on the traditional fields of sound, graphics, and haptics, but also on practical skills with tiny embedded single-board computers like the Raspberry Pi and Arduino, on high-level rapid-prototyping languages, and on knowledge of browser technology and languages such as Python and C. One of the most popular and powerful rapid-development tools for audio-signal processing is Pure Data, Miller Puckettes wonderful visual programming tool. With its vibrant free-software community, and through the work of Peter Brinkman, Hans Christoph Steiner, and many others, it has emerged as the number-one choice for bridging the creative arts and engineering sciences.
As new university courses continue to expand, teaching sound design, sonic interaction, and sound arts as well as the traditional computer music offerings, the challenge of learning Pure Data in just one semester has arisen. Millers book, The Theory and Technique of Electronic Music ,, offer advanced treatments of substantially theoretical fields: electronic music and procedural audio, respectively. Each has practical elements directed at mastering these. Their use of Pure Data as a vehicle to convey more advanced academic material makes learning it something of a side effect. I like to recommend Johannes Kriedlers Loadbang to my freshman students since it is a great cookbook of patch and go recipes from which one can learn much by observation. Between these lies something of a gap, and beyond my own lecture notes I have often wanted to suggest a book that sets out to teach Pure Data as its primary objective. Tony Hillerson offers just such a resource herea practical, step-wise, guided journey through mastering the basics of Pure Data and applying them to game applications using the C/++ libpd libraries.
You cannot learn programming from a book, but there is something valuable in this book that will motivate you and set you on the right course. Only at the end will you understand why the path is made by walking, and why I endorse this particular journey. A key factor is that the author has clearly trodden the road too, and speaks from personal experience, not a collection of data sheets and theoretical texts.
In The Matrix , Neo plugs in and downloads kung fu. If only learning could be like that. Programming is very much like kung fu. Indeed, it is no surprise that hackers talk this way about their skills. That is to say, it is all about experience. You learn to program by doing it. To some extent motor memory and ineffable symbolic knowledge play a part, and with time one learns to translate ideas and intentions into code without really thinking about the mechanics.
In the end this is a long journey. The ten thousand hours needed to become a master appear daunting in this age of impatience, and in the interdisciplinary digital arts where demands are made upon your skills in mathematics, planning, physics, graphics, psychology, networks, and electronics, it seems an impossible learning curve for which even two or three lifetimes are not enough.
But the human brain is amazing. Given a motive, an itch to scratch, the right seeds to grow, and a little sunlight of encouragement, we are able to extrapolate, create, and dream our way to extraordinary accomplishments, even with meager teaching resources. The voice of a good teacher is ever present in this book, giving solid formative steps and encouraging you toward exploration. Self-learning and the mathematical arts go hand-in-hand. The autodidactic approach to programming requires curious playfulness that can be brought out only through clear and quite simple objectives designed to be engaging; evoke personal, emotive goals; and subtly suggest further work. Activities like making a browser-based game are perfect for this project. Be prepared to have a lot of fun and develop a healthy addiction to code.