Snowy Monkey

Building a software synth

iPhone Audio Unit Output Formats January 1, 2010

Filed under: Uncategorized — snowy monkey @ 1:56 am
Tags: ,

I’ve spent a lot of time trying to use the same audio renderer for both mac & iphone versions of the synth.  I developed the code using float buffers, which I can then feed directly to the audio unit of the mac without issues.  However, I’d always had problems doing the same on the iphone – it would come out a bit crackly.  Turns out the iphone doesn’t support using float buffers with the audio units.

Now I have to decide whether to continue to use floating point buffers (keeping the bulk of the audio code identical) and converting to ints, to write a separate, int-based note generator, or to move entirely to ints for both platforms.

On the one hand, I find floats more natural to use, but 16-bit ints would use half as much memory, be faster on the iphone (which is after all the intended platform) and perhaps be more suitable in general.  Check out this forum discussion on the topic of ints vs floats – I’ve skimmed it, but not fully absorbed it all yet.

For now I’ll probably leave the code the same, but convert the buffer before rendering it.  In the future, I’d like to write some solely int-based synth code.  Another for the todo list.

 

Leave a comment