Skip to content

Commit 65d4203

Browse files
committed
Revise existing code for AudioKit/AudioKit#2955
1 parent bfc2dfa commit 65d4203

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/AudioKitEX/Sequencing/Sequence.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public struct NoteEventSequence: Equatable {
8787
channel: MIDIChannel = 0,
8888
position: Double,
8989
duration: Double) {
90-
totalDuration += duration
90+
totalDuration = max(totalDuration, position + duration) // Get last note in the track + its duration
9191
var newNote = SequenceNote()
9292

9393
newNote.noteOn.status = noteOnByte

0 commit comments

Comments
 (0)