First of all, thanks for an incredible framework. I started playing around with Core Audio a while ago and nearly gave up before I found TAAE. Now I've made a couple of fun projects and now I've started building a more advanced app and it's coming along nicely. However for the last couple of weeks I've been overheating my brain trying to get a sequencer to work.
What I'm trying to do is to use an AUSampler to play samples that may or may not have sequenced elements in them (like a 1 bar hihat-loop). I'm triggering the sampler from a sequencer and I've tried a couple of different approaches due to reading about that counting frames would be the most accurate thing vs. using timers and mach_wait_until(). Right now I'm using the timingReceiverCallback.
For quite a while now I've ben trying to understand how to get this working. My approach has been to count the frames but since the frames mostly are 512, depending on bpm, i get more or less matching results. I rarely get an on beat hit, rather I get a last tick just before the beat and then a first slightly past.
Hit before beat: 0.998458
Time since beat: 0.010068
So what I've been trying to do is to make the sequencer wait those last 0.001542 seconds so that it makes the AUSampler play at the exact beat but this seems to be trickier than I thought.
This would probably not be a problem if I didn't have samples that are sequenced but because of this, when the sampler starts ahead and plays a sequenced sample, when the counting catches up, then the first sample is triggered a little ahead of time and the second sample is triggered more accurate a glitch occurs.
Am I going in the right direction? A little input would be fantastic, I've been going crazy about this for weeks and don't know if I should scrap everything and start with a different solution?