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

[Bug] MIDI data not received by keyboard #19046

Closed
2 tasks
samesimilar opened this issue Nov 13, 2022 · 3 comments
Closed
2 tasks

[Bug] MIDI data not received by keyboard #19046

samesimilar opened this issue Nov 13, 2022 · 3 comments

Comments

@samesimilar
Copy link

Describe the Bug

I have enabled MIDI in my firmware build, and I can successfully send MIDI from my keyboard over USB to my computer.
I also expect to be able to send MIDI from my computer to the keyboard.

  • The keyboard shows up as a MIDI output device on my computer
  • I have registered MIDI callbacks for receiving data.
  • MIDI_ENABLE = yes in my rules.mk

Observed:
The callback function usb_get_midi never receives MIDI data from the recv_midi_packet function.

Keyboard Used

wilba_tech/rama_works_m50_a

Link to product page (if applicable)

No response

Operating System

macOS 12.5.1

qmk doctor Output

No response

Is AutoHotKey / Karabiner installed

  • AutoHotKey (Windows)
  • Karabiner (macOS)

Other keyboard-related software installed

No response

Additional Context

I was able to resolve the bug for myself by changing the following line in tmk_core/protocol/lufa/lufa.c from:

ConfigSuccess &= Endpoint_ConfigureEndpoint((MIDI_STREAM_OUT_EPNUM | ENDPOINT_DIR_IN), EP_TYPE_BULK, MIDI_STREAM_EPSIZE, 1);

to:

ConfigSuccess &= Endpoint_ConfigureEndpoint((MIDI_STREAM_OUT_EPNUM | ENDPOINT_DIR_OUT), EP_TYPE_BULK, MIDI_STREAM_EPSIZE, 1);

It seems to me that the incorrect ENDPOINT direction was selected in this configuration in the upstream codebase. Changing it makes MIDI input work and I can now process MIDI on the keyboard. But I am not sure if the original configuration was intentional or a bug, so I wanted to share it in case someone else has the same problem as me!

@zvecr
Copy link
Member

zvecr commented Nov 13, 2022

Already fixed by #18654

@zvecr zvecr closed this as completed Nov 13, 2022
@qiji102
Copy link

qiji102 commented Jan 16, 2024

I am currently able to send MIDI information from the keyboard to the computer, but now I want to send data from the computer to the keyboard to control RGB lights. The documentation for MIDI reception in QMK is insufficient, and I would like to know how to implement the code for receiving and processing MIDI data.

@nezumee
Copy link
Contributor

nezumee commented Feb 16, 2024

I am currently able to send MIDI information from the keyboard to the computer, but now I want to send data from the computer to the keyboard to control RGB lights.

You can try something like https://github.com/nezumee/qmk_firmware/tree/4x4/keyboards/4x4/keymaps/midi-controller (code is a bit old, hopefully it still works). The code for processing midi events is in midi-feedback.c, setting RGB LEDs is in rgb_matrix_user.inc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants