Blog

Tag Archives: Loopy

What I’ve been up to: Loopy 2 (track importing)

Here’s the result of the last few days’ work: Loopy 2 now has track importing. Drag audio files into Loopy’s documents folder in iTunes, then import into tracks. Loops are automatically time-fitted for perfect synchronisation, using the frankly awesome Dirac audio processing library.

Also tagged , , | Leave a comment

Playing audio in time using Remote IO

I got an email today with a question about how to handle playback of audio in time, synchronised with a clock. My ‘musical notepad’ app Loopy does this, and I thought I’d briefly explain how.

Any app that makes use of the Remote IO audio unit framework (which is generally necessary for the kind of responsiveness required in a realtime musical app) provides audio to the hardware via a callback, which is periodically called when the hardware is ready for more.

The trick here is to provide the right chunk of samples in this callback for the current time position.

Loopy achieves this by:

1. Keeping track of where in the timeline we are at the time the callback is called

This is easily accomplished by keeping a record of the time the clock was started, subtracting this from the current time, and possibly performing a modulus with the tempo. For example:

  • (now - startTime) % timePerBar gives the number of time units into the current bar (lets call it timeIntoBar).
  • timeIntoBar / (timePerBar/beatsPerBar) gives the number of beats into the current bar, and
  • timeIntoBar % (timePerBar/beatsPerBar) gives us the time into the current beat.

2. Determining first if we should be playing audio at this time, and if so, which samples should be playing

This involves first converting our time units from step 1 into samples. For instance, you can convert microseconds to samples by dividing your time by 1000000/yourSampleRate. Aside: Of course, you can convert back from samples to time by multiplying instead of dividing.

Next, in the case of Loopy’s metronome, for example, we test for whether samplesIntoBeat < sound.lengthInSamples. If so, that means we should be playing audio. If the sound was a loop, of course, we could be always playing.

The offset into the sound, in samples, is just samplesIntoBeat, in the case of the simple metronome. In the case of a loop, you probably will be more interested in the number of samples into your loop — so instead of determining (now - startTime) % timePerBar, you may be interested in (now - startTime) % timePerLoop.

So, we want to return the requested number of samples starting from this offset into the sample array representing our audio.

3. Returning smooth audio in time

Note that if you just go returning any old set of samples, willy-nilly, you’re going to get nasty clicks and pops from discontinuities you get by not matching the start of your next buffer to the last one.

To ensure smoothness, Loopy keeps track of the offset of the last samples we returned, and just return the immediately following bunch of samples — unless we’re more than some threshold number of samples out of time, in which case we’ll suffer the pop in order to stay synchronised. Actually, you can even generally avoid the pop if you smoothly blend buffers over a short time, removing any discontinuity.

Final words

The example above was a relatively trivial one, for a metronome sound. For longer audio that may span multiple bars, you’ll probably want to perform a modulus by the length of your audio clip, possibly quantised to your time signature, and possibly using a per-loop time base, so you can start the loop at any point in your timeline and have it begin from the start. This is something Loopy doesn’t currently do — Loopy will keep your loops synchronised so when you start a loop playing, it’ll play whatever part corresponds to the current timeline, not from the start of the loop. Maybe it’ll be an option in the future?

I wrote a little about the timing of loops in my second article on Loopy’s implementation.

Also tagged , , , | 3 Comments

Loopy is on sale

_media_images_products_loopy_screen-iphone.jpgLoopy, my loop-based musical instrument and musical notepad app, is going on sale in anticipation of Loopy 2, which is on its way, with a release expected a little later this year.

Here’s some recent feedback on Loopy (about which I’m thrilled!):

  • Loopy does more of what I wanted than my Boss looper pedal that I paid £180 for! CUJ1mmy
  • This app lets me get creative. The timing and sync is perfect and has a very polished interface. Joza coza
  • This is an example of someone going the extra mile to take advantage of what the iPhone can do – a refreshing change from the 1000′s of apps that all look, sound, and probably taste, the same. Apple – give this guy a job! Gerry

Grab Loopy for half price on the iPhone App Store!

Also tagged , | Leave a comment

Podcast interview with Dan Grigsby of Mobile Orchard on Loopy’s development

iphone-loopy-mobileorchard.pngLast Thursday I did an interview with Dan Grigsby from Mobile Orchard; the interview is now online.

Highlights from this interview include: From UIView to OpenGL: the seven different implementations it took to finalize its unique — and Best App Ever award-nominated — UI. From audio-queues to Remote IO: the four different architectural approaches he tried before finalizing audio subsystems. The travails of trying to implement echo cancelation. The business of making a living off of a $10 app

Listen to it here, or subscribe in iTunes (30 min.)

Also tagged , , , , | 2 Comments

Developing Loopy, Part 2: Implementation

LoopyThis is part 2 of a series following the development of Loopy, my iPhone app.

In part 1, I wrote about Loopy’s interface. Part 2 will be more technical, and will cover some challenges encountered during the evolution of Loopy from concept and mockup to working software. Or, more specifically, the stupid things I did along the way. Read More »

Also tagged , , , , | 18 Comments

Developing Loopy, Part 1: Interface

LoopyLoopy is my first iPhone app, a loop-based performance/musical scratchpad app based on looping audio equipment and inspired by, equally, the fantastic and free “Freewheeling” application, and an a capella performance by Imogen Heap.

It’s development was a whirlwind of obsessive coding, near-vertical learning curves, impatience, excitement and occasional burnout and writers block.

I thought I’d share some facts and lessons learned from the process, in a several-part article. For part 1, read on. Read More »

Also tagged , , , , | 1 Comment

Imogen Heap playing with Loopy!


Imogen Heap: It’s a beautiful day! Being silly. Singing into milk with loopy. on 12seconds.tv

Also tagged | Leave a comment

Loopy status update

loopy-construction.png

Loopy has been generally successful in the 3 weeks it’s been on the market, and I’ve received many useful suggestions from users, as well as lots of positive feedback:

“What a fantastic app. It is entirely intuitive in use (although there is a very neat video tutorial) and is just the most wonderful fun.Be the first to write a bit of music using extant environmental sounds; loop them and then bung them wirelessly into your Mac (Or Windows) DAW for that final bit of tweaking.Or just sit there humming. Or plucking. I said plucking.This is a beautifully written application.Go. Have fun!”
“Great app! By far the most useful multitrack on tis appstore (yes I have tried them all) in spite of some UI niggles that I am sure will be ironed out (such as the miniature glowing LOTR icons/buttons), very excited for how this app will evolve…”
“By far the most useful multitrack recorder for the iphone.”

LOTR icons, you say? One loop to rule them all…

The most demanded features so far have been:

  • Lead-in recording
  • A better metronome/timing mechanism, more adjustable, and with the ability to adjust tempo mid-session
  • A limiter
  • Panning support
  • The ability to import loops

I’m in complete agreement that these would be useful features, and will be working to include them all in the next release of Loopy.

Other things currently on the to-do list include:

  • More tracks, with home-screen-esque swipe functionality to access other pages of tracks
  • Undo functionality
  • Gate functionality and perhaps mixing improvements to limit noise
  • A track editor, to tweak timing, and possibly ADSR envelope functionality

And of course,

  • Community functionality

I am currently engaged in putting together the next iPhone App, which should be completed over the next few weeks. Then, back to Loopy.

Also tagged , | 2 Comments