Audio Animation in iOS

Audio animation?

Consider an imaginary touch-based slider control for use in an audio app: you drag your finger up and down the control (let’s imagine it’s a vertical slider) and some aspect of the sound changes in direct response to the movements of your finger.

But if you lift your finger and touch down again some distance from your previous touch – that is, you cause the control to make a jump in values – the control’s display gently but swiftly animates to that new value… and so does the audio!

So how would you do something like that?

With Core Animation of course!

Creating Custom Replicator Views

CAReplicatorLayer is one of the more interesting toys in the Core Animation toolbox: feed it one or more sublayers (an image, a rendered shape, whatever) and it will copy – replicate – those sublayers and then do stuff with the copies in time and space.

I happen to think replicator layers are particularly well suited to audio-related interfaces because their visual properties in many ways parallel the cylical nature of music and sound.

There’s one thing, however, that CAReplicatorLayer can’t do, and that’s: provide you with direct access to the copies it creates. If that’s something your app requires, you’re going to have to roll your own version.