{"id":6142,"date":"2013-03-15T21:17:18","date_gmt":"2013-03-15T21:17:18","guid":{"rendered":"http:\/\/zerokidz.com\/ideas\/?p=6142"},"modified":"2014-05-18T02:57:08","modified_gmt":"2014-05-18T06:57:08","slug":"hardware-control-of-webaudio-api","status":"publish","type":"post","link":"https:\/\/reactivemusic.net\/?p=6142","title":{"rendered":"hardware control of webaudio API"},"content":{"rendered":"<p><iframe loading=\"lazy\" title=\"controlling a webaudioAPI app with touchOsc\" width=\"525\" height=\"295\" src=\"https:\/\/www.youtube.com\/embed\/aLwh4BDx_NE?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><\/p>\n<h3>programming<\/h3>\n<p>This is a tweak of a demo program by Boris Smus from <a href=\"http:\/\/webaudioapi.com \">http:\/\/webaudioapi.com <\/a><\/p>\n<p>The audio is generated in the web browser using the webaudio API. Oscillator frequency is being controlled by an iPod touch running touchOSC.<\/p>\n<p>A ruby program is running in the background. It starts 2 servers, one to handle Osc messages from the iPod. and a websockets server which passes Osc messages to the web client in the browser, which parses the data and sets oscillator frequency.<\/p>\n<p>local source files in tkzic\/web-audio-api\/webaudioapi\/content\/posts\/oscillator-ws<\/p>\n<h3>instructions<\/h3>\n<p>(these are for my local files &#8211; source has not been published yet) Please contact me directly for more information about this code. Or have a look at a very similar example at:\u00a0<a href=\"https:\/\/github.com\/tkzic\/WebAudio\">https:\/\/github.com\/tkzic\/WebAudio<\/a><\/p>\n<p>1. run the node webserver in tkzic\/<\/p>\n<div>\n<div class=\"panel\">\n<p>node nodeserver.js<\/p>\n<\/div>\n<\/div>\n<p>(it will run on localhost port 8081 &#8211; for example http:\/\/127.0.0.1:8081)<\/p>\n<p>2. In Chrome web browser, run:\u00a0<a href=\"http:\/\/192.168.1.104:8081\/web-audio-api\/webaudioapi\/content\/posts\/oscillator-ws\/index.html\">http:\/\/192.168.1.104:8081\/web-audio-api\/webaudioapi\/content\/posts\/oscillator-ws\/index.html<\/a><\/p>\n<p>The following screen will appear:<\/p>\n<p><a href=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/03\/Screen-Shot-2014-04-27-at-3.15.15-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-10616\" title=\"Screen Shot 2014-04-27 at 3.15.15 PM\" src=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/03\/Screen-Shot-2014-04-27-at-3.15.15-PM-300x220.png\" alt=\"\" width=\"300\" height=\"220\" srcset=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/03\/Screen-Shot-2014-04-27-at-3.15.15-PM-300x220.png 300w, https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/03\/Screen-Shot-2014-04-27-at-3.15.15-PM.png 689w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>3. From a terminal prompt run this ruby script (in\u00a0tkzic\/web-audio-api\/webaudioapi\/content\/posts\/oscillator-ws)<\/p>\n<div>\n<div class=\"panel\">\n<p>.\/wapOSCserver.rb<\/p>\n<\/div>\n<\/div>\n<p>4. In webpage in Chrome, click the sockets button &#8211; the ruby server should open a socket connection, also click the play\/pause button to start the oscillator<\/p>\n<p>5. In touchOSC point the host to the ip address of the laptop (ie., 192.168.1.104) running on default ports, (out 8000, in 9000)<\/p>\n<p>6. In touchOSC run the &#8216;simple&#8217; layout and move fader1 to change the pitch of the oscillator<\/p>\n<p><span style=\"line-height: 1.6;\">Note: You will probably also want to open the developer javascript console in Chrome to see what is going on.<\/span><\/p>\n<h3>next step<\/h3>\n<p>Need to clean up the ruby server code to handle error conditions, ie., network interruptions, missing files, browser incompatibility, etc.,<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>programming This is a tweak of a demo program by Boris Smus from http:\/\/webaudioapi.com The audio is generated in the web browser using the webaudio API. Oscillator frequency is being controlled by an iPod touch running touchOSC. A ruby program is running in the background. It starts 2 servers, one to handle Osc messages from &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/reactivemusic.net\/?p=6142\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;hardware control of webaudio API&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[230,21,143],"tags":[161,105,190,202,175,164,210],"class_list":["post-6142","post","type-post","status-publish","format-standard","hentry","category-development","category-dsp","category-interactive-media-art","tag-api","tag-osc","tag-portfolio","tag-ruby","tag-touchosc","tag-web-audio","tag-websockets"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>hardware control of webaudio API - reactive music<\/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:\/\/reactivemusic.net\/?p=6142\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"hardware control of webaudio API - reactive music\" \/>\n<meta property=\"og:description\" content=\"programming This is a tweak of a demo program by Boris Smus from http:\/\/webaudioapi.com The audio is generated in the web browser using the webaudio API. Oscillator frequency is being controlled by an iPod touch running touchOSC. A ruby program is running in the background. It starts 2 servers, one to handle Osc messages from &hellip; Continue reading &quot;hardware control of webaudio API&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/reactivemusic.net\/?p=6142\" \/>\n<meta property=\"og:site_name\" content=\"reactive music\" \/>\n<meta property=\"article:published_time\" content=\"2013-03-15T21:17:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-05-18T06:57:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/03\/Screen-Shot-2014-04-27-at-3.15.15-PM-300x220.png\" \/>\n<meta name=\"author\" content=\"Tom Zicarelli\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tom Zicarelli\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6142#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6142\"},\"author\":{\"name\":\"Tom Zicarelli\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\"},\"headline\":\"hardware control of webaudio API\",\"datePublished\":\"2013-03-15T21:17:18+00:00\",\"dateModified\":\"2014-05-18T06:57:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6142\"},\"wordCount\":303,\"image\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6142#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/reactivemusic.net\\\/wp-content\\\/uploads\\\/2013\\\/03\\\/Screen-Shot-2014-04-27-at-3.15.15-PM-300x220.png\",\"keywords\":[\"API\",\"OSC\",\"portfolio\",\"ruby\",\"touchOSC\",\"web audio\",\"websockets\"],\"articleSection\":[\"development\",\"DSP\",\"interactive media art\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6142\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6142\",\"name\":\"hardware control of webaudio API - reactive music\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6142#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6142#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/reactivemusic.net\\\/wp-content\\\/uploads\\\/2013\\\/03\\\/Screen-Shot-2014-04-27-at-3.15.15-PM-300x220.png\",\"datePublished\":\"2013-03-15T21:17:18+00:00\",\"dateModified\":\"2014-05-18T06:57:08+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6142#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/reactivemusic.net\\\/?p=6142\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6142#primaryimage\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/wp-content\\\/uploads\\\/2013\\\/03\\\/Screen-Shot-2014-04-27-at-3.15.15-PM.png\",\"contentUrl\":\"https:\\\/\\\/reactivemusic.net\\\/wp-content\\\/uploads\\\/2013\\\/03\\\/Screen-Shot-2014-04-27-at-3.15.15-PM.png\",\"width\":\"689\",\"height\":\"507\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=6142#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/reactivemusic.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"hardware control of webaudio API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#website\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/\",\"name\":\"reactive music\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/reactivemusic.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\",\"name\":\"Tom Zicarelli\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"caption\":\"Tom Zicarelli\"},\"sameAs\":[\"http:\\\/\\\/tomzicarelli.com\"],\"url\":\"https:\\\/\\\/reactivemusic.net\\\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"hardware control of webaudio API - reactive music","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:\/\/reactivemusic.net\/?p=6142","og_locale":"en_US","og_type":"article","og_title":"hardware control of webaudio API - reactive music","og_description":"programming This is a tweak of a demo program by Boris Smus from http:\/\/webaudioapi.com The audio is generated in the web browser using the webaudio API. Oscillator frequency is being controlled by an iPod touch running touchOSC. A ruby program is running in the background. It starts 2 servers, one to handle Osc messages from &hellip; Continue reading \"hardware control of webaudio API\"","og_url":"https:\/\/reactivemusic.net\/?p=6142","og_site_name":"reactive music","article_published_time":"2013-03-15T21:17:18+00:00","article_modified_time":"2014-05-18T06:57:08+00:00","og_image":[{"url":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/03\/Screen-Shot-2014-04-27-at-3.15.15-PM-300x220.png","type":"","width":"","height":""}],"author":"Tom Zicarelli","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tom Zicarelli","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/reactivemusic.net\/?p=6142#article","isPartOf":{"@id":"https:\/\/reactivemusic.net\/?p=6142"},"author":{"name":"Tom Zicarelli","@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571"},"headline":"hardware control of webaudio API","datePublished":"2013-03-15T21:17:18+00:00","dateModified":"2014-05-18T06:57:08+00:00","mainEntityOfPage":{"@id":"https:\/\/reactivemusic.net\/?p=6142"},"wordCount":303,"image":{"@id":"https:\/\/reactivemusic.net\/?p=6142#primaryimage"},"thumbnailUrl":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/03\/Screen-Shot-2014-04-27-at-3.15.15-PM-300x220.png","keywords":["API","OSC","portfolio","ruby","touchOSC","web audio","websockets"],"articleSection":["development","DSP","interactive media art"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/reactivemusic.net\/?p=6142","url":"https:\/\/reactivemusic.net\/?p=6142","name":"hardware control of webaudio API - reactive music","isPartOf":{"@id":"https:\/\/reactivemusic.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/reactivemusic.net\/?p=6142#primaryimage"},"image":{"@id":"https:\/\/reactivemusic.net\/?p=6142#primaryimage"},"thumbnailUrl":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/03\/Screen-Shot-2014-04-27-at-3.15.15-PM-300x220.png","datePublished":"2013-03-15T21:17:18+00:00","dateModified":"2014-05-18T06:57:08+00:00","author":{"@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571"},"breadcrumb":{"@id":"https:\/\/reactivemusic.net\/?p=6142#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/reactivemusic.net\/?p=6142"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/reactivemusic.net\/?p=6142#primaryimage","url":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/03\/Screen-Shot-2014-04-27-at-3.15.15-PM.png","contentUrl":"https:\/\/reactivemusic.net\/wp-content\/uploads\/2013\/03\/Screen-Shot-2014-04-27-at-3.15.15-PM.png","width":"689","height":"507"},{"@type":"BreadcrumbList","@id":"https:\/\/reactivemusic.net\/?p=6142#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/reactivemusic.net\/"},{"@type":"ListItem","position":2,"name":"hardware control of webaudio API"}]},{"@type":"WebSite","@id":"https:\/\/reactivemusic.net\/#website","url":"https:\/\/reactivemusic.net\/","name":"reactive music","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/reactivemusic.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571","name":"Tom Zicarelli","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","caption":"Tom Zicarelli"},"sameAs":["http:\/\/tomzicarelli.com"],"url":"https:\/\/reactivemusic.net\/?author=2"}]}},"_links":{"self":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/6142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6142"}],"version-history":[{"count":15,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/6142\/revisions"}],"predecessor-version":[{"id":11551,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/6142\/revisions\/11551"}],"wp:attachment":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}