makeBundle and OnserverBoot to automate timing of startup

master
Rob Canning 2022-12-07 00:34:33 +01:00
parent 9505ba4a52
commit df2832ed89
2 changed files with 137 additions and 255 deletions

View File

@ -1,7 +1,7 @@
( (
Window.closeAll; Window.closeAll;
w = Window.new().front; w = Window.new().front.background_(Color.black);
~inputGui = CompositeView(w, Rect(10,80,250,450)) ~inputGui = CompositeView(w, Rect(10,80,250,450))
.background_(Color.rand) .background_(Color.rand)
@ -99,10 +99,24 @@ l.criticalColor = Color.red(0.5);
///////////// END OF INPUT GUI BOX ///////////// END OF INPUT GUI BOX
//b
~bufferGui = CompositeView.new(w, bounds:Rect(40,750,750,200))
.background_(Color.white)
.alwaysOnTop_(true);
//~bufferPlotter = Plotter("plot", parent: ~bufferGui).value_([0, 1, 2, 3, 4].scramble * 100);
// todo howto do this ? see end of chapter one of marinos's book on archive.org
//. or page 215 - of this https://escholarship.org/content/qt2d33344j/qt2d33344j.pdf
//~bufferPlotter = Plotter("plot", parent: ~bufferGui).value_(b);
//~bufferPlotter.val
// ------------- GRAIN GUI // ------------- GRAIN GUI
~grainGui = CompositeView.new(w, bounds:Rect(540,80,350,560)) ~grainGui = CompositeView.new(w, bounds:Rect(540,80,250,760))
.background_(Color.white) .background_(Color.rand)
.alwaysOnTop_(true); .alwaysOnTop_(true);
~grainGui.decorator = FlowLayout(~grainGui.bounds); ~grainGui.decorator = FlowLayout(~grainGui.bounds);
@ -156,12 +170,12 @@ VLayout(
.items_(["1","2","3","5","8","13","21", "34", "55","89","144","233", "377"]) .font_(Font.default.size_(30)).background_(Color.yellow); .items_(["1","2","3","5","8","13","21", "34", "55","89","144","233", "377"]) .font_(Font.default.size_(30)).background_(Color.yellow);
StaticText(~grainGui, Rect(50,50,150,40)).string_("IMPULSE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30)); StaticText(~grainGui, Rect(50,50,150,40)).string_("IMPULSE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30));
// ~impulseModeGui = QPopUpMenu.new(~grainGui, Rect(30,350,300,40))
// .items_(["SYNCHRONIOUS","ASYNCHRONIOUS","Array"]) .font_(Font.default.size_(20)).background_(Color.yellow);
~impulseModeGui = CheckBox.new(~grainGui, Rect(30,350,80,60)).value_(1).string_("sync/async"); ~impulseModeGui = CheckBox.new(~grainGui, Rect(30,350,80,60)).value_(1).string_("sync/async");
/* StaticText(~grainGui, Rect(50,50,150,40)).string_("Pointer Rate Freeze").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(20));
~ptrRateGui = NumberBox.new(~grainGui, Rect(30,450,80,40)).value_(1).increment(factor: 0.1).font_(Font.default.size_(30));*/
~gPanModeGui = QPopUpMenu(~grainGui, Rect(10, 300, 220, 30)) ~gPanModeGui = QPopUpMenu(~grainGui, Rect(10, 300, 220, 30))
.items_(["OFF","STEREO FRONT","STEREO BACK", "STEREO PAN", "STEREO RND", "QUAD", "QUAD ROTATE", "QUAD RANDOM" ]).font_(Font.default.size_(24)); .items_(["OFF","STEREO FRONT","STEREO BACK", "STEREO PAN", "STEREO RND", "QUAD", "QUAD ROTATE", "QUAD RANDOM" ]).font_(Font.default.size_(24));
@ -180,9 +194,9 @@ VLayout(
.background_(Color.rand) .background_(Color.rand)
.alwaysOnTop_(true); .alwaysOnTop_(true);
~inputGui.bounds_(Rect(10, 60, 250, 450)); // contents adjust since coords are relative ~inputGui.bounds_(Rect(10, 60, 250, 450)); // contents adjust since coords are relative
~grainGui.bounds_(Rect(280, 60, 450, 650)); // contents adjust since coords are relative ~grainGui.bounds_(Rect(280, 60, 450, 650)); // contents adjust since coords are relative
~iSpatGui.bounds_(Rect(10, 570, 250, 500)); // contents adjust since coords are relative ~iSpatGui.bounds_(Rect(10, 570, 250, 500)); // contents adjust since coords are relative
) )

326
gtr.scd
View File

@ -1,51 +1,41 @@
// RUNME 0 ========================================= // RUNME 0 =========================================
// todo countdown on density voices
Server.default.waitForBoot { // see below .bundle timings for starting synths etc.
( s.reboot{ // SETUP ---------------=--------------------------
s.options.numBuffers = 1024 * 256; // increase this if you need to load more samples b = Buffer.alloc(s, s.sampleRate * 10, 1); // Allocate a 5 second mono buffer
s.options.sampleRate = 44100; // also tried with 44000 value
s.options.memSize = 8192 * 32; // increase this if you get "alloc failed" messages
s.options.numWireBufs = 64; // increase this if you get "exceeded number of interconnect buffers" messages
s.options.maxNodes = 1024 * 32; // increase this if you are getting drop outs and the message "too many nodes"
s.options.numInputBusChannels = 8;
s.options.numOutputBusChannels = 8;
})
// RUNME 1 =========================================
( // SETUP ---------------=--------------------------
b = Buffer.alloc(s, s.sampleRate * 5.0, 1); // Allocate a 5 second mono buffer
~b1 = Buffer.alloc(s, s.sampleRate * 4.0, 1);
f = Buffer.alloc(s, s.sampleRate * 4.0, 1);
// Open port 57121 for ESP32 UDP OSC // Open port 57121 for ESP32 UDP OSC
thisProcess.openUDPPort(57121); thisProcess.openUDPPort(57121);
///////////////////////////////////////
~sourceGroup = Group.new; // allocate busses
~fxGroup = Group.after(~sourceGroup);
~reverbBus = Bus.audio(s, 1); ~reverbBus = Bus.audio(s, 1);
~ringModBus = Bus.audio(s, 1); ~ringModBus = Bus.audio(s, 1);
~micBus = Bus.audio(s,1);
~ptrBus = Bus.audio(s,1);
//~sourceGrp = Group.new;
//~fxGrp = Group.after(~sourceGrp);
// create group order
~micGrp = Group.new; ~micGrp = Group.new;
~ptrGrp = Group.after(~micGrp); ~ptrGrp = Group.after(~micGrp);
~recGrp = Group.after(~ptrGrp); ~recGrp = Group.after(~ptrGrp);
~granGrp = Group.after(~recGrp); ~granGrp = Group.after(~recGrp);
~fxGrp = Group.after(~micGrp);
//load the gui //load the gui
"/home/rob/gtr/gtr-gui-manual.scd".load; "/home/rob/gtr/gtr-gui-manual.scd".load;
s.plotTree; s.plotTree;
s.meter; s.meter;
);
// RUNME 2 ========================================== // RUNME 2 ==========================================
s.makeBundle(1.0, {
// -------------------------------------------------
// DEFINE SYNTHS ---------------------------------
// ------------------------------------------------- // -------------------------------------------------
(( // DEFINE SYNTHS --------------------------------- // direct signal + reverb -------------------------
// -------------------------------------------------
( // direct signal + reverb -------------------------
///// outs set to 2 /// for recording to ardour .... fork todo ///// outs set to 2 /// for recording to ardour .... fork todo
SynthDef("dryIn", { arg in=0, instrPanModeIndex=0, out=2, sensorInstrPan=0, instrPitch=0.7, instrAmp=1; SynthDef("dryIn", { arg in=0, instrPanModeIndex=0, out=2, sensorInstrPan=0, instrPitch=0.7, instrAmp=1;
@ -67,9 +57,7 @@ SynthDef("dryIn", { arg in=0, instrPanModeIndex=0, out=2, sensorInstrPan=0, ins
Out.ar(out, signal); Out.ar(out, signal);
//Out.ar(0, Mix.ar( [signal, wet] )); //Out.ar(0, Mix.ar( [signal, wet] ));
}).add; }).add;
);
(
SynthDef("freeVerb", { SynthDef("freeVerb", {
arg in=0, mix=0.5, room=0.8, damp = 0.5; arg in=0, mix=0.5, room=0.8, damp = 0.5;
var signal, dry, wet; var signal, dry, wet;
@ -78,7 +66,6 @@ SynthDef("freeVerb", {
signal = wet * 0.9; signal = wet * 0.9;
Out.ar(2, signal!2); Out.ar(2, signal!2);
}).add; }).add;
);
SynthDef("ringModulator", { SynthDef("ringModulator", {
arg in=0, modulator=300, mulrate=0.2; arg in=0, modulator=300, mulrate=0.2;
@ -89,12 +76,7 @@ SynthDef("ringModulator", {
//signal = (rm + signal) * 0.5; //signal = (rm + signal) * 0.5;
Out.ar(2, rm!2); Out.ar(2, rm!2);
}).add; }).add;
);
( ~micBus = Bus.audio(s,1); ~ptrBus = Bus.audio(s,1););
(
SynthDef.new(\mic, { SynthDef.new(\mic, {
arg in=0, out=0, amp=1; arg in=0, out=0, amp=1;
var sig; var sig;
@ -103,32 +85,26 @@ SynthDef.new(\mic, {
}).add; }).add;
SynthDef.new(\ptr, { SynthDef.new(\ptr, {
arg out=0, buf=0, ptrMode=0; arg out=0, buf=0, ptrMode=0, rate=1;
var sig; var sig;
sig = Select.ar(ptrMode, [ sig = Select.ar(ptrMode, [
Phasor.ar(0, BufRateScale.kr(buf), 0, BufFrames.kr(buf)), Phasor.ar(0, BufRateScale.kr(buf) * rate, 0, BufFrames.kr(buf)),
LFNoise1.ar(100).exprange(10000, 1001) LFNoise1.ar(100).exprange(10000, 10001)
//LFNoise1.ar(100).exprange(1/BufFrames.kr(buf), BufFrames.kr(buf)) //LFNoise1.ar(100).exprange(1/BufFrames.kr(buf), BufFrames.kr(buf))
]); ]);
Out.ar(out, sig); Out.ar(out, sig);
}).add; }).add;
SynthDef.new(\rec, { // mono buffer recorder ----------------------------
arg ptrIn=0, micIn=0, buf=0;
var ptr, sig;
ptr = In.ar(ptrIn, 1);
sig = In.ar(micIn, 1);
BufWr.ar(sig, buf, ptr);
}).add;
( // mono buffer recorder ----------------------------
// with loop and overdub modes ///////////////////// // with loop and overdub modes /////////////////////
SynthDef("recBuf",{ SynthDef("recBuf",{
arg micIn=0, out=0, ptrIn=0, bufnum=0, t_trig=0, l=0, overdub=0; arg micIn=0, ptrIn=0, bufnum=0, t_trig=0, l=0, overdub=0;
var sig, ptr, chain, onsets; var sig, ptr, chain, onsets;
sig = In.ar(micIn, 1);
ptr = In.ar(ptrIn, 1); ptr = In.ar(ptrIn, 1);
sig = In.ar(micIn, 1);
// Onsets // Onsets
//chain = FFT(LocalBuf(512), sig); //chain = FFT(LocalBuf(512), sig);
@ -138,10 +114,8 @@ SynthDef("recBuf",{
recLevel: 1, recLevel: 1,
preLevel: overdub, preLevel: overdub,
doneAction: 0, trigger:t_trig, doneAction: 0, trigger:t_trig,
offset: ptr, offset: ptr);
); }).add;
}).add;
);
SynthDef.new(\gran, { SynthDef.new(\gran, {
arg amp=0.5, out=0, buf=0, arg amp=0.5, out=0, buf=0,
@ -188,37 +162,36 @@ SynthDef.new(\gran, {
}).add; }).add;
)) }); //end make bundle
( // RUNME 3 ========================================== // RUNME 3 ==========================================
// START SYNTHS -------------------------------------
r = Synth(\recBuf, [\ptrIn, ~ptrBus, \micIn, ~micBus, \buf, b, \t_trig, 0], ~recGrp); // recorder s.makeBundle(2.0, {
~gtrIn = Synth(\dryIn, [\instrAmp, 1, \out, ~reverbBus], ~sourceGroup); // dry audio signaL
~reverbFX = Synth(\freeVerb, [\in, ~reverbBus], ~fxGroup);
~ringMod = Synth(\ringModulator, [\in, ~ringModBus], ~fxGroup);
// START SYNTHS -------------------------------------
Synth(\mic, [\in, 0, \out, ~micBus], ~micGrp); Synth(\mic, [\in, 0, \out, ~micBus], ~micGrp);
~pointer = Synth(\ptr, [\buf, b, \out, ~ptrBus], ~ptrGrp); ~pointer = Synth(\ptr, [\buf, b, \out, ~ptrBus], ~ptrGrp);
//.Synth(\rec, [\ptrIn, ~ptrBus, \micIn, ~micBus, \buf, b], ~recGrp); // todo make togglable between fx and dry feeding sampler
r = Synth(\recBuf, [\ptrIn, ~ptrBus, \micIn, ~micBus, \buf, b, \t_trig, 0], ~recGrp); // recorder
~gtrIn = Synth(\dryIn, [\instrAmp, 1, \out, ~reverbBus], ~micGrp); // dry audio signaL
~reverbFX = Synth(\freeVerb, [\in, ~reverbBus], ~fxGrp);
~ringMod = Synth(\ringModulator, [\in, ~ringModBus], ~fxGrp);
b.zero; b.zero;
~g = 4.collect({ ~g = 1.collect({
arg n; arg n;
Synth(\gran,[ Synth(\gran,[
\amp, 0.15, \amp, 0.25,
// \amp, n.linlin(0,4, -3,-20).dbamp, // \amp, n.linlin(0,4, -3,-20).dbamp,
\buf, b, // which buffer \buf, b, // which buffer
\out, 0, \out, 0,
\atk, 10, \atk, 10,
\rel, 10, \rel, 10,
\gate, 1, \gate, 1,
\sync, 1, \sync, 0,
\dens, 21, // exprand(2,80), \dens, 1, // exprand(2,80),
\baseDur, 1, //0.08 \baseDur, 1, //0.08
\durRand, 1, \durRand, 1,
\rate, 1, \rate, 1,
@ -233,29 +206,26 @@ b.zero;
\minPtrDelay, 1000, // dont get any closer to the ptr than this \minPtrDelay, 1000, // dont get any closer to the ptr than this
], ~granGrp); ], ~granGrp);
}); });
);
); }); // end makeBundle
s.makeBundle(2.0, {
// RUNME 4 ==========================================
// RUNME 4 ==========================================
// - - OSC Receivers // ENABLE SENSOR AND SWITCH VALUES // - - OSC Receivers // ENABLE SENSOR AND SWITCH VALUES
OSCFunc.trace(true); // Turn posting on
OSCFunc.trace(false); // Turn posting off
( // ---------------------------------------------------- ( // ----------------------------------------------------
~overdubMode= 0; ~pitchMode = 0; ~posMode = 0; ~impulseMode = 0; r.set(\l, 1);
~gdurMode=0; ~gpanMode=0; ~channelmode=0; ~instrPanMode=0; ~overdubMode= 0;
~pitchMode = 0;
/* ~posMode = 6;
~btnstate = []; ~densMode= 4;
~btnsA = []; ~impulseMode = 0;
~btnsB = []; ~gdurMode=0;
~btnsC = [];*/ ~gpanMode=0;
~channelmode=0;
~instrPanMode=0;
~btn0val = -1; ~btn1val = -1; ~btn2val = -1; ~btn3val = -1; ~btn0val = -1; ~btn1val = -1; ~btn2val = -1; ~btn3val = -1;
~btn4val = -1; ~btn5val = -1; ~btn6val = -1; ~btn7val = -1; ~btn4val = -1; ~btn5val = -1; ~btn6val = -1; ~btn7val = -1;
@ -264,24 +234,22 @@ OSCFunc.trace(false); // Turn posting off
~btn9val = -1; ~btn10val = -1; ~btn11val = -1; ~btn12val = -1; ~btn9val = -1; ~btn10val = -1; ~btn11val = -1; ~btn12val = -1;
~btn13val = -1; ~btn14val = -1; ~btn15val = -1; ~btn16val = -1; ~btn13val = -1; ~btn14val = -1; ~btn15val = -1; ~btn16val = -1;
//~pitchMode=7;
(( // accel gyro quaternion mapping /////////////////// (( // accel gyro quaternion mapping ///////////////////
// msg[1] msg[2] msg[3] X Y Z ==> ROLL, PITCH, YAW // msg[1] msg[2] msg[3] X Y Z ==> ROLL, PITCH, YAW
o = OSCdef(\test, { arg msg, time, addr, recvPort, rlow, rhigh; o = OSCdef(\test, { arg msg, time, addr, recvPort, rlow, rhigh;
if ( ~pitchMode == 7, if ( ~pitchMode == 7,
{ {
//"it's 7".postln; //"it's 7".postln;
msg.postln; msg.postln;
~g.do({arg n; n.set( ~g.do({arg n; n.set(
\rate, msg[2].linlin(-1, 1, 0.5, 2); \rate, msg[2].linlin(-0.5, 0.5, 0.125,2);
\rateRand, msg[3].linlin(0, -0.5, 1, 10); //\rateRand, msg[3].linlin(0, -0.5, 1, 10);
)}; ); )}; );
}, },
{"not 7".postln;} ); {} );
if ( ~posMode == 7, if ( ~posMode == 7,
{ {
@ -291,13 +259,11 @@ o = OSCdef(\test, { arg msg, time, addr, recvPort, rlow, rhigh;
//\ptrRandSamples, s.sampleRate * 0.125, \minPtrDelay, 1000, \ptrSampleDelay, s.sampleRate * msg[2].linlin(-0.3, 0.3, 0.1, 3) ; //\ptrRandSamples, s.sampleRate * 0.125, \minPtrDelay, 1000, \ptrSampleDelay, s.sampleRate * msg[2].linlin(-0.3, 0.3, 0.1, 3) ;
//\sig, BufFrames.kr(b) * msg[2].linlin(-0.3, 0.3, 0.1, 1) //\sig, BufFrames.kr(b) * msg[2].linlin(-0.3, 0.3, 0.1, 1)
)}; ); )}; );
}, }, {} );
{"not 7".postln;} );
}; , '/euler'); }; , '/euler');
); );
// ---------------------------------------------------- // ----------------------------------------------------
// send message back to nodejs // send message back to nodejs
@ -309,44 +275,39 @@ m.sendMsg("/xyzc", 0);
// ---------------------------------------------------- // ----------------------------------------------------
// button press mapping /////////////////////////////// // button press mapping ///////////////////////////////
// ---------------------------------------------------- // ----------------------------------------------------
n = NetAddr("127.0.0.1", NetAddr.langPort); n = NetAddr("127.0.0.1", NetAddr.langPort);
p = OSCdef(\keys, { arg msg, time, addr, recvPort; p = OSCdef(\keys, { arg msg, time, addr, recvPort;
//msg[1].postln;
/* ~btnsA[~btn2val, ~btn3val];
~btnsB[~btn4val, ~btn5val, ~btn6val, ~btn7val];
~btnsC[~btn5val];*/
// ~btnstate = [~btnsA, ~btnsB, ~btnsC]; // /// PRESETS !!!!!!!!!!!!!!!!!!!!!!!
//
/// PRESETS !!!!!!!!!!!!!!!!!!!!!!! // if (msg[9] == 1 && msg[10] == 1, {
//
if (msg[9] == 1 && msg[10] == 1, { // ( ~btn0val = (~btn0val + 1) % 5 ) ;
// switch( ~btn0val,
( ~btn0val = (~btn0val + 1) % 5 ) ; // 0, { "PONTALISTIFANTASTICO".postln;
switch( ~btn0val, //
0, { "PONTALISTIFANTASTICO".postln; // ~g.do({arg n; n.set(\baseDur, 0.5 )});
// ~g.do({arg n; n.set(\durRand, 1)});
~g.do({arg n; n.set(\baseDur, 0.5 )}); // ~g.do({arg n; n.set(\dens, 32)});
~g.do({arg n; n.set(\durRand, 1)}); // ~g.do({arg n; n.set(\rate, 1)});
~g.do({arg n; n.set(\dens, 32)}); // ~g.do({arg n; n.set(\rateRand, 32)});
~g.do({arg n; n.set(\rate, 1)}); // ~g.do({arg n; n.set(\sync, 1)});
~g.do({arg n; n.set(\rateRand, 32)}); // ~g.do({arg n; n.set(\ptrRandSamples, 6400000, )});
~g.do({arg n; n.set(\sync, 1)}); // },
~g.do({arg n; n.set(\ptrRandSamples, 6400000, )}); //
}, // 1, { "DRONAUSAURUS".postln;
// ~g.do({arg n; n.set([\baseDur, 1, \durRand, 2, \dens, 100, \rate, 1, \rateRand, 1, \sync, 0, \ptrRandSamples, 200000, ])}); },
1, { "DRONAUSAURUS".postln; // 2, { "MINIMAL5THsISM".postln;
~g.do({arg n; n.set([\baseDur, 1, \durRand, 2, \dens, 100, \rate, 1, \rateRand, 1, \sync, 0, \ptrRandSamples, 200000, ])}); }, // ~g.do({arg n; n.set([\baseDur, 0, \durRand, 6, \dens, 1, \rate, 1, \rateRand, 1.1, \sync, 1, \ptrRandSamples, 200000, ])}); },
2, { "MINIMAL5THsISM".postln; // 3, { "PONTALISTIFANTASTICO====".postln;
~g.do({arg n; n.set([\baseDur, 0, \durRand, 6, \dens, 1, \rate, 1, \rateRand, 1.1, \sync, 1, \ptrRandSamples, 200000, ])}); }, // ~g.do({arg n; n.set([\baseDur, 0, \durRand, 6, \dens, 1, \rate, 1, \rateRand, 1.1, \sync, 1, \ptrRandSamples, 200000, ])}); },
3, { "PONTALISTIFANTASTICO====".postln; // 4, { "PONTALISTIFANTASTICO+++++++++".postln;
~g.do({arg n; n.set([\baseDur, 0, \durRand, 6, \dens, 1, \rate, 1, \rateRand, 1.1, \sync, 1, \ptrRandSamples, 200000, ])}); }, // ~g.do({arg n; n.set([\baseDur, 0, \durRand, 6, \dens, 1, \rate, 1, \rateRand, 1.1, \sync, 1, \ptrRandSamples, 200000, ])}); },
4, { "PONTALISTIFANTASTICO+++++++++".postln; // );
~g.do({arg n; n.set([\baseDur, 0, \durRand, 6, \dens, 1, \rate, 1, \rateRand, 1.1, \sync, 1, \ptrRandSamples, 200000, ])}); }, //
); //});
});
// ============================== // ==============================
// BUTTON MAPPING // BUTTON MAPPING
@ -391,13 +352,7 @@ p = OSCdef(\keys, { arg msg, time, addr, recvPort;
}); });
///// GUI UPDATER CODE ///////////////////////////////////////////////////////////////// ///// GUI UPDATER CODE /////////////////////////////////////////////////////////////////
//// sampler gui //// sampler gui
case case
{~overdubMode == 0 }{{~overdubModeGui.value_(0) }.defer; r.set(\overdub, 0); } {~overdubMode == 0 }{{~overdubModeGui.value_(0) }.defer; r.set(\overdub, 0); }
{~overdubMode == 1 }{{~overdubModeGui.value_(1) }.defer; r.set(\overdub, 0.3); } {~overdubMode == 1 }{{~overdubModeGui.value_(1) }.defer; r.set(\overdub, 0.3); }
@ -434,7 +389,7 @@ p = OSCdef(\keys, { arg msg, time, addr, recvPort;
case // \ptrSampleDelay case // \ptrSampleDelay
{~posMode == 0 }{{~posModeGui.value_(0) }.defer; ~g.do({arg n; n.set( {~posMode == 0 }{{~posModeGui.value_(0) }.defer; ~g.do({arg n; n.set(
\ptrRandSamples, s.sampleRate * 0.125, \minPtrDelay, 1000, \ptrSampleDelay, s.sampleRate * 1) }); } \ptrRandSamples, s.sampleRate * 0, \minPtrDelay, 1000, \ptrSampleDelay, s.sampleRate * 1) }); }
{~posMode == 1 }{{~posModeGui.value_(1) }.defer; ~g.do({arg n; n.set( {~posMode == 1 }{{~posModeGui.value_(1) }.defer; ~g.do({arg n; n.set(
\ptrRandSamples, s.sampleRate * 0.25, \minPtrDelay, 1500, \ptrSampleDelay, s.sampleRate * 1) }); } \ptrRandSamples, s.sampleRate * 0.25, \minPtrDelay, 1500, \ptrSampleDelay, s.sampleRate * 1) }); }
@ -514,9 +469,8 @@ p = OSCdef(\keys, { arg msg, time, addr, recvPort;
{~fxMode == 11 }{{~fxModeGui.value_(11) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, rrand(1,1111), \mulrate, 1); } {~fxMode == 11 }{{~fxModeGui.value_(11) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, rrand(1,1111), \mulrate, 1); }
{~fxMode == 12 }{{~fxModeGui.value_(12) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, rrand(1,22111), \mulrate, 1); }; {~fxMode == 12 }{{~fxModeGui.value_(12) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, rrand(1,22111), \mulrate, 1); };
////////////////////////////////////////////////////////////////////
// BUTTON X ----> toggle fx // BUTTON X ----> toggle fx ////////////////////////////////////
if (msg[13]==1, if (msg[13]==1,
{ {
( ~btn4val = (~btn4val + 1) % 13 ) ; ( ~btn4val = (~btn4val + 1) % 13 ) ;
@ -544,7 +498,7 @@ p = OSCdef(\keys, { arg msg, time, addr, recvPort;
( ~btn5val = (~btn5val + 1) % 2 ) ; ( ~btn5val = (~btn5val + 1) % 2 ) ;
switch( ~btn5val, switch( ~btn5val,
0, { ~pitchMode = 0; "PITCH RESET TO UNTRANSPOSED MODE".postln; }, 0, { ~pitchMode = 0; "PITCH RESET TO UNTRANSPOSED MODE".postln; },
1, { ~pitchMode = 1; "PITCH IN SENSOR MODE".postln; } 1, { ~pitchMode = 7; "PITCH IN SENSOR MODE".postln; }
); );
}); });
@ -591,11 +545,9 @@ p = OSCdef(\keys, { arg msg, time, addr, recvPort;
) )
}); });
}, /// SHIFT 0 LOGIC ENDS HERE -------------------------------------------- }, /// SHIFT 0 LOGIC ENDS HERE --------------------------------------------
{ { // SHIFT IN STATE 1 ======================= ..........................
// SHIFT IN STATE 1 ======================= ..........................
// GTR INPUT ======================= // GTR INPUT =======================
if (msg[11]==1, if (msg[11]==1,
@ -682,95 +634,11 @@ p = OSCdef(\keys, { arg msg, time, addr, recvPort;
}); // SHIFT ONE LOGIC ENDS HERE ================ }); // SHIFT ONE LOGIC ENDS HERE ================
} , '/keys'); //} , '/keys');
// } , '/localhostInLevels'); } , '/localhostInLevels');
));
); );
);
}); // end makeBundle for OSC code
}; // end wait for boot
// todo countdown on density voices
~gdurMode = 2;
// ----------------------------------------------------
// LIVE CODE / PERFORMABLE PARAMETERS /////////////////
// ----------------------------------------------------
// set recorder loop and overdub modes ////////////
// start recording (without button)
r.set(\in, 0, \l, 1, \overdub, 0.2, \t_trig, 1);
r.set(\l, 0); // looping record on/off 0/1 - MAPPED TO SWITCH 3
r.set(\overdub, 0.9); // overdub mode 0 - 0.99 - MAPPED TO SWITCH 4
~ptrGrp.set(\rate, 0.2);
~g.set(\gate, 0);
~g.do({arg n; n.set(\gate, 1 )});
~g.do({arg n; n.set(\rate, 2 )});
\amp, n.linlin(0,4, -3,-20).dbamp,
~g.do({arg n; n.set(\amp, 0.8)});
~g.do({arg n; n.set(\rateRand, 300 )});
~g.do({arg n; n.set(\amp, 0.3, \dens, 4 )});
~g.do({arg n; n.set(\rateRand, 0)});
~g.do({arg n; n.set(\baseDur, 2)});
~g.do({arg n; n.set(\durRand, 100)});
~g.do({arg n; n.set(\panRand, 1)});
~g.do({arg n; n.set(\sync, 1 )});
~g.do({arg n; n.set(\atk, exprand(0.1, 1) )});
~g.do({arg n; n.set(\atk, exprand(0.1, 1) )});
~g.do({arg n; n.set(\atk, 1000 )});
~g.do({arg n; n.set(\rel, 1000 )});
~g.do({arg n; n.set(\dens, exprand(1,80) )});
~g.do({arg n; n.set(\dens,10)});
~g.do({arg n; n.set(\panRand, 1 )});
\ptrSampleDelay, n.linlin(0,4, 20000, s.sampleRate*5),
~g.do({arg n; n.set(\ptrSampleDelay, s.sampleRate * 4) });
~g.do({arg n; n.set(\ptrRandSamples, s.sampleRate * 4 )});
~g.do({arg n; n.set(\ptrRandSamples, 2000 )});
~g.do({arg n; n.set(\minPtrDelay, 200 )});
~g.do({arg n; n.set([\baseDur, 0.0100])});
~g.do({arg n; n.set([\durRand, 1000])});
~g.do({arg n; n.set([\baseDur, 0, \durRand, 6, \dens, 1, \rate, 1, \rateRand, 1.1, \sync, 1, \ptrRandSamples, 200000, ])});
~g.do({arg n; n.set(\baseDur, 0.3, \durRand, 1, \sync, 1, \dens, 155 )});
~g.do({arg n; n.set([\baseDur, 1.08, \durRand, 3, \sync, 0, \dens, 25 ])});
~rec.set(\overdubLevel, 0.1);
~pointer.set(\ptrMode, 1);
////////////////////////////////////////////////////////////////////////
thisProcess.platform.recordingsDir;// find where the recordings are written to
s.record(numChannels:4); // record
// CODE DUMP ZONE ///////////////////////////////
// switch to the custom env
//~g1.set(\envbuf, z);
//~g1.set(\envbuf, -1);
n = NetAddr("127.0.0.1", NetAddr.langPort);
//n = NetAddr.new("224.0.1.9", 6696);