dclelland / Gong

Gong is a MIDI library for iOS and macOS.
MIT License
85 stars 16 forks source link

receive callback for .noteOn message not called when two keys are pressed at the same time #13

Open rafagan opened 2 years ago

rafagan commented 2 years ago

When I press two keyboard keys at the same time, the receive(_ packet: MIDIPacket, from source: MIDISource) is called once for .noteOn, and the same behavior not happen with .noteOff for packet.message.

Any help?

rafagan commented 2 years ago

I think there's something related with MIDIInputPortCreate. This code works well and it uses MIDIInputPortCreateWithProtocol with MIDIProtocolID._1_0.

rafagan commented 2 years ago

The function MIDIInputPortCreate is deprecated:

https://developer.apple.com/documentation/coremidi/1495225-midiinputportcreate

dclelland commented 2 years ago

Hi, haven't used this project in a really long time, but I will take a look at this today

dclelland commented 2 years ago

Ah, I get it. The way my MIDIPacket parser thing works, it is only capable of parsing one message.

https://github.com/dclelland/Gong/blob/master/Sources/Gong/Core/MIDIPacket.swift#L246

Looking at moving everything over to the new methods (MIDIEventPacket et. al.)

Working on this on a branch.

https://github.com/dclelland/Gong/compare/master...update

vrschgn commented 2 years ago

@dclelland Hi! I got the same issue. Is this already fixed in update branch?

dclelland commented 2 years ago

@dclelland Hi! I got the same issue. Is this already fixed in update branch?

Eh, I'm pretty busy these days, I'd say it's unlikely I am going to do this