{"id":899,"date":"2014-08-26T00:52:45","date_gmt":"2014-08-26T00:52:45","guid":{"rendered":"http:\/\/charlie-roberts.com\/gibber\/sampler\/"},"modified":"2014-08-26T00:52:45","modified_gmt":"2014-08-26T00:52:45","slug":"sampler","status":"publish","type":"page","link":"http:\/\/charlie-roberts.com\/gibber\/sampler\/","title":{"rendered":"Sampler"},"content":{"rendered":"<p>Record and playback audiofiles at variable speeds. Recordings made using the sampler can be rendered to .wav files by the browser using the <em>download<\/em>() method.<\/p>\n<p>Inherits from Ugen.<\/p>\n<p>Example:<\/p>\n<pre>a = XOX('x*o*x*o-')\nb = Sampler.record( a, 2 ) \/\/ record for two measures\n\nb.note( -2 ) \/\/ play in reverse at twice the recorded speed \/ pitch<\/pre>\n<h2 id=\"properties\">Properties<\/h2>\n<ul>\n<li><em>pitch<\/em> : Float. Default range: { 1, 4 }. Default value: 1. This property determines the speed of sample playback. Negative values play the sample in reverse. This value can also be set using the note() method.<\/li>\n<li><em>amp<\/em> : Float. Default range: { 0, 1 }. Default value: 1.<\/li>\n<li><em>loops<\/em> : Boolean. Default value: false. If true, sample playback loops back to the beginning after reach the end of a buffer, or vice-versa if the sample is playing in reverse.<\/li>\n<li><em>start<\/em> : Float. Default range { 0, 1 }. Default value: 0. Determines the starting position for sample playback as a normalized value where 0 equals the first sample and 1 represents the final sample in the buffer.<\/li>\n<li><em>end<\/em> : Float. Default range { 0, 1 }. Default value: 1. Determines the end position for sample playback as a normalized value where 0 equals the first sample and 1 represents the final sample in the buffer. <\/li>\n<li><em>pan<\/em> : Float. Default range { -1, 1 }. Default value: 0. The position in the stereo spectrum for output.<\/li>\n<\/ul>\n<h2 id=\"methods\">Methods<\/h2>\n<ul>\n<li><em>note<\/em>( Float:pitch, Float:amp ): Begin playback at the position determined by the start property at a rate determine by the pitch argument and at a provided amplitude.<\/li>\n<li><em>record<\/em>( Ugen:input, Float:time ): Record the output of a given unit generator for a provided amount of time.<\/li>\n<li><em>download<\/em>(): Download the buffer used by the Sampler as a .wav file<\/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 oscillator from whatever bus it is connected to. <\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Record and playback audiofiles at variable speeds. Recordings made using the sampler can be rendered to .wav files by the browser using the download() method. Inherits from Ugen. Example: a = XOX(&#8216;x*o*x*o-&#8216;) b = Sampler.record( a, 2 ) \/\/ record for two measures b.note( -2 ) \/\/ play in reverse at twice the recorded speed [&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\/899"}],"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=899"}],"version-history":[{"count":0,"href":"http:\/\/charlie-roberts.com\/gibber\/wp-json\/wp\/v2\/pages\/899\/revisions"}],"wp:attachment":[{"href":"http:\/\/charlie-roberts.com\/gibber\/wp-json\/wp\/v2\/media?parent=899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}