Chapter 6. Pd for iOS

Core Audio and its audio unit plugin architecture are an excellent platform for making musical apps. Nonetheless, audio units are laborious to configure, and surprising and occasionally subtle problems do come up. As is its wont, however, libpd will protect app developers from platform-specific quirks as much as possible. For instance, early models of the iPod Touch exhibit subtle differences in their floating point representations of buffer durations, causing glitches due to mismatched buffers. Once we had diagnosed the problem, a workaround was easy to find, and users of recent versions of libpd won’t even notice this problem anymore.

Different devices come with different audio capabilities. For example, on iPhones you can expect to receive audio input from the microphone, while iPods don’t even have microphones. That much is obvious, but there are also less obvious configuration issues, such as audio session categories that are available on some devices but not on others.

When developing a new app, you should test it on a range of different iOS devices, and you should be prepared to try various audio configurations in case the one you want is unavailable or unusable. The libpd community maintains a wiki page that keeps track of devices and audio configurations. If you are using a combination that’s not on the list, please consider documenting your experiences on this page, regardless of whether your combination works or not.

As far as sophisticated audio work ...

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.