I have an AUGraph hooked up to a soundStructArray (as per mixerHost) and am using other soundStructArrays to pass in new files at runtime (to create new music loops).
Basically, I take 2 loops (that are stored in temp struct slots and add them together in the function below, which passes the combined contents into an output struct slot:
///from code
// get the combined frame count
UInt64 totalFramesInFile = inArray[phrase1Index].frameCount + inArray[phrase2Index].frameCount;
// phraseOut is used to hold the combined data prior to it being passed into the soundStructArray slot
AudioUnitSampleType *phraseOut;
//clear the synth slot to 0
inArray[synthPhraseIndex].frameCount=0;
free(inArray[synthPhraseIndex].audioDataLeft);
inArray[synthPhraseIndex].audioDataLeft=NULL;
//now alloc the memory for the combined phrase
inArray[synthPhraseIndex].audioDataLeft =(AudioUnitSampleType *) calloc (totalFramesInFile, sizeof (AudioUnitSampleType));
inArray[synthPhraseIndex].frameCount = totalFramesInFile;
phraseOut = inArray[synthPhraseIndex].audioDataLeft;
//the phrase1Index and phrase2Index variables will load audio data from the existing array slots
// then pass them into phraseOut in turn
AudioUnitSampleType *phraseIn;
phraseIn= inArray[phrase1Index].audioDataLeft;