{"id":152,"date":"2017-11-09T07:19:04","date_gmt":"2017-11-09T07:19:04","guid":{"rendered":"http:\/\/www.wickedpearprogramming.com\/w\/?p=152"},"modified":"2017-11-09T07:19:04","modified_gmt":"2017-11-09T07:19:04","slug":"musical-lights","status":"publish","type":"post","link":"https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/","title":{"rendered":"Musical Lights"},"content":{"rendered":"<p>I really like the demo <a href=\"https:\/\/twitter.com\/michaelokaneedu\">Michael O&#8217;Kane<\/a> highlighted \u00a0where someone has <a href=\"https:\/\/edu.sphero.com\/cwists\/preview\/10973x\">programmed two Sphero SPRK+s to flash their lights to U2&#8217;s &#8220;Pride (In the Name of Love)&#8221; with Swift Playgrounds<\/a>.<\/p>\n<p>I think it&#8217;s a great exercise.<\/p>\n<p>But I was thinking, what if you could listen to the song with an AVAudioPlayer and react to the average power on each channel of the audio?<\/p>\n<p>It&#8217;s a work-in-progress, but here&#8217;s what I have so far:<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/player.vimeo.com\/video\/242013688\" width=\"640\" height=\"360\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p><a href=\"https:\/\/vimeo.com\/242013688\">Musical Lights<\/a> from <a href=\"https:\/\/vimeo.com\/mhanlon\">Matthew Hanlon<\/a> on <a href=\"https:\/\/vimeo.com\">Vimeo<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I really like the demo Michael O&#8217;Kane highlighted \u00a0where someone has programmed two Sphero SPRK+s to flash their lights to U2&#8217;s &#8220;Pride (In the Name of Love)&#8221; with Swift Playgrounds. I think it&#8217;s a great exercise. But I was thinking, what if you could listen to the song with an AVAudioPlayer and react to the &hellip; <a href=\"https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Musical Lights&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_price":"","_stock":"","_tribe_ticket_header":"","_tribe_default_ticket_provider":"","_tribe_ticket_capacity":"0","_ticket_start_date":"","_ticket_end_date":"","_tribe_ticket_show_description":"","_tribe_ticket_show_not_going":false,"_tribe_ticket_use_global_stock":"","_tribe_ticket_global_stock_level":"","_global_stock_mode":"","_global_stock_cap":"","_tribe_rsvp_for_event":"","_tribe_ticket_going_count":"","_tribe_ticket_not_going_count":"","_tribe_tickets_list":"[]","_tribe_ticket_has_attendee_info_fields":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4],"tags":[],"class_list":["post-152","post","type-post","status-publish","format-standard","hentry","category-programming"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Musical Lights &#060; The Code Hub<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Musical Lights &#060; The Code Hub\" \/>\n<meta property=\"og:description\" content=\"I really like the demo Michael O&#8217;Kane highlighted \u00a0where someone has programmed two Sphero SPRK+s to flash their lights to U2&#8217;s &#8220;Pride (In the Name of Love)&#8221; with Swift Playgrounds. I think it&#8217;s a great exercise. But I was thinking, what if you could listen to the song with an AVAudioPlayer and react to the &hellip; Continue reading &quot;Musical Lights&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/\" \/>\n<meta property=\"og:site_name\" content=\"The Code Hub\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/thecodehub\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-09T07:19:04+00:00\" \/>\n<meta name=\"author\" content=\"mhanlon\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@thecodehubIE\" \/>\n<meta name=\"twitter:site\" content=\"@thecodehubIE\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"mhanlon\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/2017\\\/11\\\/09\\\/musical-lights\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/2017\\\/11\\\/09\\\/musical-lights\\\/\"},\"author\":{\"name\":\"mhanlon\",\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/#\\\/schema\\\/person\\\/5074b1a4c66cc5153c1b5ac57570b991\"},\"headline\":\"Musical Lights\",\"datePublished\":\"2017-11-09T07:19:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/2017\\\/11\\\/09\\\/musical-lights\\\/\"},\"wordCount\":88,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/#organization\"},\"articleSection\":[\"Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/2017\\\/11\\\/09\\\/musical-lights\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/2017\\\/11\\\/09\\\/musical-lights\\\/\",\"url\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/2017\\\/11\\\/09\\\/musical-lights\\\/\",\"name\":\"Musical Lights &#060; The Code Hub\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/#website\"},\"datePublished\":\"2017-11-09T07:19:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/2017\\\/11\\\/09\\\/musical-lights\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/2017\\\/11\\\/09\\\/musical-lights\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/2017\\\/11\\\/09\\\/musical-lights\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Musical Lights\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/#website\",\"url\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/\",\"name\":\"The Code Hub\",\"description\":\"News from the Code Hub\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/#organization\",\"name\":\"The Code Hub\",\"url\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/www.thecodehub.ie\\\/news\\\/wp-content\\\/uploads\\\/2018\\\/02\\\/TheCodeHubLogo.001-copy.png?fit=226%2C264&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/www.thecodehub.ie\\\/news\\\/wp-content\\\/uploads\\\/2018\\\/02\\\/TheCodeHubLogo.001-copy.png?fit=226%2C264&ssl=1\",\"width\":226,\"height\":264,\"caption\":\"The Code Hub\"},\"image\":{\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"http:\\\/\\\/facebook.com\\\/thecodehub\",\"https:\\\/\\\/x.com\\\/thecodehubIE\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCx4bznoGDfjJRPfTa4LF9dA\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.thecodehub.ie\\\/news\\\/#\\\/schema\\\/person\\\/5074b1a4c66cc5153c1b5ac57570b991\",\"name\":\"mhanlon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/10b31f4581f74a330d00967a0f95f1bbc142a37543ec208c4f4d9c5f9a043c3b?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/10b31f4581f74a330d00967a0f95f1bbc142a37543ec208c4f4d9c5f9a043c3b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/10b31f4581f74a330d00967a0f95f1bbc142a37543ec208c4f4d9c5f9a043c3b?s=96&d=mm&r=g\",\"caption\":\"mhanlon\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Musical Lights &#060; The Code Hub","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/","og_locale":"en_US","og_type":"article","og_title":"Musical Lights &#060; The Code Hub","og_description":"I really like the demo Michael O&#8217;Kane highlighted \u00a0where someone has programmed two Sphero SPRK+s to flash their lights to U2&#8217;s &#8220;Pride (In the Name of Love)&#8221; with Swift Playgrounds. I think it&#8217;s a great exercise. But I was thinking, what if you could listen to the song with an AVAudioPlayer and react to the &hellip; Continue reading \"Musical Lights\"","og_url":"https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/","og_site_name":"The Code Hub","article_publisher":"http:\/\/facebook.com\/thecodehub","article_published_time":"2017-11-09T07:19:04+00:00","author":"mhanlon","twitter_card":"summary_large_image","twitter_creator":"@thecodehubIE","twitter_site":"@thecodehubIE","twitter_misc":{"Written by":"mhanlon"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/#article","isPartOf":{"@id":"https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/"},"author":{"name":"mhanlon","@id":"https:\/\/www.thecodehub.ie\/news\/#\/schema\/person\/5074b1a4c66cc5153c1b5ac57570b991"},"headline":"Musical Lights","datePublished":"2017-11-09T07:19:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/"},"wordCount":88,"commentCount":0,"publisher":{"@id":"https:\/\/www.thecodehub.ie\/news\/#organization"},"articleSection":["Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/","url":"https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/","name":"Musical Lights &#060; The Code Hub","isPartOf":{"@id":"https:\/\/www.thecodehub.ie\/news\/#website"},"datePublished":"2017-11-09T07:19:04+00:00","breadcrumb":{"@id":"https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.thecodehub.ie\/news\/2017\/11\/09\/musical-lights\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.thecodehub.ie\/news\/"},{"@type":"ListItem","position":2,"name":"Musical Lights"}]},{"@type":"WebSite","@id":"https:\/\/www.thecodehub.ie\/news\/#website","url":"https:\/\/www.thecodehub.ie\/news\/","name":"The Code Hub","description":"News from the Code Hub","publisher":{"@id":"https:\/\/www.thecodehub.ie\/news\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.thecodehub.ie\/news\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.thecodehub.ie\/news\/#organization","name":"The Code Hub","url":"https:\/\/www.thecodehub.ie\/news\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.thecodehub.ie\/news\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/www.thecodehub.ie\/news\/wp-content\/uploads\/2018\/02\/TheCodeHubLogo.001-copy.png?fit=226%2C264&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.thecodehub.ie\/news\/wp-content\/uploads\/2018\/02\/TheCodeHubLogo.001-copy.png?fit=226%2C264&ssl=1","width":226,"height":264,"caption":"The Code Hub"},"image":{"@id":"https:\/\/www.thecodehub.ie\/news\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/facebook.com\/thecodehub","https:\/\/x.com\/thecodehubIE","https:\/\/www.youtube.com\/channel\/UCx4bznoGDfjJRPfTa4LF9dA"]},{"@type":"Person","@id":"https:\/\/www.thecodehub.ie\/news\/#\/schema\/person\/5074b1a4c66cc5153c1b5ac57570b991","name":"mhanlon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/10b31f4581f74a330d00967a0f95f1bbc142a37543ec208c4f4d9c5f9a043c3b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/10b31f4581f74a330d00967a0f95f1bbc142a37543ec208c4f4d9c5f9a043c3b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/10b31f4581f74a330d00967a0f95f1bbc142a37543ec208c4f4d9c5f9a043c3b?s=96&d=mm&r=g","caption":"mhanlon"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9ABLU-2s","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.thecodehub.ie\/news\/wp-json\/wp\/v2\/posts\/152","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thecodehub.ie\/news\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thecodehub.ie\/news\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thecodehub.ie\/news\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thecodehub.ie\/news\/wp-json\/wp\/v2\/comments?post=152"}],"version-history":[{"count":0,"href":"https:\/\/www.thecodehub.ie\/news\/wp-json\/wp\/v2\/posts\/152\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.thecodehub.ie\/news\/wp-json\/wp\/v2\/media?parent=152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thecodehub.ie\/news\/wp-json\/wp\/v2\/categories?post=152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thecodehub.ie\/news\/wp-json\/wp\/v2\/tags?post=152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}