Skip to content

Commit 045f26f

Browse files
committed
Fix midi packet initilization
1 parent c7fbdc8 commit 045f26f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Source/MIDIEventKit.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ extension Collection where Iterator.Element == MIDIEvent {
2121
var packet = MIDIPacketListInit(packetListPointer)
2222

2323
for midi in this {
24-
packet = MIDIPacketListAdd(packetListPointer, 65536, packet, midi.timestamp.value, midi.event.midiBytes.count, midi.event.midiBytes)
24+
packet = MIDIPacketListAdd(packetListPointer, 1024, packet, midi.timestamp.value, midi.event.midiBytes.count, midi.event.midiBytes)
2525
}
2626

2727
return packetListPointer
@@ -294,8 +294,9 @@ public enum MIDIChannelVoiceEvent: MIDIStatusEvent {
294294
self = .pitchBendChange(
295295
bend: UInt16((dataBytes.data2 << 8) | dataBytes.data1),
296296
channel: channel)
297+
} else {
298+
return nil
297299
}
298-
return nil
299300
}
300301

301302
// MARK: CustomStringConvertible

0 commit comments

Comments
 (0)