new controler mappings

master
Rob Canning 2022-11-22 12:42:06 +01:00
parent 9543dbd72e
commit f1c1167ebe
2 changed files with 350 additions and 204 deletions

View File

@ -46,7 +46,6 @@ StaticText(~inputGui, Rect(0,0,230,40))
}); });
~recModeGui = Button(~inputGui, Rect(100, 110, 140, 90)) ~recModeGui = Button(~inputGui, Rect(100, 110, 140, 90))
.states_([ .states_([
["TRIGGER \n ACTIVE", Color.black, Color.green], ["TRIGGER \n ACTIVE", Color.black, Color.green],
@ -61,7 +60,6 @@ StaticText(~inputGui, Rect(0,0,230,40))
}); });
StaticText(~inputGui, Rect(100,200,130,30)) StaticText(~inputGui, Rect(100,200,130,30))
.string_("OVERDUB LEVEL").background_(Color.clear) .string_("OVERDUB LEVEL").background_(Color.clear)
.stringColor_(Color.white) .stringColor_(Color.white)
@ -119,22 +117,22 @@ VLayout(
StaticText(~grainGui, Rect(50,50,300,40)).string_("PLAYHEAD MODE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30)); StaticText(~grainGui, Rect(50,50,300,40)).string_("PLAYHEAD MODE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30));
~positionModeGui = QPopUpMenu(~grainGui, Rect(10, 50, 300, 40)) ~positionModeGui = QPopUpMenu(~grainGui, Rect(10, 50, 300, 40))
.items_(["Static", "Looping","Randomise","Constrained", "Sensor"]) .items_([0, "Static", "Looping","Randomise","Constrained", "Sensor", 6, 7])
.font_(Font.default.size_(35)).background_(Color.yellow); .font_(Font.default.size_(35)).background_(Color.yellow);
StaticText(~grainGui, Rect(50,50,300,40)).string_("PITCH MODE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30)); StaticText(~grainGui, Rect(50,50,300,40)).string_("PITCH MODE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30));
~pitchModeGui = QPopUpMenu.new(~grainGui, Rect(10,100,300,40)) ~pitchModeGui = QPopUpMenu.new(~grainGui, Rect(10,100,300,40))
.items_(["no transpose","sensor","octave randomisation", "array 2", "array 3", "array 4", "RND 1", "RND 2", "RND 3", ]) .items_([0,1,2,3,4,5,6,7])
.font_(Font.default.size_(35)) .font_(Font.default.size_(35))
.stringColor_(Color.black).background_(Color.yellow); .stringColor_(Color.black).background_(Color.yellow);
StaticText(~grainGui, Rect(50,50,300,40)).string_("DURATION MODE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30)); StaticText(~grainGui, Rect(50,50,300,40)).string_("DURATION MODE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30));
~durModeGui = QPopUpMenu.new(~grainGui, Rect(10,150,300,40)) ~durModeGui = QPopUpMenu.new(~grainGui, Rect(10,150,300,40))
.items_(["0.1","0.2","0.1 - 1", "0.1 - 1", "0.5 - 1", "0.1 - 3"]) .items_([0, 1,2,3,4,5,6,7])
.font_(Font.default.size_(35)) .font_(Font.default.size_(35))
.value_(~gdurmode) .value_(0)
.stringColor_(Color.black).background_(Color.yellow); .stringColor_(Color.black).background_(Color.yellow);
StaticText(~grainGui, Rect(50,50,300,40)).string_("DENSITY / VOICES").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30)); StaticText(~grainGui, Rect(50,50,300,40)).string_("DENSITY / VOICES").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30));
@ -142,15 +140,13 @@ VLayout(
~densityModeGui = QPopUpMenu.new(~grainGui, Rect(10,200,300,40)) ~densityModeGui = QPopUpMenu.new(~grainGui, Rect(10,200,300,40))
.items_(["1", "2","4","8","16","32","64","128"]) .items_(["1", "2","4","8","16","32","64","128"])
.font_(Font.default.size_(35)).background_(Color.yellow) .font_(Font.default.size_(35)).background_(Color.yellow);
.value_(6);
StaticText(~grainGui, Rect(50,50,300,40)).string_("IMPULSE MODE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30)); StaticText(~grainGui, Rect(50,50,300,40)).string_("IMPULSE MODE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30));
~impulseModeGui = QPopUpMenu.new(~grainGui, Rect(10,250,300,40)) ~impulseModeGui = QPopUpMenu.new(~grainGui, Rect(10,250,300,40))
.items_(["Impulse","Dust","Array"]) .items_(["Impulse","Dust","Array"])
.font_(Font.default.size_(35)).background_(Color.yellow) .font_(Font.default.size_(35)).background_(Color.yellow);
.value_(0);
~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));

522
gtr.scd
View File

@ -1,4 +1,4 @@
'
// RUNME 0 ========================================= // RUNME 0 =========================================
// todo countdown on density voices // todo countdown on density voices
@ -107,9 +107,9 @@ SynthDef("ringModulator", {
// ---------~positionmode = 1; ------------------------------------------- // ---------~positionMode = 1; -------------------------------------------
( // Granulator --------------------------------------r.get(\in).postln; /*( // Granulator --------------------------------------r.get(\in).postln;
// ---------------------------------------------------- // ----------------------------------------------------
@ -201,7 +201,7 @@ SynthDef(\buf_grain, { | out=0, gate = 1, amp = 0.5,
Out.ar(0, signal); Out.ar(0, signal);
}).add; }).add;
); );*/
( (
~micBus = Bus.audio(s,1); ~micBus = Bus.audio(s,1);
@ -236,16 +236,20 @@ SynthDef.new(\rec, {
SynthDef("recBuf",{ SynthDef("recBuf",{
arg in=0, out=0, ptrIn=0, bufnum=0, t_trig=0, l=0, overdub=0; arg in=0, out=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(in, 1); sig = SoundIn.ar(in, 1);
ptr = In.ar(ptrIn, 1); // ptr = In.ar(ptrIn, 1);
// Onsets // Onsets
//chain = FFT(LocalBuf(512), sig); //chain = FFT(LocalBuf(512), sig);
//onsets = Onsets.kr(chain, MouseX.kr(0,1), \rcomplex); //onsets = Onsets.kr(chain, MouseX.kr(0,1), \rcomplex);
RecordBuf.ar(sig, bufnum, loop:l, RecordBuf.ar(sig, bufnum, loop:l,
recLevel: 1,
preLevel: overdub, preLevel: overdub,
doneAction: 0, trigger:t_trig, offset: ptr,); doneAction: 0, trigger:t_trig,
//offset: ptr,
);
}).add; }).add;
); );
@ -281,7 +285,7 @@ SynthDef.new(\gran, {
sig = GrainBuf.ar( sig = GrainBuf.ar(
2, 4,
densCtrl, densCtrl,
durCtrl, durCtrl,
buf, buf,
@ -304,12 +308,12 @@ SynthDef.new(\gran, {
) )
( // New Granulator -------------------------------------- /*( // New Granulator --------------------------------------
SynthDef(\buf_grain, { | out=0, gate = 1, amp = 0.5, SynthDef(\buf_grain, { | out=0, gate = 1, amp = 0.5,
sndbuf, envbuf, pan=0, imp=50, sndbuf, envbuf, pan=0, imp=50,
pitchmodeindex=0, sensorpitch=1, sensorgdur=0.1, sensorgpan=0, pitchmodeindex=0, sensorpitch=1, sensordensity=1, sensorgdur=0.1, sensorgpan=0,
positionmodeindex=0, gdurmodeindex=0, gpanmodeindex=0, positionmodeindex=0, gdurmodeindex=0, gpanmodeindex=0, densitymodeindex=0,
sensorposition=0, impulsemodeindex=0, sensorimpulse=0, sensorposition=0, impulsemodeindex=0, sensorimpulse=0,
signalChannelIndex=1, dseqarrayIndex=1, signalChannelIndex=1, dseqarrayIndex=1,
rlow= -1, rhigh=10 | rlow= -1, rhigh=10 |
@ -319,6 +323,7 @@ SynthDef(\buf_grain, { | out=0, gate = 1, amp = 0.5,
gdurmode0, gdurmode1, gdurmode2, gdurmode3, gdurmode4, gdurmode5, gdurmode6, gdur, gdurmode0, gdurmode1, gdurmode2, gdurmode3, gdurmode4, gdurmode5, gdurmode6, gdur,
gpanmode0, gpanmode1, gpanmode2, gpan, gpanmode0, gpanmode1, gpanmode2, gpan,
positionmode0, positionmode1, positionmode2, positionmode3, position, positionmode0, positionmode1, positionmode2, positionmode3, position,
densmode0,densmode1,densmode2,densmode3,densmode4,densmode5,densmode6,densmode7, density,
impulsemode0, impulsemode1, impulse, impulsemode0, impulsemode1, impulse,
xdseq, dseq_array1, dseq_array2, dseq_array3, dseq_array4, dseq_array5, dseq_array6, xdseq, dseq_array1, dseq_array2, dseq_array3, dseq_array4, dseq_array5, dseq_array6,
stereosignal, quadsignalL, quadsignalR, quadsignal, signalchannels; stereosignal, quadsignalL, quadsignalR, quadsignal, signalchannels;
@ -336,14 +341,29 @@ SynthDef(\buf_grain, { | out=0, gate = 1, amp = 0.5,
[gdurmode0, gdurmode1, gdurmode2, gdurmode3, gdurmode4, gdurmode5, gdurmode6, sensorgdur]); [gdurmode0, gdurmode1, gdurmode2, gdurmode3, gdurmode4, gdurmode5, gdurmode6, sensorgdur]);
// grain pan mode STEREO, QUAD, ROTATING // grain pan mode STEREO, QUAD, ROTATING
gpanmode0 = LFNoise1.kr(100).range(-0.2, 0.2); gpanmode0 = LFNoise1.kr(100).range(-0.2, 0.2);
gpanmode1 = LFSaw.kr(0.33).bipolar.range(-1,1); gpanmode1 = LFSaw.kr(0.33).bipolar.range(-1,1);
gpanmode2 = LFNoise1.kr(100).range(-1, 1); gpanmode2 = LFNoise1.kr(100).range(-1, 1);
gpan = Select.kr(gpanmodeindex, gpan = Select.kr(gpanmodeindex,
[gpanmode0, gpanmode1, gpanmode2, sensorgpan]); [gpanmode0, gpanmode1, gpanmode2, sensorgpan]);
// grain pitch mode -untransposed, random, or sensor controlled
// density mode
dens0 = 1;
dens1 = 2;
dens2 = 4;
dens3 = 8;
dens4 = 16;
dens5 = 32;
dens6 = 64;
dens7 = 128;
density = Select.kr(densitymodeindex,
[dens0,dens1,dens2,dens3,dens4,dens5,dens6,dens7]);
// grain pitch mode -untransposed, random, or sensor controlled
pitchmode0 = 1; pitchmode0 = 1;
//pitchmode1 = Demand.kr(Impulse.kr(imp), 0, Dseq([1,-1, 2, 1, -1.5, 1, 1.33, 1, -0.5, 1, 3, 1, 2.37, 1, -0.33, 1], inf)); //pitchmode1 = Demand.kr(Impulse.kr(imp), 0, Dseq([1,-1, 2, 1, -1.5, 1, 1.33, 1, -0.5, 1, 3, 1, 2.37, 1, -0.33, 1], inf));
pitchmode1 = Demand.kr(Impulse.kr(imp), 0, Drand([1,1, 1,1,1,1, 2, 3, 3, 0.5, 0.5], inf)); pitchmode1 = Demand.kr(Impulse.kr(imp), 0, Drand([1,1, 1,1,1,1, 2, 3, 3, 0.5, 0.5], inf));
@ -378,7 +398,8 @@ SynthDef(\buf_grain, { | out=0, gate = 1, amp = 0.5,
Out.ar(0, signal); Out.ar(0, signal);
}).add; }).add;
) )*/
@ -390,36 +411,66 @@ SynthDef(\buf_grain, { | out=0, gate = 1, amp = 0.5,
// ---------------------------------------------------- // ----------------------------------------------------
r = Synth(\recBuf, [\in, 0, \out, 0, \bufnum, b, \t_trig, 0]); // recorder r = Synth(\recBuf, [\in, 0, \out, 0, \bufnum, b, \t_trig, 0]); // recorder
~g1 = Synth(\buf_grain, [\sndbuf, b, \amp, 0.5, \envbuf, -1, \gate, 1, doneAction: 2, ], ~fxGroup); // granulate
(
b.zero;
~g = 1.collect({
arg n;
Synth(\gran,[
\amp, n.linlin(0,4, -3,-20).dbamp,
\buf, b, // which buffer
\out, 0,
\atk, 1,
\rel, 1,
\gate, 1,
\sync, 1,
\dens, exprand(2,80),
\baseDur, 1, //0.08
\durRand, 5,
\rate, 1,
\rateRand, 2,
\pan, 0,
\panRand, 1.5,
\grainEnv, -1,
\ptrBus, ~ptrBus,
\ptrSampleDelay, n.linlin(0,4, 20000, s.sampleRate*2),
\ptrRandSamples, 2000,
\minPtrDelay, 1000,
], ~granGrp);
});
);
~gtrIn = Synth(\dryIn, [\instrAmp, 1, \out, ~reverbBus], ~sourceGroup); // dry audio signaL ~gtrIn = Synth(\dryIn, [\instrAmp, 1, \out, ~reverbBus], ~sourceGroup); // dry audio signaL
~reverbFX = Synth(\freeVerb, [\in, ~reverbBus], ~fxGroup); ~reverbFX = Synth(\freeVerb, [\in, ~reverbBus], ~fxGroup);
~ringMod = Synth(\ringModulator, [\in, ~ringModBus], ~fxGroup); ~ringMod = Synth(\ringModulator, [\in, ~ringModBus], ~fxGroup);
)); ));
r.get(\in).value;
//~ringMod.set(\in, 9); b.plot;
//~gtrIn.set(\out, 0);
//~gtrIn.set(\out, ~ringModBus);
//~gtrIn.set(\out, ~reverbBus);
//~gtrIn.set(\out, [~reverbBus, ~ringModBus]);
~ringMod.set(\modulator, 0); ~ringMod.set(\modulator, 0);
~ringMod.set(\mulrate, 0); ~ringMod.set(\mulrate, 0);
// RUNME 4 ========================================== // RUNME 4 ==========================================
// ---------------------------------------------- // ----------------------------------------------
OSCFunc.trace(true); // Turn posting on OSCFunc.trace(true); // Turn posting on
OSCFunc.trace(false); // Turn posting off OSCFunc.trace(false); // Turn posting off
(( // OSC Receivers // ENABLE SENSOR AND SWITCH VALUES <-- (( // OSC Receivers // ENABLE SENSOR AND SWITCH VALUES <--
// ---------------------------------------------------- // ----------------------------------------------------
~overdubmode= 0; ~pitchmode = 0; ~positionmode = 0; ~impulsemode = 1; ~overdubMode= 0; ~pitchMode = 0; ~positionMode = 0; ~impulseMode = 1;
~gdurmode=0; ~gpanmode=0; ~channelmode=0; ~gdurMode=0; ~gpanMode=0; ~channelmode=0;
~instrPanMode=0; ~instrPanMode=0;
~btnstate = []; ~btnstate = [];
@ -443,26 +494,29 @@ OSCFunc.trace(false); // Turn posting off
o = OSCdef(\test, { arg msg, time, addr, recvPort, rlow, rhigh; o = OSCdef(\test, { arg msg, time, addr, recvPort, rlow, rhigh;
// PAN ------- X Roll // PAN ------- X Roll
~g1.set(\pan, msg[1].linlin(-0.3, 0.3, -1, 1)); ~g1.set(\pan, msg[1].linlin(-0.3, 0.3, -1, 1));
~g1.set(\gpanmodeindex, ~gpanmode ); ~g1.set(\gpanmodeindex, ~gpanMode );
// PITCH ------- Y Pitch // PITCH ------- Y Pitch
~g1.set(\sensorpitch, msg[3]+1 * 2); ~g1.set(\sensorpitch, msg[3]+1 * 2);
~g1.set(\pitchmodeindex, ~pitchmode ); ~g1.set(\pitchmodeindex, ~pitchMode );
// POSITION ------- Z Yaw // POSITION ------- Z Yaw
~g1.set(\sensorposition, msg[1].linlin(-0.2, 0.6, 0.05, 3.99)); ~g1.set(\sensorposition, msg[1].linlin(-0.2, 0.6, 0.05, 3.99));
~g1.set(\positionmodeindex, ~positionmode ); ~g1.set(\positionmodeindex, ~positionMode );
// RATE ------- X (roll [with PAN]) // RATE ------- X (roll [with PAN])
~g1.set(\sensorimpulse, msg[2].linlin(-1, 1, 5, 50)); ~g1.set(\sensorimpulse, msg[2].linlin(-1, 1, 5, 50));
~g1.set(\impulsemodeindex, ~impulsemode ); ~g1.set(\impulsemodeindex, ~impulseMode );
~g1.set(\sensorgdur, msg[2].linlin(-1, 1, 0.1, 1)); ~g1.set(\sensorgdur, msg[2].linlin(-1, 1, 0.1, 1));
~g1.set(\gdurmodeindex, ~gdurmode ); ~g1.set(\gdurmodeindex, ~gdurMode );
~g1.set(\sensordensity, msg[2].linlin(-1, 1, 0.1, 1));
~g1.set(\densitymodeindex, ~gdurMode );
~g1.set(\sensorgpan, msg[2]); ~g1.set(\sensorgpan, msg[2]);
~g1.set(\gpanmodeindex, ~gpanmode ); ~g1.set(\gpanmodeindex, ~gpanMode );
//~g1.set(\sensorgpan, msg[2].linlin(-1, 1, -1, 1)); //~g1.set(\sensorgpan, msg[2].linlin(-1, 1, -1, 1));
//~g1.set(\signalChannelIndex, ~channelmode ); //~g1.set(\signalChannelIndex, ~channelmode );
@ -508,9 +562,35 @@ OSCFunc.trace(false); // Turn posting off
~btnstate = [~btnsA, ~btnsB, ~btnsC]; ~btnstate = [~btnsA, ~btnsB, ~btnsC];
if (msg[9] == 1 && msg[10] == 1, {~btnstate.postln;}); if (msg[9] == 1 && msg[10] == 1, {
( ~btn0val = (~btn0val + 1) % 5 ) ;
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(\dens, 32)});
~g.do({arg n; n.set(\rate, 1)});
~g.do({arg n; n.set(\rateRand, 32)});
~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, ])}); },
2, { "MINIMAL5THsISM".postln;
~g.do({arg n; n.set([\baseDur, 0, \durRand, 6, \dens, 1, \rate, 1, \rateRand, 1.1, \sync, 1, \ptrRandSamples, 200000, ])}); },
3, { "PONTALISTIFANTASTICO====".postln;
~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, ])}); },
);
});
//msg.println;
// ============================== // ==============================
// BUTTON MAPPING // BUTTON MAPPING
// ============================== // ==============================
@ -521,17 +601,21 @@ OSCFunc.trace(false); // Turn posting off
if (msg[9] == 0, { if (msg[9] == 0, {
// BUTTON X ----- TRIGGER ONESHOT BUFFER RECORD // BUTTON X ----- TRIGGER ONESHOT BUFFER RECORD
if (msg[10] == 1, { r.set( \in, 0, \l, 0, \t_trig, 1); if (msg[10] == 1, {
"/////////// SAMPLING!".postln; { ~recTrigButton.value_(0) }.defer }, { { ~recTrigButton.value_(1) }.defer } ); r.set( \in, 0, \l, 0, \t_trig, 1); "/////////// SAMPLING!".postln; { ~recTrigButton.value_(0) }.defer;
}, {
{~recTrigButton.value_(1) }.defer
} );
// BUTTON X ----> LOOP RECORDING MODE ON/OFF // BUTTON X ----> LOOP RECORDING MODE ON/OFF
if (msg[11]==1, if (msg[11]==1,
{ {
( ~btn2val = (~btn2val + 1) % 3 ) ; ( ~btn2val = (~btn2val + 1) % 3 ) ;
switch( ~btn2val, switch( ~btn2val,
0, { r.set(\l, 0); "RECORD LOOPING OFF".postln; { ~recModeGui.value_(0) }.defer }, 0, { r.set(\l, 0); "RECORD LOOPING OFF".postln; { ~recModeGui.value_(0) }.defer; },
1, { r.set(\l, 1); "RECORD LOOPING ON".postln; { ~recModeGui.value_(1) }.defer }, 1, { r.set(\l, 1); "RECORD LOOPING ON".postln; { ~recModeGui.value_(1) }.defer; },
2, { r.set(\l, 1); "ONSET DETECTION ON".postln; { ~recModeGui.value_(2) }.defer }, 2, { r.set(\l, 0); "ONSET DETECTION ON".postln; { ~recModeGui.value_(2) }.defer; },
); );
}); });
@ -540,65 +624,91 @@ OSCFunc.trace(false); // Turn posting off
{ {
( ~btn3val = (~btn3val + 1) % 6 ) ; ( ~btn3val = (~btn3val + 1) % 6 ) ;
switch( ~btn3val, switch( ~btn3val,
0, { r.set(\overdub, 0); "SAMPLE OVERDUB OFF".postln; { ~overdubModeGui.value_(0) }.defer }, 0, { ~overdubMode = 0; "SAMPLE OVERDUB OFF".postln; },
1, { r.set(\overdub, 0.3); "SAMPLE OVERDUB ON 30%".postln; { ~overdubModeGui.value_(1) }.defer }, 1, { ~overdubMode = 1; "SAMPLE OVERDUB ON 30%".postln; },
2, { r.set(\overdub, 0.5); "SAMPLE OVERDUB ON 50%".postln; { ~overdubModeGui.value_(2) }.defer }, 2, { ~overdubMode = 2; "SAMPLE OVERDUB ON 50%".postln; },
3, { r.set(\overdub, 0.75); "SAMPLE OVERDUB ON 75%".postln; { ~overdubModeGui.value_(3) }.defer }, 3, { ~overdubMode = 3; "SAMPLE OVERDUB ON 75%".postln; },
4, { r.set(\overdub, 0.90); "SAMPLE OVERDUB ON 90%".postln; { ~overdubModeGui.value_(4) }.defer }, 4, { ~overdubMode = 4; "SAMPLE OVERDUB ON 90%".postln; },
5, { r.set(\overdub, 1); "SAMPLE OVERDUB ON 100%".postln; { ~overdubModeGui.value_(5) }.defer }, 5, { ~overdubMode = 5; "SAMPLE OVERDUB ON 100%".postln; },
) )
}); });
case ///// GUI UPDATER CODE /////////////////////////////////////////////////////////////////
{~gdurmode == 0 }{{~durModeGui.value_(0) }.defer}
{~gdurmode == 1 }{{~durModeGui.value_(1) }.defer} //// sampler gui
{~gdurmode == 2 }{{~durModeGui.value_(2) }.defer}
{~gdurmode == 3 }{{~durModeGui.value_(3) }.defer}
{~gdurmode == 4 }{{~durModeGui.value_(4) }.defer}
{~gdurmode == 5 }{{~durModeGui.value_(5) }.defer}
{~gdurmode == 6 }{{~durModeGui.value_(6) }.defer}
{~gdurmode == 7 }{{~durModeGui.value_(7) }.defer};
case case
{~pitchmode == 0 }{{~pitchModeGui.value_(0) }.defer} {~overdubMode == 0 }{{~overdubModeGui.value_(0) }.defer; r.set(\overdub, 0); }
{~pitchmode == 1 }{{~pitchModeGui.value_(1) }.defer} {~overdubMode == 1 }{{~overdubModeGui.value_(1) }.defer; r.set(\overdub, 0.3); }
{~pitchmode == 2 }{{~pitchModeGui.value_(2) }.defer} {~overdubMode == 2 }{{~overdubModeGui.value_(2) }.defer; r.set(\overdub, 0.5); }
{~pitchmode == 3 }{{~pitchModeGui.value_(3) }.defer} {~overdubMode == 3 }{{~overdubModeGui.value_(3) }.defer; r.set(\overdub, 0.75); }
{~pitchmode == 4 }{{~pitchModeGui.value_(4) }.defer} {~overdubMode == 4 }{{~overdubModeGui.value_(4) }.defer; r.set(\overdub, 0.9); }
{~pitchmode == 5 }{{~pitchModeGui.value_(5) }.defer} {~overdubMode == 5 }{{~overdubModeGui.value_(5) }.defer; r.set(\overdub, 1); }
{~pitchmode == 6 }{{~pitchModeGui.value_(6) }.defer} {~overdubMode == 6 }{{~overdubModeGui.value_(6) }.defer; r.set(\overdub, 0); }
{~pitchmode == 7 }{{~pitchModeGui.value_(7) }.defer}; {~overdubMode == 7 }{{~overdubModeGui.value_(7) }.defer; r.set(\overdub, 0); };
// ~recTrigButton
// ~recModeGui
// granular gui
//
case
{~pitchMode == 0 }{{~pitchModeGui.value_(0) }.defer; ~g.do({arg n; n.set(\rateRand, 1, \rate, 1) }); }
{~pitchMode == 1 }{{~pitchModeGui.value_(1) }.defer; ~g.do({arg n; n.set(\rate, 2, \rateRand, 1) }); }
{~pitchMode == 2 }{{~pitchModeGui.value_(2) }.defer; ~g.do({arg n; n.set(\rate, 0.25, \rateRand, 1) }); }
{~pitchMode == 3 }{{~pitchModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 1.1) }); }
{~pitchMode == 4 }{{~pitchModeGui.value_(4) }.defer; ~g.do({arg n; n.set(\rate, 0.15, \rateRand, 3, \amp, 1.5) }); }
{~pitchMode == 5 }{{~pitchModeGui.value_(5) }.defer; ~g.do({arg n; n.set(\rate, 0.15, \rateRand, 100) }); }
{~pitchMode == 6 }{{~pitchModeGui.value_(6) }.defer; ~g.do({arg n; n.set(\rate, 100, \rateRand, 1000) }); }
{~pitchMode == 7 }{{~pitchModeGui.value_(7) }.defer; ~g.do({arg n; n.set(\rate, 0.015, \rateRand, 10000) }); };
//
case
{~gdurMode == 0 }{{~durModeGui.value_(0) }.defer}
{~gdurMode == 1 }{{~durModeGui.value_(1) }.defer}
{~gdurMode == 2 }{{~durModeGui.value_(2) }.defer}
{~gdurMode == 3 }{{~durModeGui.value_(3) }.defer}
{~gdurMode == 4 }{{~durModeGui.value_(4) }.defer}
{~gdurMode == 5 }{{~durModeGui.value_(5) }.defer}
{~gdurMode == 6 }{{~durModeGui.value_(6) }.defer}
{~gdurMode == 7 }{{~durModeGui.value_(7) }.defer};
case case
{~durationmode == 0 }{{~durationModeGui.value_(0) }.defer} {~positionMode == 0 }{{~positionModeGui.value_(0) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, 1) }); }
{~durationmode == 1 }{{~durationModeGui.value_(1) }.defer} {~positionMode == 1 }{{~positionModeGui.value_(1) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, 4000) }); }
{~durationmode == 2 }{{~durationModeGui.value_(2) }.defer} {~positionMode == 2 }{{~positionModeGui.value_(2) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, 8000) }); }
{~durationmode == 3 }{{~durationModeGui.value_(3) }.defer} {~positionMode == 3 }{{~positionModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, 16000) }); }
{~durationmode == 4 }{{~durationModeGui.value_(4) }.defer} {~positionMode == 4 }{{~positionModeGui.value_(4) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, 32000) }); }
{~durationmode == 5 }{{~durationModeGui.value_(5) }.defer} {~positionMode == 5 }{{~positionModeGui.value_(5) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, 64000) }); }
{~durationmode == 6 }{{~durationModeGui.value_(6) }.defer} {~positionMode == 6 }{{~positionModeGui.value_(6) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, 128000) }); }
{~durationmode == 7 }{{~durationModeGui.value_(7) }.defer}; {~positionMode == 7 }{{~positionModeGui.value_(7) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, 256000) }); };
case case
{~positionmode == 0 }{{~positionModeGui.value_(0) }.defer} {~densMode == 0 }{{~densityModeGui.value_(0) }.defer; ~g.do({arg n; n.set(\dens, 1)});}
{~positionmode == 1 }{{~positionModeGui.value_(1) }.defer} {~densMode == 1 }{{~densityModeGui.value_(1) }.defer; ~g.do({arg n; n.set(\dens, 2)}); }
{~positionmode == 2 }{{~positionModeGui.value_(2) }.defer} {~densMode == 2 }{{~densityModeGui.value_(2) }.defer; ~g.do({arg n; n.set(\dens, 4)});}
{~positionmode == 3 }{{~positionModeGui.value_(3) }.defer} {~densMode == 3 }{{~densityModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\dens, 8)});}
{~positionmode == 4 }{{~positionModeGui.value_(4) }.defer} {~densMode == 4 }{{~densityModeGui.value_(4) }.defer; ~g.do({arg n; n.set(\dens, 16)});}
{~positionmode == 5 }{{~positionModeGui.value_(5) }.defer} {~densMode == 5 }{{~densityModeGui.value_(5) }.defer; ~g.do({arg n; n.set(\dens, 32)});}
{~positionmode == 6 }{{~positionModeGui.value_(6) }.defer} {~densMode == 6 }{{~densityModeGui.value_(6) }.defer; ~g.do({arg n; n.set(\dens, 64)});}
{~positionmode == 7 }{{~positionModeGui.value_(7) }.defer}; {~densMode == 7 }{{~densityModeGui.value_(7) }.defer; ~g.do({arg n; n.set(\dens, 128)}); };
case case
{~gpanmode == 0 }{{~panModeGui.value_(0) }.defer} {~gpanMode == 0 }{{~gPanModeGui.value_(0) }.defer; ~g.do({arg n; n.set(\panRand, 0.25, \pan, 0)}); }
{~gpanmode == 1 }{{~panModeGui.value_(1) }.defer} {~gpanMode == 1 }{{~gPanModeGui.value_(1) }.defer; ~g.do({arg n; n.set(\panRand, 0.25, \pan, 0)}); }
{~gpanmode == 2 }{{~panModeGui.value_(2) }.defer} {~gpanMode == 2 }{{~gPanModeGui.value_(2) }.defer; ~g.do({arg n; n.set(\pan, 0, \panRand, 1)}); }
{~gpanmode == 3 }{{~panModeGui.value_(3) }.defer} {~gpanMode == 3 }{{~gPanModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\panRand, 0)}); }
{~gpanmode == 4 }{{~panModeGui.value_(4) }.defer} {~gpanMode == 4 }{{~gPanModeGui.value_(4) }.defer; ~g.do({arg n; n.set(\panRand, 0)}); }
{~gpanmode == 5 }{{~panModeGui.value_(5) }.defer} {~gpanMode == 5 }{{~gPanModeGui.value_(5) }.defer; ~g.do({arg n; n.set(\panRand, 0)}); }
{~gpanmode == 6 }{{~panModeGui.value_(6) }.defer} {~gpanMode == 6 }{{~gPanModeGui.value_(6) }.defer; ~g.do({arg n; n.set(\panRand, 0)}); }
{~gpanmode == 7 }{{~panModeGui.value_(7) }.defer}; {~gpanMode == 7 }{{~gPanModeGui.value_(7) }.defer; ~g.do({arg n; n.set(\panRand, 0)}); };
case
{~impulseMode == 0 }{{~impulseModeGui.value_(0) }.defer; ~g.do({arg n; n.set(\sync, 0)}); }
{~impulseMode == 1 }{{~impulseModeGui.value_(1) }.defer; ~g.do({arg n; n.set(\sync, 1)}); };
////////////////// instrument mode gui
case case
{~instrPanMode == 0 }{{~instrPanModeGui.value_(0) }.defer } {~instrPanMode == 0 }{{~instrPanModeGui.value_(0) }.defer }
@ -610,37 +720,44 @@ OSCFunc.trace(false); // Turn posting off
{~instrPanMode == 6 }{{~instrPanModeGui.value_(6) }.defer } {~instrPanMode == 6 }{{~instrPanModeGui.value_(6) }.defer }
{~instrPanMode == 7 }{{~instrPanModeGui.value_(7) }.defer }; {~instrPanMode == 7 }{{~instrPanModeGui.value_(7) }.defer };
case case
{~impulsemode == 0 }{{~impulseModeGui.value_(0) }.defer} {~fxMode == 0 }{{~fxModeGui.value_(0) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 0, \mulrate, 0); }
{~impulsemode == 1 }{{~impulseModeGui.value_(1) }.defer} {~fxMode == 1 }{{~fxModeGui.value_(1) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 77, \mulrate, 0.1); }
{~impulsemode == 2 }{{~impulseModeGui.value_(2) }.defer} {~fxMode == 2 }{{~fxModeGui.value_(2) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 277, \mulrate, 10.1);}
{~fxMode == 3 }{{~fxModeGui.value_(3) }.defer; ~gtrIn.set(\out, [~reverbBus, ~ringModBus]); ~ringMod.set(\modulator, 277, \mulrate, 10.1);}
{~fxMode == 4 }{{~fxModeGui.value_(4) }.defer; ~gtrIn.set(\out, ~reverbBus); }
{~fxMode == 5 }{{~fxModeGui.value_(5) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 0, \mulrate, 0); }
{~fxMode == 6 }{{~fxModeGui.value_(6) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 0, \mulrate, 0); }
{~fxMode == 7 }{{~fxModeGui.value_(7) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 0, \mulrate, 0); };
//////////////////////////////////////////////////////////////////////////////
// BUTTON X ----> toggle fx // BUTTON X ----> toggle fx
if (msg[13]==1, if (msg[13]==1,
{ {
( ~btn4val = (~btn4val + 1) % 4 ) ; ( ~btn4val = (~btn4val + 1) % 8 ) ;
switch( ~btn4val, switch( ~btn4val,
0, { r.set(\l, 0); "dry".postln; { ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 0, \mulrate, 0); ~fxModeGui.value_(0) }.defer }, 0, { ~fxMode=0; "fx0".postln; },
1, { r.set(\l, 1); "ring mod".postln; { ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 77, \mulrate, 0.1); ~fxModeGui.value_(1) }.defer }, 1, { ~fxMode=1; "fx1".postln; },
2, { r.set(\l, 1); "reverb".postln; { ~gtrIn.set(\out, ~reverbBus); ~fxModeGui.value_(2) }.defer }, 2, { ~fxMode=2; "fx2".postln; },
3, { r.set(\l, 1); "reverb + ringmod".postln; { ~gtrIn.set(\out, [~reverbBus, ~ringModBus]); ~fxModeGui.value_(3) }.defer }, 3, { ~fxMode=3; "fx3".postln; },
4, { ~fxMode=4; "fx4".postln; },
5, { ~fxMode=5; "fx5".postln; },
6, { ~fxMode=6; "fx6".postln; },
7, { ~fxMode=7; "fx7".postln; },
); );
}); });
/////////////////// RESET RANDOM PITCH TO FIXED PITCH IN ONE TAP /////////////////// RESET RANDOM PITCH TO FIXED PITCH IN ONE TAP
if (msg[14]==1, if (msg[14]==1,
{ {
( ~btn5val = (~btn5val + 1) % 2 ) ; ( ~btn5val = (~btn5val + 1) % 2 ) ;
switch( ~btn5val, switch( ~btn5val,
0, { ~pitchmode = 0; "PITCH RESET TO UNTRANSPOSED MODE".postln; { ~pitchModeGui.value_(0) }.defer }, 0, { ~pitchMode = 0; "PITCH RESET TO UNTRANSPOSED MODE".postln; },
1, { ~pitchmode = 1; "PITCH IN SENSOR MODE".postln; { ~pitchModeGui.value_(1) }.defer } 1, { ~pitchMode = 1; "PITCH IN SENSOR MODE".postln; }
); );
}); });
@ -650,14 +767,14 @@ OSCFunc.trace(false); // Turn posting off
{ {
( ~btn6val = (~btn6val + 1) % 8 ) ; ( ~btn6val = (~btn6val + 1) % 8 ) ;
switch(~btn6val, switch(~btn6val,
0, { ~g1.set(\imp, 1); "IMPULSE = 1".postln; { ~densityModeGui.value_(0) }.defer }, 0, { ~densMode = 0; "DENSITY MODE 0".postln; ~g.do({arg n; n.set(\amp, 1, \dens, 1 )}); },
1, { ~g1.set(\imp, 2); "IMPULSE = 2".postln; { ~densityModeGui.value_(1) }.defer }, 1, { ~densMode = 1; "DENSITY MODE 1".postln; ~g.do({arg n; n.set(\amp, 0.9, \dens, 4 )}); },
2, { ~g1.set(\imp, 4); "IMPULSE = 4".postln; { ~densityModeGui.value_(2) }.defer }, 2, { ~densMode = 2; "DENSITY MODE 2".postln; ~g.do({arg n; n.set(\amp, 0.5, \dens, 8 )}); },
3, { ~g1.set(\imp, 8); "IMPULSE = 8".postln; { ~densityModeGui.value_(3) }.defer }, 3, { ~densMode = 3; "DENSITY MODE 3".postln; ~g.do({arg n; n.set(\amp, 0.8, \dens, 16 )}); },
4, { ~g1.set(\imp, 16); "IMPULSE = 16".postln; { ~densityModeGui.value_(4) }.defer }, 4, { ~densMode = 4; "DENSITY MODE 4".postln; ~g.do({arg n; n.set(\amp, 0.8, \dens, 32 )}); },
5, { ~g1.set(\imp, 32); "IMPULSE = 32".postln; { ~densityModeGui.value_(5) }.defer }, 5, { ~densMode = 5; "DENSITY MODE 5".postln; ~g.do({arg n; n.set(\amp, 0.9, \dens, 64 )}); },
6, { ~g1.set(\imp, 64); "IMPULSE = 64".postln; { ~densityModeGui.value_(6) }.defer }, 6, { ~densMode = 6; "DENSITY MODE 6".postln; ~g.do({arg n; n.set(\amp, 0.75, \dens, 128 )}); },
7, { ~g1.set(\imp, 64); "IMPULSE = 64".postln; { ~densityModeGui.value_(7) }.defer }, 7, { ~densMode = 7; "DENSITY MODE 7".postln; ~g.do({arg n; n.set(\amp, 0.5, \dens, 256 )}); },
) )
}); });
@ -667,15 +784,15 @@ OSCFunc.trace(false); // Turn posting off
{ {
( ~btn7val = (~btn7val + 1) % 9 ) ; ( ~btn7val = (~btn7val + 1) % 9 ) ;
switch( ~btn7val, switch( ~btn7val,
0, { ~gpanmode = 0 ; "SIGNAL OFF".postln; { ~gPanModeGui.value_(0)}.defer }, 0, { ~gpanMode = 0 ; "SIGNAL OFF".postln; },
1, { ~gpanmode = 1 ; "DRY FRONT {STERE0}".postln; { ~gPanModeGui.value_(1)}.defer }, 1, { ~gpanMode = 1 ; "DRY FRONT {STERE0}".postln; },
2, { ~gpanmode = 2 ; "DRY BACK {STERE0}".postln; { ~gPanModeGui.value_(2)}.defer }, 2, { ~gpanMode = 2 ; "DRY BACK {STERE0}".postln; },
3, { ~gpanmode = 3 ; "L/R PAN {STEREO}".postln; { ~gPanModeGui.value_(3)}.defer }, 3, { ~gpanMode = 3 ; "L/R PAN {STEREO}".postln; },
4, { ~gpanmode = 4 ; "DRY RaND {STEREO}".postln; { ~gPanModeGui.value_(4)}.defer }, 4, { ~gpanMode = 4 ; "DRY RaND {STEREO}".postln; },
5, { ~gpanmode = 5 ; "DRY ROTATE {QUAD}".postln; { ~gPanModeGui.value_(5)}.defer }, 5, { ~gpanMode = 5 ; "DRY ROTATE {QUAD}".postln; },
6, { ~gpanmode = 6 ; "DRY RaND {QUAD}".postln; { ~gPanModeGui.value_(6)}.defer }, 6, { ~gpanMode = 6 ; "DRY RaND {QUAD}".postln; },
7, { ~gpanmode = 7 ; "DRY SENSOR {QUAD}".postln; { ~gPanModeGui.value_(7)}.defer }, 7, { ~gpanMode = 7 ; "DRY SENSOR {QUAD}".postln; },
8, { ~gpanmode = 8 ; "PAN RANDOM QUAD".postln; { ~gPanModeGui.value_(8)}.defer }, 8, { ~gpanMode = 8 ; "PAN RANDOM QUAD".postln; },
) )
}); });
@ -690,17 +807,18 @@ OSCFunc.trace(false); // Turn posting off
{ {
( ~btn10val = (~btn10val + 1) % 9 ) ; ( ~btn10val = (~btn10val + 1) % 9 ) ;
switch(~btn10val, switch(~btn10val,
0, { ~gtrIn.set(\instrAmp, 0 ); "DRY SIGNAL OFF".postln;{ ~instrPanModeGui.value_(0)}.defer }, 0, { ~gtrIn.set(\instrAmp, 0 ); "DRY SIGNAL OFF".postln; },
1, { ~gtrIn.set(\in, 0, \instrAmp, 1 ); ~instrPanMode=0; "DRY FRONT {STERE0}".postln; { ~instrPanModeGui.value_(1)}.defer }, 1, { ~instrPanMode=0; "DRY FRONT {STERE0}".postln; },
2, { ~gtrIn.set(\in, 0 ); ~instrPanMode=1; "DRY BACK {STERE0}".postln; { ~instrPanModeGui.value_(2)}.defer }, 2, { ~instrPanMode=1; "DRY BACK {STERE0}".postln; },
3, { ~gtrIn.set(\in, 0 ); ~instrPanMode=2; "DRY RaND {STEREO}".postln; { ~instrPanModeGui.value_(3)}.defer }, 3, { ~instrPanMode=2; "DRY RaND {STEREO}".postln; },
4, { ~gtrIn.set(\in, 0 ); ~instrPanMode=3; "L/R PAN {STEREO}".postln; { ~instrPanModeGui.value_(4)}.defer }, 4, { ~instrPanMode=3; "L/R PAN {STEREO}".postln; },
5, { ~gtrIn.set(\in, 0 ); ~instrPanMode=4; "DRY ROTATE {QUAD}".postln; { ~instrPanModeGui.value_(5)}.defer }, 5, { ~instrPanMode=4; "DRY ROTATE {QUAD}".postln; },
6, { ~gtrIn.set(\in, 0 ); ~instrPanMode=5; "DRY RaND {QUAD}".postln; { ~instrPanModeGui.value_(6)}.defer }, 6, { ~instrPanMode=5; "DRY RaND {QUAD}".postln; },
7, { ~gtrIn.set(\in, 0 ); ~instrPanMode=6; "DRY SENSOR {QUAD}".postln; { ~instrPanModeGui.value_(7)}.defer }, 7, { ~instrPanMode=6; "DRY SENSOR {QUAD}".postln; },
8, { ~gtrIn.set(\in, 0 ); ~instrPanMode=7; "DRY SENSOR {QUAD}".postln; { ~instrPanModeGui.value_(8)}.defer }, 8, { ~instrPanMode=7; "DRY SENSOR {QUAD}".postln; },
) )
}); });
@ -713,34 +831,32 @@ OSCFunc.trace(false); // Turn posting off
// BUTTON X ----- GRANULAR POSITION MODE // BUTTON X ----- GRANULAR POSITION MODE
if (msg[13]==1, if (msg[13]==1,
{ {
( ~btn12val = (~btn12val + 1) % 5 ) ; ( ~btn12val = (~btn12val + 1) % 8 ) ;
switch(~btn12val, switch(~btn12val,
0, { ~positionmode = 0; "PLAYHEAD MODE FIXED".postln; { ~positionModeGui.value_(0) }.defer }, 0, { ~positionMode = 0; "~positionMode 0 ".postln; },
1, { ~positionmode = 1; "PLAYHEAD MODE LOOPING".postln; { ~positionModeGui.value_(1) }.defer }, 1, { ~positionMode = 1; "~positionMode 1 ".postln; },
2, { ~positionmode = 2; "PLAYHEAD MODE RANDOM".postln; { ~positionModeGui.value_(2) }.defer }, 2, { ~positionMode = 2; "~positionMode 2".postln; },
3, { ~positionmode = 3; "PLAYHEAD CONSTRAINED RND".postln; { ~positionModeGui.value_(3) }.defer }, 3, { ~positionMode = 3; "~positionMode 3".postln; },
4, { ~positionmode = 4; "PLAYHEAD MODE SENSOR".postln; { ~positionModeGui.value_(4) }.defer }, 4, { ~positionMode = 5; "~positionMode 4".postln; },
5, { ~positionMode = 6; "~positionMode 5".postln; },
6, { ~positionMode = 7; "~positionMode 6 ".postln; },
7, { ~positionMode = 8; "~positionMode 7 ".postln; },
) )
}); });
// BUTTON X ----- GRANULAR PITCH MODE // BUTTON X ----- GRANULAR PITCH MODE
if (msg[14]==1, if (msg[14]==1,
{ {
( ~btn13val = ((~btn13val + 1) % 9 ) ) ; ( ~btn13val = ((~btn13val + 1) % 8 ) ) ;
switch(~btn13val, switch(~btn13val,
0, { ~pitchmode = 0; "pitch array 0".postln; { ~pitchModeGui.value_(0) }.defer }, 0, { ~pitchMode = 0; "pitch mode 0".postln; },
1, { ~pitchmode = 1; "pitch array 1".postln; { ~pitchModeGui.value_(1) }.defer }, 1, { ~pitchMode = 1; "pitch mode 1".postln; },
2, { ~pitchmode = 2; "pitch array 2".postln; { ~pitchModeGui.value_(2) }.defer }, 2, { ~pitchMode = 2; "pitch mode 2".postln; },
3, { ~pitchmode = 3; "pitch array 3".postln; { ~pitchModeGui.value_(3) }.defer }, 3, { ~pitchMode = 3; "pitch mode 3".postln; },
4, { ~pitchmode = 4; "pitch array 4".postln; { ~pitchModeGui.value_(4) }.defer }, 4, { ~pitchMode = 4; "pitch mode 4".postln; },
5, { ~pitchmode = 5; "pitch array 5".postln; { ~pitchModeGui.value_(5) }.defer }, 5, { ~pitchMode = 5; "pitch mode 5".postln; },
6, { ~pitchmode = 6; "pitch array 6".postln; { ~pitchModeGui.value_(6) }.defer }, 6, { ~pitchMode = 6; "pitch mode 6".postln; },
7, { ~pitchmode = 7; ~g1.set(\rlow, -0.8 ); ~g1.set(\rhigh, 1.5); 7, { ~pitchMode = 7; "pitch mode 7".postln; },
"PITCH MODE RANDOM 4".postln; { ~pitchModeGui.value_(7) }.defer },
8, { ~pitchmode = 7; ~g1.set(\rlow, -3 ); ~g1.set(\rhigh, 3);
"PITCH MODE RANDOM 5".postln; { ~pitchModeGui.value_(8) }.defer },
9, { ~pitchmode = 7; ~g1.set(\rlow, -8 ); ~g1.set(\rhigh, 8);
"PITCH MODE RANDOM 6".postln; { ~pitchModeGui.value_(9) }.defer },
) )
}); });
@ -751,55 +867,105 @@ OSCFunc.trace(false); // Turn posting off
{ {
( ~btn14val = (~btn14val + 1) % 8 ) ; ( ~btn14val = (~btn14val + 1) % 8 ) ;
switch(~btn14val, switch(~btn14val,
0, { ~gdurmode = 0; "DURATION MODE 0".postln; { ~durModeGui.value_(0) }.defer }, 0, { ~gdurMode = 0; "DURATION MODE 0".postln; },
1, { ~gdurmode = 1; "DURATION MODE 1".postln; { ~durModeGui.value_(1) }.defer }, 1, { ~gdurMode = 1; "DURATION MODE 1".postln; },
2, { ~gdurmode = 2; "DURATION MODE 2".postln; { ~durModeGui.value_(2) }.defer }, 2, { ~gdurMode = 2; "DURATION MODE 2".postln; },
3, { ~gdurmode = 3; "DURATION MODE 3".postln; { ~durModeGui.value_(3) }.defer }, 3, { ~gdurMode = 3; "DURATION MODE 3".postln; },
4, { ~gdurmode = 4; "DURATION MODE 4".postln; { ~durModeGui.value_(4) }.defer }, 4, { ~gdurMode = 4; "DURATION MODE 4".postln; },
5, { ~gdurmode = 5; "DURATION MODE 5".postln; { ~durModeGui.value_(5) }.defer }, 5, { ~gdurMode = 5; "DURATION MODE 5".postln; },
6, { ~gdurmode = 6; "DURATION MODE 6".postln; { ~durModeGui.value_(6) }.defer }, 6, { ~gdurMode = 6; "DURATION MODE 6".postln; },
7, { ~gdurmode = 7; "DURATION MODE: SENSOR".postln; { ~durModeGui.value_(7) }.defer }, 7, { ~gdurMode = 7; "DURATION MODE: SENSOR".postln; },
) )
}); });
// BUTTON X ----- GRANULAR IMPULSE MODE // BUTTON X ----- GRANULAR IMPULSE MODE
if (msg[16]==1, if (msg[16]==1,
{ {
( ~btn15val = (~btn15val + 1) % 3 ) ; ( ~btn15val = (~btn15val + 1) % 2 ) ;
switch( ~btn15val, switch( ~btn15val,
0, { ~g1.set(\impulsemodeindex, 0 ); "IMPULSE MODE FIXED".postln; { ~impulseModeGui.value_(0) }.defer }, 0, { ~impulseMode = 0; ~g1.set(\impulsemodeindex, 0 ); "IMPULSE MODE FIXED".postln; },
1, { ~g1.set(\impulsemodeindex, 1 ); "IMPULSE MODE DUST".postln; { ~impulseModeGui.value_(1) }.defer }, 1, { ~impulseMode = 1; ~g1.set(\impulsemodeindex, 1 ); "IMPULSE MODE DUST".postln; },
2, { ~g1.set(\impulsemodeindex, 2 ); "IMPULSE MODE SENSOR".postln; { ~impulseModeGui.value_(2) }.defer },
) )
}); });
}); // SHIFT ONE LOGIC ENDS HERE ================ }); // SHIFT ONE LOGIC ENDS HERE ================
// } , '/keys'); } , '/keys');
} , '/localhostInLevels'); // } , '/localhostInLevels');
)); ));
~gdurmode = 2; ~gdurMode = 2;
// ---------------------------------------------------- // ----------------------------------------------------
// LIVE CODE / PERFORMABLE PARAMETERS ///////////////// // LIVE CODE / PERFORMABLE PARAMETERS /////////////////
// ---------------------------------------------------- // ----------------------------------------------------
// set recorder loop and overdub modes ////////////
// start recording (without button)
r.set(\in, 0, \l, 0, \overdub, 0, \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, 1 )});
\amp, n.linlin(0,4, -3,-20).dbamp,
~g.do({arg n; n.set(\amp, 1, \rateRand, 1000 )});
~g.do({arg n; n.set(\amp, 1, \rateRand, 1 )});
~g.do({arg n; n.set(\amp, 0, \dens, 128 )});
~g.do({arg n; n.set(\rateRand, 0)});
~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(\rel, 1 )});
~g.do({arg n; n.set(\dens, exprand(1,80) )});
~g.do({arg n; n.set(\dens,1)});
~g.do({arg n; n.set(\panRand, 1 )});
\ptrSampleDelay, n.linlin(0,4, 20000, s.sampleRate*2),
~g.do({arg n; n.set(\ptrSampleDelay, s.sampleRate * 1) });
~g.do({arg n; n.set(\ptrRandSamples, 200000 )});
~g.do({arg n; n.set(\minPtrDelay, 100000 )});
~g.do({arg n; n.set([\baseDur, 0.013])});
~g.do({arg n; n.set([\durRand, 10.2])});
~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.08, \durRand, 1])});
~g.do({arg n; n.set([\baseDur, 1.08, \durRand, 3, \sync, 0, \dens, 25 ])});
~rec.set(\overdubLevel, 0.1);
////////////////////////////////////////////////////////////////////////
thisProcess.platform.recordingsDir;// find where the recordings are written to thisProcess.platform.recordingsDir;// find where the recordings are written to
s.record(numChannels:4); // record s.record(numChannels:4); // record
// set recorder loop and overdub modes ////////////
// start recording (without button)
r.set(\in, 0, \l, 0, \t_trig, 1);
r.set(\l, 1); // looping record on/off 0/1 - MAPPED TO SWITCH 3
r.set(\overdub, 0.9); // overdub mode 0 - 0.99 - MAPPED TO SWITCH 4
///////////////////// /////////////////////
~g1.set(\pitchmodeindex, 1); // pitchmode ~g1.set(\pitchmodeindex, 1); // pitchmode
~g1.set(\gdurmodeindex, 1); // grain duration mode ~g1.set(\gdurmodeindex, 1); // grain duration mode
@ -811,34 +977,19 @@ r.set(\overdub, 0.9); // overdub mode 0 - 0.99 - MAPPED TO SWITCH 4
~ringMod.set(\modulator, 0); // 0 to disable ~ringMod.set(\modulator, 0); // 0 to disable
/// random pitch/rate low and high values
~g1.set(\rlow, 10); // APPLIES ONLY TO PITCH MODE 7
~g1.set(\rhigh, 1);
~dseqarrayIndex=0;
~g1.set(\dseqarrayIndex, 0);
~g1.set(\gpan, -1 );
~channelmode = 1; ~channelmode = 1;
//~ringMod.set(\in, 0); //~ringMod.set(\in, 0);
//~gtrIn.set(\out, 0); //~gtrIn.set(\out, 0);
//~gtrIn.set(\out, ~ringModBus); ~gtrIn.set(\out, ~ringModBus);
//~gtrIn.set(\out, ~reverbBus); //~gtrIn.set(\out, ~reverbBus);
//~gtrIn.set(\out, [~reverbBus, ~ringModBus]); //~gtrIn.set(\out, [~reverbBus, ~ringModBus]);
~ringMod.set(\modulator, 77, \mulrate, 0.1); ~ringMod.set(\modulator, 177, \mulrate, 0.1);
~ringMod.set(\modulator, 0, \mulrate, 0); ~ringMod.set(\modulator, 0, \mulrate, 0);
~ringMod.set(\mulrate, 0); ~ringMod.set(\mulrate, 0);
~gtrIn.set(\instrAmp, 1); ~gtrIn.set(\instrAmp, 1);
// fix doneaction // fix doneaction
~g1.set(\gate, 1); // granulator on ~g1.set(\gate, 1); // granulator on
~g1.set(\gate, 0); // granulator off ~g1.set(\gate, 0); // granulator off
@ -850,7 +1001,7 @@ a = Scale.major;
// ----------------------------------------------- // -----------------------------------------------
~btn4val = 2; ~btn4val = 2;
~gdurmode = 4; ~gdurMode = 4;
// list all open ports // list all open ports
// ----------------------------------------------- // -----------------------------------------------
@ -864,4 +1015,3 @@ n = NetAddr("127.0.0.1", NetAddr.langPort);