Conversation
These changes have been applied and reverted a few times already. This code at least makes the compile work (and also seems to run fine).
This introduces a new Lua function "lmc_set_midi_handler" which can be used to map midi input devices. The devices are managed by a midideviceservice, similar to keyboards and game controllers. The handler function in Lua will receive the midi input data (which is status, data1 and data2). Currently no support for SysEx.
This adds a new lua command that allows the user to send midi notes to a controller. This can be used to e.g. turn on LEDs etc. on the controller (depends on the hardware).
|
Thanks for pull request. Why were you changing uKbdDeviceService? I suppose you have difficulties to compile it but si I have with your changes. Seeing the explicit uRawInput. reference you have added you had multiple decalrations e.g. of PRAWINPUT? |
|
I used Lazarus 1.8.2 FPC 3.0.4 (the current available latest download from the website). I basically just looked at the history and saw that this code was changed back and forth a at least once and basically reversed the last change. That made it compile and it also seems to work. This change is obviously totally unrelated to my addition and I'd rather not have it in here at all, but it was necessary to compile. I am not sure what to do here. I'd be happy to remove/change it in any way as long as everything still works. |
This adds support for midi controllers. Tested using a Behringer CMD LC-1 controller.
Midi events can be mapped (input device support) using
lmc_set_midi_handlerand notes can be sent to the controller (to e.g. set LEDs) vialmc_send_midi_note.I will add more error handling (verifying device types, checking if devices are still there) but wanted to create this request to get some feedback.
I usually don't write Pascal code, so let me know if any coding or naming conventions are off. I tried to stick to the style that was already in the code. Let me know if should change anything.
This addresses #2