 
         let status: OSStatus
         if customSysExBufferSize >= 4 {
-            // TODO
-            status = -50
+            // We have a reasonable buffer size value, so use it.
+
+            // First, work around a bug with cheap USB-MIDI interfaces.
+            // If we are sending to a destination that uses a USB-MIDI driver, it packages the bytes of the buffer
+            // into USB-MIDI commands containing exactly 3 bytes of data. If the buffer contains an extra 1 or 2
+            // bytes of data, but the sysex hasn't ended, then the driver has to either (1) hold on to those bytes
+            // and wait for more data to be sent later, or (2) send them immediately as 1-byte "unparsed" USB-MIDI
+            // commands. CoreMIDI's class compliant driver appears to do the latter.
+            // Unfortunately, some interfaces don't understand the 1-byte unparsed MIDI messages, and either
+            // drop them or get confused.
+            // To avoid this issue, round the buffer size down to be a multiple of 3.
+            let actualSysExBufferSize = customSysExBufferSize / 3 * 3
+
+            // Calculate a delay between buffers to get the expected speed:
+            // maxSysExSpeed is in bytes/second (default 3125)
+            // Transmitting B bytes, at speed S, takes a duration of (B/S) sec or (B * 1000 / S) milliseconds.
+            //
+            // Note that MIDI-OX default settings use 256 byte buffers, with 60 ms between buffers,
+            // leading to a speed of 1804 bytes/sec, or 57% of normal speed.
+            let realMaxSysExSpeed = (maxSysExSpeed > 0) ? maxSysExSpeed : 3125
+            let perBufferDelay = Double(actualSysExBufferSize) / Double(realMaxSysExSpeed)  // seconds
+
+            status = customMIDISendSysex(&sysexSendRequest, actualSysExBufferSize, perBufferDelay)
         }
         else {
             // Use CoreMIDI's sender

    static let sysExSendRequestFinished = Notification.Name.sysExSendRequestFinished

}

}

// TODO This notification should maybe just be a delegate method.
public extension Notification.Name {

    static let sysExSendRequestFinished = Notification.Name("SMSysExSendRequestFinishedNotification")
