{"id":938,"date":"2014-08-26T09:38:04","date_gmt":"2014-08-26T09:38:04","guid":{"rendered":"http:\/\/charlie-roberts.com\/gibber\/?page_id=938"},"modified":"2023-07-20T06:00:56","modified_gmt":"2023-07-20T06:00:56","slug":"p5-gibber","status":"publish","type":"page","link":"http:\/\/charlie-roberts.com\/gibber\/p5-gibber\/","title":{"rendered":"p5.gibber"},"content":{"rendered":"<p>I&#8217;ve done a little bit of work making sure Gibber can play nice with p5.js. Mostly refactoring <a href=\"http:\/\/charlie-roberts.com\/gibber\/gibber-lib-js\">Gibber.lib<\/a> and then wrapping it to support both the global and &#8220;instance mode&#8221; styles of programming found in p5.<\/p>\n<p>Examples:<\/p>\n<ul>\n<li><a href=\"https:\/\/editor.p5js.org\/charlieroberts\/sketches\/AOJPurEoV\" target=\"_blank\" rel=\"noopener\">simple template<\/a><\/li>\n<li><a href=\"https:\/\/editor.p5js.org\/charlieroberts\/sketches\/6ALTpcH6Q\" target=\"_blank\" rel=\"noopener\">FFT music visualization<\/a><\/li>\n<li><a href=\"https:\/\/editor.p5js.org\/charlieroberts\/sketches\/FTj3S8JNh\" target=\"_blank\" rel=\"noopener\">cellular automata<\/a><\/li>\n<li><a href=\"https:\/\/editor.p5js.org\/charlieroberts\/sketches\/RUM7DvS_v\" target=\"_blank\" rel=\"noopener\">modulation + waveform viz<\/a><\/li>\n<li><a href=\"https:\/\/editor.p5js.org\/charlieroberts\/sketches\/JYXEA6ua2\" target=\"_blank\" rel=\"noopener\">modulation ii<\/a><\/li>\n<li><a href=\"http:\/\/charlie-roberts.com\/gibber\/examples\/p5.gibber.simple.instance.example\">simple instance mode template<\/a><\/li>\n<\/ul>\n<p>These sketches are also organized in a <a href=\"https:\/\/editor.p5js.org\/charlieroberts\/collections\/7LFl5Uqrg\" target=\"_blank\" rel=\"noopener\">collection on the p5.editor website<\/a>. You can also<br \/>\n<a href=\" https:=\" \"=\"\" github.com=\"\" charlieroberts=\"\" p5.gibber.js=\"\" archive=\"\" 0.2.4.zip\"=\"\">download examples and library to play with.<\/a><\/p>\n<p>Below is the first example listed, a complete<code>sketch.js<\/code> file that starts a drum loop playing and changes the background color based on current amplitude.<\/p>\n<pre>function setup() {\n  createCanvas( windowWidth, windowHeight )\n\n  drums = EDrums('x*o*x*o-')\n  follow = Follow( drums )\n}\n\nfunction draw() {\n  background( follow.getValue() * 255 )\n}\n<\/pre>\n<p>You can also find p5.gibber.js on <a href=\"http:\/\/github.com\/charlieroberts\/p5.gibber.js\">github<\/a> and on <a href=\"https:\/\/www.npmjs.org\/package\/p5.gibber.js\">npm<\/a>.<\/p>\n<p>Note that <a href=\"http:\/\/bigbadotis.gitbooks.io\/gibber-user-manual\/\">Gibber&#8217;s manual<\/a> was written for the coding environment, not this standalone library. However, all the audio code in chapters 3 and 4 and all code in chapters 5-7 will still work with the standalone library. One note is that currently the Drums object (which uses samples) is not supported in the library; use the EDrums object (which uses synthesis) instead.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve done a little bit of work making sure Gibber can play nice with p5.js. Mostly refactoring Gibber.lib and then wrapping it to support both the global and &#8220;instance mode&#8221; styles of programming found in p5. Examples: simple template FFT music visualization cellular automata modulation + waveform viz modulation ii simple instance mode template These [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/charlie-roberts.com\/gibber\/wp-json\/wp\/v2\/pages\/938"}],"collection":[{"href":"http:\/\/charlie-roberts.com\/gibber\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/charlie-roberts.com\/gibber\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/charlie-roberts.com\/gibber\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/charlie-roberts.com\/gibber\/wp-json\/wp\/v2\/comments?post=938"}],"version-history":[{"count":19,"href":"http:\/\/charlie-roberts.com\/gibber\/wp-json\/wp\/v2\/pages\/938\/revisions"}],"predecessor-version":[{"id":1043,"href":"http:\/\/charlie-roberts.com\/gibber\/wp-json\/wp\/v2\/pages\/938\/revisions\/1043"}],"wp:attachment":[{"href":"http:\/\/charlie-roberts.com\/gibber\/wp-json\/wp\/v2\/media?parent=938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}