{"id":885,"date":"2014-08-26T00:52:43","date_gmt":"2014-08-26T00:52:43","guid":{"rendered":"http:\/\/charlie-roberts.com\/gibber\/drums\/"},"modified":"2014-08-26T00:52:43","modified_gmt":"2014-08-26T00:52:43","slug":"drums","status":"publish","type":"page","link":"http:\/\/charlie-roberts.com\/gibber\/drums\/","title":{"rendered":"Drums"},"content":{"rendered":"<p>A sampled drum kit with an attached sequencer for quick beat construction. The first argument to the constructor allows you to easily define beats using the following syntax:<\/p>\n<ul>\n<li>x : kick drum hit<\/li>\n<li>o : snare drum hit<\/li>\n<li>* : close hihat<\/li>\n<li>&#8211; : open hihat<\/li>\n<li>. : rest<\/li>\n<\/ul>\n<p>Drums objects are basically hybrid sequencers \/ unit generators; this means that you can call most unit generator methods, ( such as drums.fx.add() ) as well as most sequencer methods ( such as drums.stop() and drums.start() ). By default, the constructor assumes that you want each note in your sequence to have a duration equal to one divided by the number of notes you specify. For example, if you specify a four-note sequence the Drums sequencer will assume you want each note to be a quarter note in duration. You can also specify a duration explicitly as a second parameter to the constructor.<\/p>\n<p>There are a few different drum kits that come with Gibber (with hopefully more to follow). The kits are electronic (the default), original and beatbox. The example below shows how to load a different than the default electronic one.<\/p>\n<p>Finally, note that each individual sound is actually an instance of the Gibber Sampler object. This means you can add effects to the individual sounds in addition to the kit as a whole.<\/p>\n<p>Example:<\/p>\n<pre>a = Drums( 'xoxo' ) \/\/ each note is a quarter note in duration  \na.fx.add( Delay( 1\/64) )  \n\nb = Drums( '***-', 1\/8 ) \/\/ each note is an eighth note  \nb.hat.fx.add( Distortion() )  \nb.pitch = 2  \n\nc = Drums({  \n  kit:'beatbox',  \n  note:'Tfk8p'  \n})<\/pre>\n<h2 id=\"properties\">Properties<\/h2>\n<ul>\n<li><em>pitch<\/em> : Float. default range { .25, 4 }. default value 1. The speed of sample playback.<\/li>\n<li><em>amp<\/em> : Float. default range { 0, 1 }. default value: 1.<\/li>\n<li><em>pan<\/em>: Float. Default range { -1, 1 }. Default value: 0. The position in the stereo spectrum of the Drums output.<\/li>\n<li><em>kick<\/em>: Ugen. The kick drum sampler.<\/li>\n<li><em>snare<\/em>: Ugen. The snare drum sampler.<\/li>\n<li><em>hat<\/em>: Ugen. The hihat sampler.<\/li>\n<li><em>seq<\/em>: Sequencer. The built-in Seq object.<\/li>\n<\/ul>\n<h2 id=\"methods\">Methods<\/h2>\n<ul>\n<li><em>note<\/em>( Float:frequency, Float:amp(optional) ) : This method tells the drum kit to play a single note.<\/li>\n<li><em>play<\/em>( Array:frequencies, Array:durations ) : This method accepts arrays of frequencies and durations as arguments to create and start a sequencer targeting the oscillator.<\/li>\n<li><em>stop<\/em>() : This method stops the sequencer that is built into the oscillator if it has been started.<\/li>\n<li><em>kill<\/em>() : Disconnect the Drums from whatever bus it is connected to. <\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A sampled drum kit with an attached sequencer for quick beat construction. The first argument to the constructor allows you to easily define beats using the following syntax: x : kick drum hit o : snare drum hit * : close hihat &#8211; : open hihat . : rest Drums objects are basically hybrid sequencers [&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\/885"}],"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=885"}],"version-history":[{"count":0,"href":"http:\/\/charlie-roberts.com\/gibber\/wp-json\/wp\/v2\/pages\/885\/revisions"}],"wp:attachment":[{"href":"http:\/\/charlie-roberts.com\/gibber\/wp-json\/wp\/v2\/media?parent=885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}