{"id":385,"date":"2022-02-18T21:50:57","date_gmt":"2022-02-18T21:50:57","guid":{"rendered":"https:\/\/doctea.co.uk\/blog\/?p=385"},"modified":"2022-02-19T13:54:56","modified_gmt":"2022-02-19T13:54:56","slug":"arturia-beatstep-not-sending-or-receiving-midi-data-and-clock-with-arduino-usb_host_shield_2-0-library","status":"publish","type":"post","link":"https:\/\/doctea.co.uk\/blog\/code\/arturia-beatstep-not-sending-or-receiving-midi-data-and-clock-with-arduino-usb_host_shield_2-0-library\/","title":{"rendered":"Arturia Beatstep not sending or receiving MIDI data and clock with Arduino USB_Host_Shield_2.0 library"},"content":{"rendered":"\n<p>Got a gig coming up and wanted to avoid using my entire <a href=\"https:\/\/github.com\/doctea\/drum2musocv\/\">drum2musocv<\/a> system.  &#8220;I know&#8221;, I thought, &#8220;I&#8217;ll use that <a href=\"https:\/\/uk.banggood.com\/USB-Host-Shield-Compatible-For-Google-Android-ADK-Support-U-NO-MEGA-Module-p-1384907.html\" data-type=\"URL\" data-id=\"https:\/\/uk.banggood.com\/USB-Host-Shield-Compatible-For-Google-Android-ADK-Support-U-NO-MEGA-Module-p-1384907.html\">Arduino USB host shield<\/a> that I&#8217;ve got lying around to make a simple device to sync my Arturia Beatstep and add some CV clock pulse outs, too.  Should be easy!&#8221;<\/p>\n\n\n\n<p>But after getting the USB Host Shield working (eventually), I found that the Beatstep wasn&#8217;t receiving any data, even though the library was detecting and identifying it perfectly.  After asking on a thread with similar symptoms (<a href=\"https:\/\/github.com\/YuuichiAkagawa\/USBH_MIDI\/issues\/73\">https:\/\/github.com\/YuuichiAkagawa\/USBH_MIDI\/issues\/73<\/a>) and applying the two-line fix by the author, I was getting MIDI notes and CC info transferring both ways, but still not MIDI clock.<\/p>\n\n\n\n<p>Turns out that this is already solved in a pull request to the USB Host Shield library that is waiting to be merged into release: <a href=\"https:\/\/github.com\/felis\/USB_Host_Shield_2.0\/pull\/438\">https:\/\/github.com\/felis\/USB_Host_Shield_2.0\/pull\/438<\/a><\/p>\n\n\n\n<p>Since I couldn&#8217;t find any mention of this problem on Google, I thought I&#8217;d post this, in case it helps anyone else who runs into the same problem that I did.<\/p>\n\n\n\n<p>Quick instructions for anyone who needs to patch their library:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>cd libraries\/USB_Host_Shield_2.0<\/p><p>wget&nbsp;<a href=\"https:\/\/patch-diff.githubusercontent.com\/raw\/felis\/USB_Host_Shield_2.0\/pull\/438.patch\">https:\/\/patch-diff.githubusercontent.com\/raw\/felis\/USB_Host_Shield_2.0\/pull\/438.patch<\/a><\/p><p>patch -p1 &lt; 438.patch<\/p><\/blockquote>\n\n\n\n<p><strong>The final piece of the puzzle:<\/strong> the Beatstep won&#8217;t respond to MIDI clock unless it has also already received an external MIDI start message &#8211; pressing its own start button isn&#8217;t enough!<\/p>\n\n\n\n<p>Proof of concept code at <a href=\"https:\/\/github.com\/doctea\/usb_midi_clocker\">https:\/\/github.com\/doctea\/usb_midi_clocker<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Hope this helps someone!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Got a gig coming up and wanted to avoid using my entire drum2musocv system. &#8220;I know&#8221;, I thought, &#8220;I&#8217;ll use that Arduino USB host shield that I&#8217;ve got lying around to make a simple device to sync my Arturia Beatstep and add some CV clock pulse outs, too. Should be easy!&#8221; But after getting the USB Host Shield working (eventually), I found that the Beatstep wasn&#8217;t receiving any data, even though the library was detecting and identifying it perfectly. After asking on a thread with similar symptoms (https:\/\/github.com\/YuuichiAkagawa\/USBH_MIDI\/issues\/73) and applying the two-line fix by the author, I was getting MIDI notes and CC info transferring both ways, but still not MIDI clock. Turns out that this is already solved in a pull request to the USB Host Shield library that is waiting to be merged into release: https:\/\/github.com\/felis\/USB_Host_Shield_2.0\/pull\/438 Since I couldn&#8217;t find any mention of this problem on Google, I thought I&#8217;d post this, in case it helps anyone else who runs into the same problem that I did. Quick instructions for anyone who needs to patch their library: cd libraries\/USB_Host_Shield_2.0 wget&nbsp;https:\/\/patch-diff.githubusercontent.com\/raw\/felis\/USB_Host_Shield_2.0\/pull\/438.patch patch -p1 &lt; 438.patch The final piece of the puzzle: the Beatstep won&#8217;t respond to MIDI clock unless it has also already received an external MIDI start message &#8211; pressing its own start button isn&#8217;t enough! Proof of concept code at https:\/\/github.com\/doctea\/usb_midi_clocker Hope this helps someone!<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67,87],"tags":[],"class_list":["post-385","post","type-post","status-publish","format-standard","hentry","category-code","category-electronics"],"_links":{"self":[{"href":"https:\/\/doctea.co.uk\/blog\/wp-json\/wp\/v2\/posts\/385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doctea.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/doctea.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/doctea.co.uk\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/doctea.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=385"}],"version-history":[{"count":3,"href":"https:\/\/doctea.co.uk\/blog\/wp-json\/wp\/v2\/posts\/385\/revisions"}],"predecessor-version":[{"id":390,"href":"https:\/\/doctea.co.uk\/blog\/wp-json\/wp\/v2\/posts\/385\/revisions\/390"}],"wp:attachment":[{"href":"https:\/\/doctea.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/doctea.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/doctea.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}