I'm not familiar with the audio hardware within the iPhone itself, but since it does not expose any internal synthesization routines I wouldn't be surprised if its not possible to capture the outbound audio for reprocessing.
I suspect you will find it much easier, particularly if you're not familiar with programming audio hardware directly, to instead record the drum actions and time intervals and replay the the audio files in the same manner as originally played. This would also have the advantage that you could edit, slow down, speed up, and other tricks without altering the audio directly.
As the drums are hit, you'd need to append to an NSMutableArray. The sample below is based on a drumType (tag for the drum button being hit for example), and a drumNextDelay which is the delay (NSTimeInterval) to the next drum hit. There's obviously more ways of handling this, but its just an example.
A rough version of the playback could be implemented by calling performSelector repeatedly with the next time interval, something like the following:
- (void) startPerformance {
self.drumIndex = -1;
[self performSelector:@selector(playDrumBeat) withObject:nil afterDelay:0];
}
- (void) playDrumBeat {
self.drumIndex++;
[self playDrum:[[drumBeats objectAtIndex:self.drumIndex] drumType]];
[self performSelector:@selector(playDrumBeat) withObject:nil afterDelay:[[drumBeats objectAtIndex:self.drumIndex] drumNextDelay]];
}
This can be prone to timing issues with the OS, but I'd pursue something like this for a first cut and see if it works.
Barney