Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoreMIDI: Fix time delta for messages within same MIDI packet #331

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

markovicpp
Copy link

Single MIDI packet can contain multiple MIDI messages.
The first message within the packet has time delta relative to previous MIDI packet, but remaining MIDI messages have time delta 0 relative to the first message.

@markovicpp
Copy link
Author

Using cmidiin test as a listener on virtual port, then sending 2 note ons (64, 68) followed by 2 note offs after a second could be delivered in 2 MIDI packets, each having 2 messages.

Byte 0 = 144, Byte 1 = 64, Byte 2 = 127, stamp = 0
Byte 0 = 144, Byte 1 = 68, Byte 2 = 127, stamp = 0

Byte 0 = 128, Byte 1 = 64, Byte 2 = 127, stamp = 1.00275
Byte 0 = 128, Byte 1 = 68, Byte 2 = 127, stamp = 1.00275

The last stamp is incorrect and should be 0.

@garyscavone garyscavone merged commit 07d1df3 into thestk:master Feb 8, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants