


Since it is invariably greater than t0, any event that starts exactly at t0 (e.g. The MusicPlayer takes t1 and computes where it falls in its sequence of events. Shortly after, at time t1, the AU Node fed by this MusicPlayer asks for data. Now when I reset the time on a MusicPlayer, it's done at a certain time, say t0. OK, here's what I think is happening: Core Audio is pull-based, that is, when a unit needs data, it requests it from its source. On the other hand, have you considered managing your noteOn + noteOff events directly using: MusicDeviceMIDIEvent (self.samplerUnit, noteCommand, noteNum, onVelocity, 0) Don't know what you are trying to do but a workaround might be starting your event a bit later than 0.000. I was able to repro the issue with that file - hadn't seen it before but then the files I work are longer. SequenceTrack Events: 9, Track Length: 4.11 beats SequenceTrack Events: 3, Track Length: 0.00 beatsĠ.000: Time Sig:4/4, 24 clks/qtr, 8 32nds/clk This is how the MusicPlayer sees your file (using the function CAShow(nameOfYourSequence)) Sequence = 1, Type = beats Fwiw - without the stop/start player calls, it also works but transient notes will still sound so it is less of a clean jump. Or perhaps I misunderstood the issue you described.

#ARIA MAESTOSA ADJUST SPEED WHILE PLAYING CODE#
Are you confident that notes in the sequence are at the times you think they are? Or something else going on?Ī quick test with the code below (error checking removed) stops + restarts fine. I haven't noticed any problem with starting/stopping/restarting a sequence at t0. I have to wait until the sequence is completely played before I can play it again. No joy, iOS knows I want to play the same file twice and forbids it. So I've gone to the extreme of creating two MusicSequence from the same MIDI file and switching from one to the other. If I change the MusicSequence however, the new MusicSequence plays fine. If (MusicPlayerStart(musicPlayer) != noErr) If (MusicPlayerSetPlayRateScalar(musicPlayer, 1.0) != noErr) If (MusicPlayerSetTime(musicPlayer, (MusicTimeStamp)0.0) != noErr) If (MusicPlayerSetSequence(musicPlayer, musicSequence) != noErr) If (MusicPlayerStop(musicPlayer) != noErr) If (MusicPlayerIsPlaying(musicPlayer, &isPlaying) != noErr) I have tried this also (and many other combinations of the same type): Boolean isPlaying = NO I don't get any error, but making this call stops the playback altogether, instead of (as is said in the documentation) continuing playing from the new position. To do that I naturally call: if (MusicPlayerSetTime(musicPlayer, (MusicTimeStamp)0.0) != noErr) I have everything setup, it works, everything's peachy, except when I want to start over the sequence from the start during the playback. I'm using CoreAudio on iOS 5 to play MIDI files.
