Playing several audio files at precise same time with short interval

edited October 2016

Hello,
I'm trying to build a sequencer and been stuck for days with this problem.
I have a button OR a timer where I would fire :
- amen is a long kick bass
-and clap is a short clap
both in a mixerModule

                   _amen.currentTime = 0;
                    _clap.currentTime = 0;
                   [_amen playAtTime:AETimeStampWithHostTicks(0)];
                    [_clap playAtTime:AETimeStampWithHostTicks(0)];

at first it fires perfectly in sync ,but when I fire again while the samples are still playing, there's a small delay when the longest sample fire even though i set the currentTime to 0...

what to do?

Note: If I fire them and then when they're done playing and i fire again it does play in sync. So i dont think is the timer or button

I hope i explain myself
Thanks

Comments

  • edited October 2016

    mistakes:
    -using simulator instead of the actual device

    I discover that the sample was being fired at negative values(before) mmm
    i get negative values for currentTime :-0.019906
    dont know what to do

  • edited October 2016

    I think I found a glitch,
    when I use AEModuleProcess(mixer, context);
    by itself i get the ugly delay

    but when i use ...in the renderer block

    AEModuleProcess(_clap, context);
            AEModuleProcess(_kick, context);
            AEModuleProcess(_bassSample, context);
            // Run all the players, though the mixer
            AEModuleProcess(mixer, context);

    and play all 3 it removes the delay a little bit

Sign In or Register to comment.