Getting to grips with the USB Host Shield Library #11
-
Hi, I've got some experience with USB MIDI having developed the MistralXG project back in 2009. I'm still playing with MIDI a little and have been programming ESP devices for a few years. I'm just starting to play with the USB Host Shield 2.0 library and found your great projects. My initial task is to get familiar with the library - I'm finding the documentation a bit sparse and the examples seem very basic. I thing i noticed was that at line 112 of usbMidiHost.ino you say, "/* this function comes from the USB Midi example of the library */" in what looks like a way to get the current USB status, but I see no similar code in any of the MIDI examples - can you provide a pointer, please? I'm guessing you've done it all the hard way, by experimentation, so well done - I guess I'm going to have to do that too! Cheers, Steve |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, thank you very much for opening the discussion. Regarding line 112; I think it comes from https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/USBH_MIDI/USBH_MIDI_dump/USBH_MIDI_dump.ino line 44 ff. There is no check regarding the UsbTaskState but it does call Usb.Task and UsbMidi_Poll(). I've added a lot of output to get information about what is currently going on. Hope this project does still work. Did you try the USB host functionality of the ESP32 S2, S3? It may work without the USB shield, but I didn't found enough time to take a look at it yet. |
Beta Was this translation helpful? Give feedback.
Hi, thank you very much for opening the discussion. Regarding line 112; I think it comes from https://github.com/felis/USB_Host_Shield_2.0/blob/master/examples/USBH_MIDI/USBH_MIDI_dump/USBH_MIDI_dump.ino line 44 ff. There is no check regarding the UsbTaskState but it does call Usb.Task and UsbMidi_Poll(). I've added a lot of output to get information about what is currently going on. Hope this project does still work.
I moved some stuff into the library to avoid having a copy of this file in each project: https://github.com/marcel-licence/ML_SynthTools/blob/main/src/usbMidiHost.h
If it still works it would be easy to integrate in each synth project by setting up the MIDI_VIA_USB_ENABLED d…