From 0e287cc35b5170a4f97597d0c9287bb4387465e2 Mon Sep 17 00:00:00 2001 From: Andrew Madsen Date: Thu, 3 Mar 2016 14:31:19 -0700 Subject: [PATCH] Issue #45: Fixed issue where MIKMIDISequencer would repeatedly process last note in a sequence while recording. --- Source/MIKMIDISequencer.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/MIKMIDISequencer.m b/Source/MIKMIDISequencer.m index 9844c93f..64166339 100644 --- a/Source/MIKMIDISequencer.m +++ b/Source/MIKMIDISequencer.m @@ -279,7 +279,9 @@ - (void)processSequenceStartingFromMIDITimeStamp:(MIDITimeStamp)fromMIDITimeStam MusicTimeStamp calculatedToMusicTimeStamp = [clock musicTimeStampForMIDITimeStamp:toMIDITimeStamp]; BOOL isLooping = (self.shouldLoop && calculatedToMusicTimeStamp > loopStartTimeStamp && loopEndTimeStamp > loopStartTimeStamp); if (isLooping != self.isLooping) self.looping = isLooping; - MusicTimeStamp toMusicTimeStamp = MIN(calculatedToMusicTimeStamp, isLooping ? loopEndTimeStamp : self.sequenceLength); + MusicTimeStamp maxToMusicTimeStamp = self.isRecording ? DBL_MAX : self.sequenceLength; // If recording, don't limit max timestamp (Issue #45) + maxToMusicTimeStamp = isLooping ? loopEndTimeStamp : maxToMusicTimeStamp; + MusicTimeStamp toMusicTimeStamp = MIN(calculatedToMusicTimeStamp, maxToMusicTimeStamp); MIDITimeStamp actualToMIDITimeStamp = [clock midiTimeStampForMusicTimeStamp:toMusicTimeStamp]; // Get relevant tempo events