{"id":1357,"date":"2014-08-01T14:01:29","date_gmt":"2014-08-01T13:01:29","guid":{"rendered":"http:\/\/www.interactiveclassroom.net\/?p=1357"},"modified":"2014-08-01T14:01:29","modified_gmt":"2014-08-01T13:01:29","slug":"let-it-go-let-it-go-some-raspberry-pi-music","status":"publish","type":"post","link":"https:\/\/www.interactiveclassroom.net\/?p=1357","title":{"rendered":"&#8220;Let it Go, Let it Go . . .&#8221; Some Raspberry Pi Music"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-1358\" src=\"http:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/WP_20140801_006-300x225.jpg\" alt=\"Frozen - Let it Go on Raspberry Pi\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/WP_20140801_006-300x225.jpg 300w, https:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/WP_20140801_006-1024x768.jpg 1024w, https:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/WP_20140801_006.jpg 1632w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>As some of you may be aware, when I&#8217;m not doing geeky things I am learning to play the piano. Having recently passed my Grade 3 exam I decided to work on something fun over the summer; so I chose &#8216;Let it Go&#8217; from the Disney film Frozen in hope that this would win me some brownie points with my young nieces next time they visit!<\/p>\n<p>Much to my delight, I also recently discovered a new\u00a0piece of software on the Raspberry Pi, called <a href=\"http:\/\/www.cl.cam.ac.uk\/projects\/raspberrypi\/sonicpi\/index.html\" target=\"_blank\">Sonic Pi<\/a> (I&#8217;m using <a href=\"http:\/\/sonic-pi.net\/get-v2.0\" target=\"_blank\">V2.0<\/a>). Brilliant! I can combine both my hobbies into one! After watching a lovely <a href=\"https:\/\/www.youtube.com\/watch?v=ixn6d4qSK5I\" target=\"_blank\">intro video by Carrie Anne Philbin<\/a> and reading a few tutorials, I understood the idea of how it worked and decided to set myself a challenge! This was to construct &#8216;Let it Go&#8217; within Sonic Pi and as it also allows multiple threads to run at once, I was able to put together both the left and right hand sections of the piece and I&#8217;m really pleased with the end result:<\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-1357-1\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/mpeg\" src=\"http:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/FrozenRecording.mp3?_=1\" \/><a href=\"http:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/FrozenRecording.mp3\">http:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/FrozenRecording.mp3<\/a><\/audio>\n<p>&nbsp;<\/p>\n<p>This was a nice task to complete as it enabled me to discover some\u00a0of the key features of Sonic Pi such as:<\/p>\n<ul>\n<li>Variables<\/li>\n<li>Loops<\/li>\n<li>Functions<\/li>\n<li>Threads (to run two functions at the same time)<\/li>\n<\/ul>\n<p>You can see a snippet of the interface of Sonic Pi below, as you can see it has a simple and clean layout which makes it really easy to get started. Sometimes children can be overwhelmed if software has lots of menus and buttons but they shouldn&#8217;t have any problem with this!<\/p>\n<p><a href=\"http:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/WP_20140801_007.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1362 size-large\" src=\"http:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/WP_20140801_007-1024x768.jpg\" alt=\"Sonic Pi Let it Go Frozen by Nicki Cooper\" width=\"640\" height=\"480\" srcset=\"https:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/WP_20140801_007-1024x768.jpg 1024w, https:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/WP_20140801_007-300x225.jpg 300w, https:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/WP_20140801_007.jpg 1632w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>To play the notes, you simply give the program the MIDI\u00a0number for each note (eg. Middle C &#8211; 60) and the timings. The table below\u00a0gives the corresponding MIDI numbers for each note:<\/p>\n<p><a href=\"http:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/Midi-Numbers.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1360\" src=\"http:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/Midi-Numbers.jpg\" alt=\"Midi Numbers\" width=\"563\" height=\"486\" srcset=\"https:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/Midi-Numbers.jpg 563w, https:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/Midi-Numbers-300x258.jpg 300w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/><\/a><\/p>\n<p>You can download a copy of my\u00a0<a href=\"http:\/\/www.interactiveclassroom.net\/wp-content\/uploads\/2014\/08\/Frozen.txt\" target=\"_blank\">source code here<\/a>. Apologies for the lack of commenting in my code, however if you&#8217;re familiar with any programming language you can probably decipher it fairly easily!<\/p>\n<p>It wasn&#8217;t all plain-sailing though . . . Many of the resources for Sonic Pi I found online are for version 1, so I had a few issues at first until I discovered the built-in help which proved to be invaluable for providing examples of syntax and formatting. Another issue I had was that\u00a0once I added my second thread to play the left hand part my Pi really struggled and Sonic Pi threw a lot of timing errors at me saying it &#8220;couldn&#8217;t keep up&#8221; and sounded awful as many of the notes became misaligned! I was a bit concerned at this point that all my hard work was in vain but after overclocking my Pi to Turbo Mode it worked nicely!\u00a0<a href=\"http:\/\/www.maketecheasier.com\/overclock-raspberry-pi\/\" target=\"_blank\">Here is a guide<\/a> on how to do this.<\/p>\n<p>I should also credit the source of the sheet music, which was the easier version of the song transcribed by Joyce Leong, for this and more sheet music check out her <a href=\"http:\/\/joycemusic1.com\/downloads\/\" target=\"_blank\">excellent website<\/a>. (Note, I only went up to page 3 for this activity).<\/p>\n<p>For a Getting Started guide to SonicPi V.20 check out the resources from the <a href=\"http:\/\/www.raspberrypi.org\/learning\/sonic-pi-2-taster\/\" target=\"_blank\">Raspberry Pi Foundation<\/a>.<\/p>\n<p>I&#8217;m really looking forward to trying this out with some of my students in September, I think this is something that will really engage them and if I notice any budding virtuosos then maybe I&#8217;ll enter them into the <a href=\"http:\/\/www.raspberrypi.org\/sonic-pi-competition\/\" target=\"_blank\">Sonic Pi Competition<\/a>\u00a0as well!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As some of you may be aware, when I&#8217;m not doing geeky things I am learning to play the piano. Having recently passed my Grade 3 exam I decided to&#8230; <a href=\"https:\/\/www.interactiveclassroom.net\/?p=1357\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3,103,102],"tags":[],"class_list":["post-1357","post","type-post","status-publish","format-standard","hentry","category-computing","category-programming-computing","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/www.interactiveclassroom.net\/index.php?rest_route=\/wp\/v2\/posts\/1357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.interactiveclassroom.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.interactiveclassroom.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.interactiveclassroom.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.interactiveclassroom.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1357"}],"version-history":[{"count":9,"href":"https:\/\/www.interactiveclassroom.net\/index.php?rest_route=\/wp\/v2\/posts\/1357\/revisions"}],"predecessor-version":[{"id":1371,"href":"https:\/\/www.interactiveclassroom.net\/index.php?rest_route=\/wp\/v2\/posts\/1357\/revisions\/1371"}],"wp:attachment":[{"href":"https:\/\/www.interactiveclassroom.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.interactiveclassroom.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.interactiveclassroom.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}