-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Add MIDI controller device index to InputEventMIDI.device
property.
#86620
Conversation
3770878
to
5715db0
Compare
The co-author didn't apply, you need to make the part in the arrow brackets their email, check out their branch and use |
5715db0
to
e329d19
Compare
Done. Seems to work now. |
Your commit seems not to be linked to your GitHub account. See: Why are my commits linked to the wrong user? for more info. |
e329d19
to
95dabe4
Compare
Fixed. (Apparently I'm as good with github as Sheldon is good with the flute. Eventually I'll get better.) |
This needs to get pushed up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no experience with drivers, but the changes to core are looking correct.
95dabe4
to
d177771
Compare
It is possible to query the OS for the connected MIDI controllers, but the event messages' device field was not being used. This implements controller index being sent in InputEventMIDI messages in the device property, matching the index from OS.get_connected_midi_inputs(). Based on the work done by @ramdor. Closes godotengine/godot-proposals#7733 Co-authored-by: Richie <[email protected]>
d177771
to
b9fd25e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes to core are looking correct.
Can't say anything about the change to drivers.
I can't test the PR, because I don't have MIDI-devices.
InputEventMIDI.device
property.
hi @fbcosentino . I know this has been merged now, based on the changes I was dabbling with a long time ago. However, there are some issues with the coremidi implementation. I built a quick mac test and it seems like the device_index (InputEvent.device) is garbage data. It looks to be caused by line 68 of midi_drive_coremidi.cpp where the pointer to 'i' is being used. This should not be a pointer, but the actual value of 'i'. Otherwise multiple read callbacks will use the same pointer. Also 'i' will go out of scope and result in junk. We need to provide the actual value of i to MIDIPortConnectSource so that when the callback function read is called when midi events come in, src_conn_ref_con is the actual value of i that was provided when MIDIPortConnectSource was called and can be used as device_index. I hope this makes sense. Cheers. |
some test code that does correct type casting :
|
Hi @ramdor ! I actually don't have a mac (nor access to one). Would you be comfortable to make these changes yourself? |
@fbcosentino yes, i have just started a PR. I couldn't test it either, but it should be ok. |
It is possible to query the OS for the connected MIDI controllers, but the event messages' device field was not being used. This implements controller index being sent in InputEventMIDI messages in the device property, matching the index from OS.get_connected_midi_inputs().
Based on the work done by @ramdor in this archived PR
Closes godotengine/godot-proposals#7733