             if names?.count ?? 0 > virtualPortIndex, let portName = names?[virtualPortIndex] {
                 virtualPortName = portName
             } else {
-               virtualPortName = String("\(clientName) \(unnamedPortIndex)")
-               unnamedPortIndex += 1
-           }
+                virtualPortName = String("\(clientName) \(unnamedPortIndex)")
+                unnamedPortIndex += 1
+            }
 
             if uniqueIDs?.count ?? 0 > virtualPortIndex, let portID = uniqueIDs?[virtualPortIndex] {
                 uniqueID = portID
             } else {
                 uniqueID = 2_000_000 + unIDPortIndex
                 unIDPortIndex += 2
-           }
-
-            let result = MIDIDestinationCreateWithBlock(
-            client,
-            virtualPortName as CFString,
-            &virtualInputs[virtualPortIndex]) { packetList, _ in
-                for packet in packetList.pointee {
-                    // a Core MIDI packet may contain multiple MIDI events
-                    for event in packet {
-                        self.handleMIDIMessage(event, fromInput: uniqueID)
-                    }
-                }
             }
 
+            let result = MIDISourceCreate(client, virtualPortName as CFString, &virtualOutputs[virtualPortIndex])
             if result == noErr {
-                MIDIObjectSetIntegerProperty(virtualInputs[virtualPortIndex], kMIDIPropertyUniqueID, uniqueID)
+                MIDIObjectSetIntegerProperty(virtualOutputs[virtualPortIndex], kMIDIPropertyUniqueID, uniqueID)
             } else {
-                Log("Error \(result) Creating Virtual Input Port: \(virtualPortName) -- \(virtualInputs[virtualPortIndex])",
-                log: OSLog.midi, type: .error)
+                Log("Error \(result) Creating Virtual Output Port: \(virtualPortName) -- \(virtualOutputs[virtualPortIndex])",
+                    log: OSLog.midi, type: .error)
                 CheckError(result)
             }
         }

            }
            virtualInputs.append(0)
            return true
            }
        return false
    }


    ///   - names: Optional list of names
    public func createVirtualInputPorts(count: Int = 1, uniqueIDs: [Int32]? = nil, names: [String]? = nil) {
        destroyVirtualInputPort()
        guard count > 0 else {
            return Log("Error: Number of port to create can't be less than one)", log: OSLog.midi, type: .error)
        }

        var unnamedPortIndex = 1
        var unIDPortIndex: Int32 = 0
