{"id":1787,"date":"2021-08-09T08:59:23","date_gmt":"2021-08-09T07:59:23","guid":{"rendered":"https:\/\/ofalcao.pt\/blog\/?p=1787"},"modified":"2021-08-09T09:01:28","modified_gmt":"2021-08-09T08:01:28","slug":"lego-midi-percussion-toolkit","status":"publish","type":"post","link":"https:\/\/ofalcao.pt\/blog\/2021\/lego-midi-percussion-toolkit","title":{"rendered":"LEGO MIDI Percussion Toolkit"},"content":{"rendered":"\n<p>Serching for &#8220;MIDI&#8221; + &#8220;percussion&#8221; + &#8220;LEGO&#8221; is training my search engine cookies. A few weeks ago I found this video of &#8220;Dada Machines&#8221; kickstarter campaign:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"dadamachines - automat toolkit - kickstarter video\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/YE7XhlgnaEQ?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Such a great idea! I already knew about commercial MIDI adapter for playing just one drum and several &#8220;makers&#8221; or DIY projects using Arduinos and servo motors but Dada Machines idea of selling pre-made &#8220;modules&#8221; make things much more &#8220;clean&#8221; and interesting &#8211; each module can work as a solenoid or a mallet and can even be adapted to fit LEGO elements with studs so it really looks &#8220;plug and play&#8221;.<\/p>\n\n\n\n<p>Now let&#8217;s think more about it:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>a MIDI controller with several outputs is something I already been doing, a Technic Hub has 4 ports, looks like a nice start&#8230; and it can scale out quite well as I already found out with the LEGO Bagpiper<\/li><li>there are so many ways of mounting LEGO Technic&#8230; a few &#8220;actuator modules&#8221; look very feasible<\/li><li>and some of those percussion instruments on the video look really possible to achieve with LEGO parts (yes, that table with marbles, I am looking at you!)<\/li><\/ul>\n\n\n\n<p>But I was on holidays and had not enough Technic parts with me for a proof of concept (&#8220;I knew I should have brought more LEGO!&#8221;) so had to wait until back home.<\/p>\n\n\n\n<p>I decided to use a BOOST motor for a solenoid-like module and copied Yoshihito Isogawa &#8216;Reciprocating Mechanism #63&#8217; from his excellent <a href=\"https:\/\/nostarch.com\/ev3ideabook\" data-type=\"URL\" data-id=\"https:\/\/nostarch.com\/ev3ideabook\">&#8220;The LEGO MINDSTORMS EV3 Idea Book&#8221;<\/a>. And since I had 2 of this motors available and a also a City Hub&#8230;<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"LEGO MIDI Percussion Toolkit v0.1\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/V6TmUUj8Ic0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Then I found myself picking up all kind of objects at home to see how they sound when &#8220;banged&#8221; with those solenoids (&#8220;boy, this is addictive!&#8221;).  I went to my #2 kid and took back those IKEA BYGGLEK boxes he was no longer using&#8230; nice sound, but for a drum-like sound a mallet actuator is better&#8230; and a stronger and faster  motor is also better&#8230; so the second version of the Percussion Toolkit needed a more powerful hub for all those power bangs&#8230; and also found enough GBC balls to make that percussion table from Dada Machines:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"LEGO MIDI Percussion Toolkit v0.2\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/IJCxd7Nb3ys?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Then I focused a little more on the software side. I was already parsing a MIDI stream and playing each percussion instrument according to the MIDI event I wanted (like &#8220;Note on 9 35&#8221; i.e. &#8220;Acoustic Drum&#8221; because on the MIDI Percussion Channel each note is mapped to a specific instrument) but without the remaining instruments most musics I played sounded very strange. So I wanted to split the MIDI stream in two &#8211; the percussion instruments would be parsed by the current setup and the remaining instruments would be forwarded to a Synth so I could listen them in a speaker.<\/p>\n\n\n\n<p>Turns out this is very easy to achieve in linux with &#8216;qmidiroute&#8217;.<\/p>\n\n\n\n<p>So after some minor adjustments and the addition of  a fourth instrument, I now have a 4-instrument 100% LEGO MIDI Percussion Toolkit:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"PercussionToolKit v0.3.1 - the 4 instruments and a demo\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/EGJ1ZUnht8I?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>And all the micropython and python and bash scripts are available: <a href=\"https:\/\/github.com\/JorgePe\/randomideas\/tree\/master\/MIDI-Percussion-Kit\">https:\/\/github.com\/JorgePe\/randomideas\/tree\/master\/MIDI-Percussion-Kit<\/a><\/p>\n\n\n\n<p>As soon as I get more hubs will try to scale it out (the U2&#8217;s Sunday Bloody Sunday song uses 5 percussion instruments and I now have this crazy idea that a basic bass would sound great with Queen&#8217;s Another One Bites the Dust).<\/p>\n\n\n\n<p>Then I will try to settle down on a few modules standard so this can be adapted easily to other instruments.<\/p>\n\n\n\n<p>Then&#8230; I know&#8230; the software needs some attention.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Serching for &#8220;MIDI&#8221; + &#8220;percussion&#8221; + &#8220;LEGO&#8221; is training my search engine cookies. A few weeks ago I found this video of &#8220;Dada Machines&#8221; kickstarter campaign: Such a great idea! I already knew about commercial MIDI adapter for playing just one drum and several &#8220;makers&#8221; or DIY projects using Arduinos and servo motors but Dada &hellip; <a href=\"https:\/\/ofalcao.pt\/blog\/2021\/lego-midi-percussion-toolkit\" class=\"more-link\">Continuar a ler<span class=\"screen-reader-text\"> &#8220;LEGO MIDI Percussion Toolkit&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[1],"tags":[279,362],"series":[],"class_list":["post-1787","post","type-post","status-publish","format-standard","hentry","category-sem-categoria","tag-midi","tag-pybricks"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2Mhyv-sP","_links":{"self":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1787","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/comments?post=1787"}],"version-history":[{"count":0,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1787\/revisions"}],"wp:attachment":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/media?parent=1787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/categories?post=1787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/tags?post=1787"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/series?post=1787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}