{"id":1748,"date":"2021-05-16T09:51:26","date_gmt":"2021-05-16T08:51:26","guid":{"rendered":"https:\/\/ofalcao.pt\/blog\/?p=1748"},"modified":"2021-05-26T11:54:47","modified_gmt":"2021-05-26T10:54:47","slug":"tuxie-mcpython-a-lego-bagpiper-or-at-least-a-noise-machine","status":"publish","type":"post","link":"https:\/\/ofalcao.pt\/blog\/2021\/tuxie-mcpython-a-lego-bagpiper-or-at-least-a-noise-machine","title":{"rendered":"Tuxie McPython &#8211; a LEGO bagpiper (or at least a noise machine)"},"content":{"rendered":"<div class=\"seriesmeta\">This post is part 1 of 5 of \u00a0<a href=\"https:\/\/ofalcao.pt\/blog\/series\/lego-bagpiper\" class=\"series-364\" title=\"LEGO bagpiper\">LEGO bagpiper<\/a><\/div>\n<p>So confination has been tough. One year at home, one year of remodeling and repairing on my building &#8211; a 9 floor building with 36 apartments and it seems many neighbors saw the major repairs as an opportunity to make their own remodeling.<\/p>\n\n\n\n<p>So I almost went crazy (or maybe I already am) and found myself thinking on playing bagpipes on the roof, scaring the falcons that appear at spring near my village (one even made a nest on this building, some years ago). And of course, retaliating to all the noise.<\/p>\n\n\n\n<p>Of course, I don&#8217;t know how to play bagpipes (or any other instrument). I don&#8217;t even own a bagpipe &#8211; just a toy bagpipe that we bought on Scotland on our honeymoon:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/i0.wp.com\/ofalcao.pt\/blog\/wp-content\/uploads\/2021\/05\/image.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"836\" src=\"https:\/\/i0.wp.com\/ofalcao.pt\/blog\/wp-content\/uploads\/2021\/05\/image.png?resize=806%2C836&#038;ssl=1\" alt=\"\" class=\"wp-image-1749\" srcset=\"https:\/\/i0.wp.com\/ofalcao.pt\/blog\/wp-content\/uploads\/2021\/05\/image.png?w=806&amp;ssl=1 806w, https:\/\/i0.wp.com\/ofalcao.pt\/blog\/wp-content\/uploads\/2021\/05\/image.png?resize=289%2C300&amp;ssl=1 289w, https:\/\/i0.wp.com\/ofalcao.pt\/blog\/wp-content\/uploads\/2021\/05\/image.png?resize=768%2C797&amp;ssl=1 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a><\/figure>\n\n\n\n<p>It&#8217;s not a proper bagpipe, the drones are false and the bag looses air but the chanter (the long tube at right with a reed inside that makes a hell of a noise when air passes through it) works and is also detachable so I use it as a sort of practice chanter (the reed inside is also replaceable).<\/p>\n\n\n\n<p>Almost 2 years ago I already tried to fill this bagpipes with my brute-force LEGO air compressor:<\/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 air compressor with bagpipes v0.01\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/zMCJygdhVdo?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>but it needs a lot of air and it also needs somone to squeeze the bag. I am too lazy for that.<\/p>\n\n\n\n<p>But I read a lot. And found people making their own bagpipes with plastic bags, rubber or latex gloves and even balloons&#8230; like these dudes that use a melodica and 2 human slaves to pump air into the balloon:<\/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=\"&quot;Amazing Grace&quot; by Bike Pump and Balloon Powered Bagpipe Melodica\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/CzVuEzyjrvI?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>So I decided to try my own robotic LEGO bagpiper proof of concept. I just needed enough air, a balloon and a chanter so I ordered a practice chanter (more affordable than an usual  bagpipes chanter and a bit easier to play because usally it requires less air pressure).<\/p>\n\n\n\n<p>And the first attempt looked promising:<\/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 air compressor with bagpipes v0.02\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/7vbCoiWDFW0?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 then all the usual problems on a proof of concept project started \ud83d\ude42<\/p>\n\n\n\n<p>First thing I found was that LEGO pneumatic tubes aren&#8217;t large enough to supply enough air fast enough for the reed inside the chanter to play. So the last tube, connecting the balloon to the chanter&#8217;s mouth piece, had to be replaced by aquarium tube (1 or 2 mm wider than LEGO&#8217;s).<\/p>\n\n\n\n<p>The same applies to LEGO pneumatic switches (valves). If I want to control the flow I need a custom valve. I can squeeze the tube or I can bend it (like Nico71 does on his &#8220;<a href=\"https:\/\/www.nico71.fr\/lego-pneumatic-switchless-engine-new-valve-design\/\" data-type=\"URL\" data-id=\"https:\/\/www.nico71.fr\/lego-pneumatic-switchless-engine-new-valve-design\/\">Lego Pneumatic Switchless Engine \u2013 New Valve Design<\/a>&#8220;).<\/p>\n\n\n\n<p>I also needed a larger balloon &#8211; softer than the first I used so less pressure needed from the air compressor side.<\/p>\n\n\n\n<p>And finally a needed a better air compressor. 4 MINDSTORMS motors acting over 8 large Technic pneumatic pumps wasn&#8217;t enough (and also makes a lot of noise &#8211; I want most noise to be from the bagpipes).<\/p>\n\n\n\n<p>Luckily I already had a <a href=\"https:\/\/www.lpepower.com\/products\/sys-inline-3-engine\" data-type=\"URL\" data-id=\"https:\/\/www.lpepower.com\/products\/sys-inline-3-engine\">LPEpower SYS Inline 3 engine<\/a>  I used on my last LUG event. It&#8217;s an air engine &#8211; you inject compressed air and get mechanic rotation &#8211; but it can be reverse used (probably with less efficiency).<\/p>\n\n\n\n<p>So my first attempt evolved to this:<\/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 bagpipes v0.04\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/37_fspAzRw0?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>The SYS Inline 3 engine was using a LEGO Power Functions L motor but I felt that I could obtain better results if I applied more power&#8230; so I added a second motor and used gears to combine the power (and also rotate it a bit more faster). That resulted in almost a minute of &#8220;playing&#8221;, not bad. But also showed up a new problem: too much air pressure on the reed makes it block, not generating any sound and also making the balloon accumulate even more air. For now, as I am not yet controllong the flow, my only option is manually reducing the air flow from the air compressor.<\/p>\n\n\n\n<p>With a powerful compressor I added the first &#8220;fingers&#8221; using stick tack to close the chanter holes:<\/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 bagpipes v0.05\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/bOqYjTRgqLk?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>Not good but it was a start.<\/p>\n\n\n\n<p>So I searched my LEGO spare parts after something that could close the hole and I found 2 similar parts (images are from <a href=\"https:\/\/www.bricklink.com\/\">Bricklink<\/a> site):<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/i0.wp.com\/ofalcao.pt\/blog\/wp-content\/uploads\/2021\/05\/image-2.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"192\" height=\"156\" src=\"https:\/\/i0.wp.com\/ofalcao.pt\/blog\/wp-content\/uploads\/2021\/05\/image-2.png?resize=192%2C156&#038;ssl=1\" alt=\"\" class=\"wp-image-1751\"\/><\/a><figcaption>LEGO minifig microphone (90370)<\/figcaption><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/i0.wp.com\/ofalcao.pt\/blog\/wp-content\/uploads\/2021\/05\/image-1.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"192\" height=\"142\" src=\"https:\/\/i0.wp.com\/ofalcao.pt\/blog\/wp-content\/uploads\/2021\/05\/image-1.png?resize=192%2C142&#038;ssl=1\" alt=\"\" class=\"wp-image-1750\"\/><\/a><figcaption>LEGO Technic pin with towball (6628)<\/figcaption><\/figure><\/div>\n\n\n\n<p>The microphone is a bit smaller than the towball so I used it for the smaller holes on the chanter (the higher pitch notes). Also used a motor to controlling the finger for the first time &#8211; so finally we have some Python to explain McPython&#8217;s name:<\/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 bagpipes v0.06\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/FLKmxiWNNuQ?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>It seemed OK so I added the rest of the fingers (7 fingers upside, 1 thumb downside). <br>With 8 Large Powered Up motors (from Volvo set or SPIKE \/ Robotic Inventor sets) and 2 Control+ hubs running Pybricks Tuxie McPython has reached Proof of Concept level:<\/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 bagpipes v0.08\" width=\"840\" height=\"473\" src=\"https:\/\/www.youtube.com\/embed\/kiK8nG23GJk?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>So for Alpha Release level this is the roadmap:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>coordinate the fingers &#8211; that requires me to control the 2 Control+ hubs so I will use Jupyter Notebook<\/li><li>control the air flow &#8211; that requires a custom valve to squeeze the aquarium tube, a pressure sensor to check the balloon&#8217;s current state and some sort of relay to turn the compressor power ON or OFF (so a MINDSTORMS EV3 will join soon, explaining the Tuxie name)<\/li><li>learn basic bagpipes music &#8211; by far the toughest part (but my wife already started helping me converting music scores to notes and temporizations)<\/li><\/ul>\n\n\n\n<p>Not sure if I deal with it now but also a stronger air compressor will be needed on the long run that allows Tuxie McPython to play for at least 2 minutes (time enough to drive everyone crazy before the police arrives)<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"seriesmeta\">This post is part 1  of 5 of \u00a0<a href=\"https:\/\/ofalcao.pt\/blog\/series\/lego-bagpiper\" class=\"series-364\" title=\"LEGO bagpiper\">LEGO bagpiper<\/a><\/div><p>So confination has been tough. One year at home, one year of remodeling and repairing on my building &#8211; a 9 floor building with 36 apartments and it seems many neighbors saw the major repairs as an opportunity to make their own remodeling. So I almost went crazy (or maybe I already am) and found &hellip; <a href=\"https:\/\/ofalcao.pt\/blog\/2021\/tuxie-mcpython-a-lego-bagpiper-or-at-least-a-noise-machine\" class=\"more-link\">Continuar a ler<span class=\"screen-reader-text\"> &#8220;Tuxie McPython &#8211; a LEGO bagpiper (or at least a noise machine)&#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":[365,276,366],"series":[364],"class_list":["post-1748","post","type-post","status-publish","format-standard","hentry","category-sem-categoria","tag-bagpipes","tag-music","tag-pneumatic","series-lego-bagpiper"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2Mhyv-sc","_links":{"self":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1748","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=1748"}],"version-history":[{"count":0,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/posts\/1748\/revisions"}],"wp:attachment":[{"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/media?parent=1748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/categories?post=1748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/tags?post=1748"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/ofalcao.pt\/blog\/wp-json\/wp\/v2\/series?post=1748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}