{"id":239,"date":"2010-11-02T20:17:00","date_gmt":"2010-11-02T20:17:00","guid":{"rendered":"http:\/\/www.celesteh.com\/blog\/2010\/11\/02\/chiptune-dub-bbcu\/"},"modified":"2015-06-19T00:23:30","modified_gmt":"2015-06-18T23:23:30","slug":"chiptune-dub-bbcu","status":"publish","type":"post","link":"https:\/\/www.celesteh.com\/blog\/2010\/11\/02\/chiptune-dub-bbcu\/","title":{"rendered":"Chiptune, Dub, BBCut"},"content":{"rendered":"<p>This is based off MCLD&#8217;s <a href=\"http:\/\/www.mcld.co.uk\/blog\/blog.php?312\">Dubstep Patch<\/a>, with a modification to make it output a Pulse wave and then using some BBCut from a <A href=\"http:\/\/celesteh.blogspot.com\/2010\/10\/stupid-bbcut-tricks.html\">previous post<\/a>.<\/p>\n<pre>\n(\nvar bus, sf, buf, clock, synthgroup, bbgroup, loop, group, cut1, cut2, cut3, stream, pb,\n  cut4, out;\n\n\nSynthDef(dub, {|out = 0, amp|\n \n    var trig, note, son, sweep;\n\n    trig = CoinGate.kr(0.5, Impulse.kr(\/*2*\/ 1.5.reciprocal));\n\n    note = Demand.kr(trig, 0, Dseq((22,24..44).midicps.scramble, inf));\n\n    sweep = LFSaw.ar(Demand.kr(trig, 0, Drand([1, 2, 2, 3, 4, 5, 6, 8, 16], inf))).exprange(40, 5000);\n\n    son = Pulse.ar(note * [0.99, 1, 1.01]).sum;\n    son = LPF.ar(son, sweep);   \n    son = Normalizer.ar(son);\n    son = son + BPF.ar(son, 2000, 2);\n\n    \/\/\/\/\/\/\/\/ special flavours:\n    \/\/ hi manster\n    son = Select.ar(TRand.kr(trig: trig) < 0.05, [son, HPF.ar(son, 1000) * 4]);\n    \/\/ sweep manster\n    son = Select.ar(TRand.kr(trig: trig) < 0.05, [son, HPF.ar(son, sweep) * 4]);\n    \/\/ decimate\n    son = Select.ar(TRand.kr(trig: trig) < 0.05, [son, son.round(0.1)]);\n\n    son = (son * 5).tanh;\n    \/\/son = son + GVerb.ar(son, 10, 0.1, 0.7, mul: 0.3);\n    \/\/son.dup;\n    Out.ar(out, son.dup * amp);\n}).add;\n\n\n \/\/ groups\n synthgroup= Group.head(Node.basicNew(s,1)); \/\/ one at the head\n bbgroup= Group.after(synthgroup); \/\/ this one comes after, so it can do stuff with audio\n        \/\/ from the synthgroup\n bus= Bus.audio(s,1); \/\/ a bus to route audio around\n\n \/\/ a buffer holding a breakbeat. The first argument is the filename, the second is the number of\n \/\/ beats in the file.\n sf = BBCutBuffer(\"sounds\/drums\/breaks\/hiphop\/22127__nikolat__oldskoolish_90bpm.wav\", 16);\n \n \/\/ a buffer used by BBCut to hold anaylsis\n buf = BBCutBuffer.alloc(s,44100,1);\n \n \/\/  The default clock.  90 is the BPM \/ 60 for the number of seconds in a minute\n TempoClock.default.tempo_(180\/60);\n\n \/\/ BBCut uses it's own clock class. We're using the default clock as a base\n clock= ExternalClock(TempoClock.default); \n clock.play;  \n \n \/\/ Where stuff actually happens\n Routine.run({\n\n  s.sync; \/\/ wait for buffers to load\n\n loop = (instrument:dub, out:0, amp: 0.3,\n    group:synthgroup.nodeID).play(clock.tempoclock);\n\n  \/* That's an Event, which you can create by using parens like this.  We're using\n  an event because of the timing built in to that class.  Passing the clock\n  argument to play means that the loop will always start on a beat and thus be \n  synced with other BBCut stuff. *\/\n  \n  \/\/ let it play for 5 seconds\n  5.wait;\n  \n  group = CutGroup(CutBuf3(sf, 0.5));\n  group.add(CutBit1.new(4));\n    cut2 = BBCut2(group, BBCutProc11(8, 4, 16, 2, 0.2)).play(clock);\n\n  \n  \/\/ start a process to cut things coming in on the bus\n  cut1 = BBCut2(CutGroup(CutStream1(bus.index, buf), bbgroup), \n   BBCutProc11(8, 4, 16, 2, 0.2)).play(clock);\n\n 2.wait;\n \n   loop.set(out, bus.index);\n   \n \"bbcut\".postln;\n \n 30.wait;\n \n   cut4 = BBCut2(CutGroup(CutStream1(bus.index, buf), bbgroup), \n    SQPusher2.new).play(clock);\n\n   \n });\n)\n<\/pre>\n<p>I think it would be cool to run the drums through a 4 or 8 bit MantissaMask, but first I have to figure out how to write FX.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is based off MCLD&#8217;s Dubstep Patch, with a modification to make it output a Pulse wave and then using some BBCut from a previous post. ( var bus, sf, buf, clock, synthgroup, bbgroup, loop, group, cut1, cut2, cut3, stream, pb, cut4, out; SynthDef(dub, {|out = 0, amp| var trig, note, son, sweep; trig = &hellip; <a href=\"https:\/\/www.celesteh.com\/blog\/2010\/11\/02\/chiptune-dub-bbcu\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Chiptune, Dub, BBCut<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":""},"categories":[1],"tags":[142,76,64],"class_list":["post-239","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-bbcut","tag-celesteh","tag-supercollider"],"_links":{"self":[{"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/posts\/239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/comments?post=239"}],"version-history":[{"count":1,"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/posts\/239\/revisions"}],"predecessor-version":[{"id":2439,"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/posts\/239\/revisions\/2439"}],"wp:attachment":[{"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/media?parent=239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/categories?post=239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/tags?post=239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}