Skip to content

Commit

Permalink
Issue #45: Fixed issue where MIKMIDISequencer would repeatedly proces…
Browse files Browse the repository at this point in the history
…s last note in a sequence while recording.
  • Loading branch information
Andrew Madsen committed Mar 3, 2016
1 parent e9c6703 commit 0e287cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Source/MIKMIDISequencer.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0e287cc

Please sign in to comment.