{"id":218,"date":"2013-08-24T18:34:59","date_gmt":"2013-08-24T14:52:08","guid":{"rendered":"http:\/\/www.dereckson.be\/blog\/?p=218"},"modified":"2020-10-07T17:05:47","modified_gmt":"2020-10-07T15:05:47","slug":"8-bit-music-in-javascript","status":"publish","type":"post","link":"https:\/\/www.dereckson.be\/blog\/2013\/08\/24\/8-bit-music-in-javascript\/","title":{"rendered":"8 bit music in pure JavaScript"},"content":{"rendered":"<p>HTML 5 offers a Web Audio API, to add synthesizing audio support in web applications.<\/p>\n<p><a title=\"Cody the coder\" href=\"http:\/\/codythecoder.com\/\">Cody Lundquist<\/a>, an Australian from Sidney, created a 8 bit music audio library built on the top of the Web Audio API, called <a href=\"https:\/\/github.com\/meenie\/8bit.js\"><strong>8Bit.js Audio Library<\/strong><\/a>.<\/p>\n<p>You define a time (e.g. 4\/4), a tempo, and you then the notes.<\/p>\n<p><a title=\"8Bit.js Audio Library - Write music using 8bit oscillation sounds - HTML5\" href=\"http:\/\/www.reddit.com\/r\/javascript\/comments\/1kuskc\/8bitjs_audio_library_write_music_using_8bit\/\">Submitted 2 days on Reddit<\/a>, the library got a favorable reception, with some people adapting themes. There is even an original composition, rather nice, called <a title=\"Listen to Cities\" href=\"http:\/\/plnkr.co\/edit\/KYHDjzVTYsCKw8ibm6Bt?p=preview\">Cities<\/a>.<\/p>\n<p>A <a href=\"https:\/\/github.com\/meenie\/8bit.js\/issues\/9\">LilyPond support is planned<\/a>, so in the future there could be a possibility to implement this library into <a title=\"Score extension\" href=\"https:\/\/www.mediawiki.org\/wiki\/Extension:Score\">the MediaWiki score extension<\/a>.<\/p>\n<p><strong>Not yet for every browser<\/strong><\/p>\n<ul>\n<li>Safari 6 supports it, so only on iOS and Mac, not yet on Windows.<\/li>\n<li>Chrome 10+ supports it, and so Opera 15,<\/li>\n<li>Firefox, Internet Explorer and Opera 12 don&#8217;t support it.<br \/>\n[<em>2020 edit: Firefox has added support for it in versions 25 (desktop) and 26 (mobile)]<\/em><\/li>\n<\/ul>\n<p><strong>Links<\/strong><\/p>\n<ul>\n<li><a title=\"Plunker &gt; AngularJS, 8Bit.js, Tetris audio theme\" href=\"http:\/\/plnkr.co\/edit\/ev289bKEonSvqL3HVkDQ?p=preview\">Listen to Tetris with 8Bit.js<\/a><\/li>\n<li><a title=\"Chiptune\" href=\"http:\/\/en.wikipedia.org\/wiki\/Chiptune\">8-bit music on Wikipedia<\/a><\/li>\n<li><a title=\"Web Audio API\" href=\"https:\/\/dvcs.w3.org\/hg\/audio\/raw-file\/tip\/webaudio\/specification.html\">Web Audio API specifications<\/a><\/li>\n<li><a title=\"Superheroic JavaScript MVW Framework\" href=\"http:\/\/angularjs.org\">AngularJS<\/a>, the framework used by 8Bit.js<\/li>\n<li><a title=\"Playing Sounds with the Web Audio API\" href=\"Apple Developer documentation about Web Audio API\">Apple documentation about the Web Audio API<\/a><\/li>\n<li><a title=\"Web Audio API comes to Firefox\" href=\"https:\/\/hacks.mozilla.org\/2013\/07\/web-audio-api-comes-to-firefox\/\">Coming soon support on Firefox<\/a><\/li>\n<\/ul>\n<p><strong>Acknowledgment<\/strong><\/p>\n<p><em>Thanks to <a title=\"Linedwell on the Wikipedia in French\" href=\"http:\/\/fr.wikipedia.org\/wiki\/Utilisateur:Linedwell\">Linedwell<\/a> for the help during browsers test.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>HTML 5 offers a Web Audio API, to add synthesizing audio support in web applications. Cody Lundquist, an Australian from Sidney, created a 8 bit music audio library built on the top of the Web Audio API, called 8Bit.js Audio Library. You define a time (e.g. 4\/4), a tempo, and you then the notes. Submitted [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49,30],"tags":[89,90],"class_list":["post-218","post","type-post","status-publish","format-standard","hentry","category-dev","category-wikimedia","tag-html-5","tag-javascript"],"_links":{"self":[{"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/posts\/218","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/comments?post=218"}],"version-history":[{"count":6,"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/posts\/218\/revisions"}],"predecessor-version":[{"id":752,"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/posts\/218\/revisions\/752"}],"wp:attachment":[{"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/media?parent=218"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/categories?post=218"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dereckson.be\/blog\/wp-json\/wp\/v2\/tags?post=218"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}