From dfc508ee02ebec284904202b02ebbbd9ba8dca10 Mon Sep 17 00:00:00 2001 From: Mike Lynch Date: Sun, 9 Apr 2023 12:32:11 +1000 Subject: [PATCH] Multiple pb control synths working in basic ways --- control.scd | 2 +- effects.scd | 2 +- main.scd | 70 ++++++++++++++++++++++++++--------------------------- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/control.scd b/control.scd index 9944f15..8600b70 100644 --- a/control.scd +++ b/control.scd @@ -15,7 +15,7 @@ } ).play(s, [\in1, ~usbinput1, \in2, ~usbinput2, \out, ~recordb]); -~granulatorb = Bus.audio(s, 2); +~grb = Bus.audio(s, 2); // LFO buses and synths diff --git a/effects.scd b/effects.scd index 85508cc..fbd7e39 100644 --- a/effects.scd +++ b/effects.scd @@ -17,7 +17,7 @@ arg in=2, gbus=4, out=0, passthrough=0.75, grains=0.75; Out.ar(out, (grains * In.ar(gbus, 2)) + (passthrough * In.ar(~recordb, 1) ! 2)); } -).play(s, [\in, ~usbinput, \gbus, ~granulatorb, \out, ~fxb ], \addToTail); +).play(s, [\in, ~usbinput, \gbus, ~grb, \out, ~fxb ], \addToTail); ~filtermodb = Bus.control(s, 1); diff --git a/main.scd b/main.scd index ad48d70..dc582f8 100644 --- a/main.scd +++ b/main.scd @@ -5,14 +5,21 @@ Server.default.options.inDevice_("Scarlett 2i2 USB"); //Server.default.options.outDevice_("Scarlett 2i2 USB"); ) Server.killAll; -~frippbuffer.write("/Users/mike/Music/SuperCollider Recordings/slow.aiff"); -~frippbuffer.isNil; ("./synths.scd").loadRelative; ("./control.scd").loadRelative; ("./effects.scd").loadRelative; +Granulator.init(s); + + + + + +( +// set up four position buffers with synths + ~modes = [ [ "saw", \pos_saw ], [ "reverse", \pos_reverse ], @@ -21,9 +28,34 @@ Server.killAll; [ "random", \pos_rand ] ]; +~granulators = Array.new(4); +~posb = Array.new(4); +~possynth = Array.new(4); + +(0..3).do({ + var pb = Bus.control(s, 1), ps; + ~posb.add(pb); + ps = Synth(\pos_saw, [ \out, pb ]); + ~possynth.add(ps); +}); + +) + +( + +(0..3).do({ |i| + var pb = ~posb.at(i); + ~granulators.add(Granulator.new(~buflen, ~recordb, ~outb, pb, ~triggerb, ~pitchb)); +}); + +) + +~granulators[1].record(1.0); +~possynth[0].set(\speed,200); + +("./interface.scd").loadRelative; -Granulator.init(s) ~g3 = Granulator.new(4, ~recordb, ~granulatorb, ~playbacklfob, ~triggerb, ~pitchb); @@ -82,35 +114,3 @@ Granulator.init(s) -~frippbuffers[~currentfripp].write("/Users/mike/Music/SuperCollider Recordings/test.aiff"); - -( -~monitor = SynthDef( - \monitor_synth, - { - arg in=2, out=0; - Out.ar(out, In.ar(in, 2)) - } -).play(s, [\in, ~fxb, \out, 0 ], \addToTail); - -) - -~monitor.set(\in, ~reverbb) - -~monitor.free - -~pitchb.scope() - -~frippbuffers.plot; - -~bufrecorder.set(\buffer, ~frippbuffers[1]); - - -~granulators[0].get(\buffer, {|v| v.postln}); - -( -~frippbuffers.do({ - |b, i| - b.write("/Users/mike/Music/SuperCollider Recordings/buffer" ++ i.asString ++ ".aiff"); -}); -)