This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Implementing a class-compliant USB MIDI device

Hi everyone,

I'm trying to developp a MIDI USB class compliant device with the nrf52840 DK.

I'm beginner about USB developpement and I have only basics about MIDI class definition.

I'm trying to modify the usbd_audio example of the SDK 15.1 to describe my MIDI class. Unfortunately, I'm not sure that I understand how the Audio class module works, especially the macro APP_USBD_AUDIO_MIDI_STREAMING_DSC and APP_USBD_AUDIO_GLOBAL_DEF and how to manage them to fully describe my MIDI class.

Do you have an example ? If not, what is the best way to implement this feature ? For the moment, I just need that my computer detect my device as MIDI device and send a MIDI control change to my PC from my developpement board.

Thank you in advance,

Mathieu

  • Hello,

    Sorry for the late reply. I spoke to one of the guys who worked with the USB implementation on the nRF52840. He says that they didn't have time to implement a midi-example, but everything needed should be there to set it up.

    But, as I mentioned, we don't have an example doing this.

    I suggest that you start by testing the USBD audio example, as described here.

    Then look for the APP_USBD_AUDIO_GLOBAL_DEF() for the microphone in main.c.

    APP_USBD_AUDIO_GLOBAL_DEF(m_app_audio_microphone,
    MIC_INTERFACES_CONFIG(),
    mic_audio_user_ev_handler,
    &mic_form_desc,
    &mic_inp_desc,
    &mic_out_desc,
    &mic_fea_desc,
    0,
    APP_USBD_AUDIO_AS_IFACE_FORMAT_PCM,
    192,
    APP_USBD_AUDIO_SUBCLASS_AUDIOSTREAMING
    );

    You would at least want to change this to be a midi.

    change:

    APP_USBD_AUDIO_SUBCLASS_AUDIOSTREAMING to APP_USBD_AUDIO_SUBCLASS_MIDISTREAMING

    then you need to change all the mic_defines to MIDI defines. Exactly which one, I am not sure. You will have to read up on how MIDI over USB works.

    Best regards,

    Edvin

  • Hi,

    Can you possibly give any more advice on getting usb midi to work. I'm stumped by it.

    Thanks

    Tim

  • Hello Tim,

    I am sorry, I haven't looked much into the USB MIDI since I last answered on this thread. Did you try to change the implementation to MIDI? Maybe made some progress?

  • Hi Edvin,

    Yes, tried to change it to midi streaming, but cant at at the moment work out how to fix the corresponding descriptions.

  • Hello,

    Please create a new ticket where you describe your progress and issues with the MIDI implementation.

    BR,

    Edvin

Related