Compare commits

...

2 Commits

Author SHA1 Message Date
Rob Canning 9505ba4a52 accelerometer reintegrated 2022-12-06 00:40:39 +01:00
Rob Canning 9a51a20a4f glitch fix - pointer enabled properly 2022-12-05 12:39:53 +01:00
5 changed files with 681 additions and 697 deletions

View File

@ -114,7 +114,7 @@ VLayout(
StaticText(~grainGui, Rect(50,50,300,40)).string_("PLAYHEAD MODE").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30));
~posModeGui = QPopUpMenu(~grainGui, Rect(10, 50, 300, 40))
.items_([0, "Static", "Looping","Randomise","Constrained", "Sensor", 6, 7])
.items_(["0.125", "0.25", "0.5", "1","2", "3", "4", "sensor"])
.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));
@ -150,17 +150,17 @@ VLayout(
.value_(0)
.stringColor_(Color.black).background_(Color.yellow);
StaticText(~grainGui, Rect(50,50,300,40)).string_("DENSITY").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30));
StaticText(~grainGui, Rect(50,150,150,40)).string_("DENSITY").background_(Color.clear).stringColor_(Color.black).font_(Font.default.size_(30));
~densityModeGui = QPopUpMenu.new(~grainGui, Rect(10,200,100,40))
.items_(["1","2","3","5","8","13","21", "34", "55","89","144","233", "377"])
.font_(Font.default.size_(35)).background_(Color.yellow);
~densModeGui = QPopUpMenu.new(~grainGui, Rect(50,60,100,40))
.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,300,40)).string_("IMPULSE MODE").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(10,250,300,40))
.items_(["SYNCHRONIOUS","ASYNCHRONIOUS","Array"])
.font_(Font.default.size_(20)).background_(Color.yellow);
// ~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");
~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));
@ -181,7 +181,7 @@ VLayout(
.alwaysOnTop_(true);
~inputGui.bounds_(Rect(10, 60, 250, 450)); // contents adjust since coords are relative
~grainGui.bounds_(Rect(280, 60, 350, 550)); // 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
)

608
gtr.scd
View File

@ -1,4 +1,3 @@
// RUNME 0 =========================================
// todo countdown on density voices
@ -13,52 +12,43 @@
s.options.numOutputBusChannels = 8;
})
// RUNME 1 =========================================
( // SETUP ---------------=--------------------------
// Allocate a 4 second mono buffer
b = Buffer.alloc(s, s.sampleRate * 4.0, 1);
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);
// load a test file
//f = Buffer.read(s, thisProcess.nowExecutingPath.dirname +/+ "sounds/Front_Left.wav");
//b = Buffer.read(s, "/usr/share/sounds/alsa/Front_Left.wav");
//b=f;
// Open port 57121 for ESP32 UDP OSC
thisProcess.openUDPPort(57121);
///////////////////////////////////////
~sourceGroup = Group.new;
~fxGroup = Group.after(~sourceGroup);
~reverbBus = Bus.audio(s, 1);
~ringModBus = Bus.audio(s, 1);
~micGrp = Group.new;
~ptrGrp = Group.after(~micGrp);
~recGrp = Group.after(~ptrGrp);
~granGrp = Group.after(~recGrp);
//load the gui
"/home/rob/gtr/gtr-gui-manual.scd".load;
);
s.plotTree;
s.meter;
);
// RUNME 2 ==========================================
// -------------------------------------------------
(( // DEFINE SYNTHS ---------------------------------
s.meter;
// -------------------------------------------------
( // direct signal + reverb -------------------------
///// outs set to 2 /// for recording to ardour .... fork todo
SynthDef("dryIn", { arg in=0, instrPanModeIndex=0, out=0, sensorInstrPan=0, instrPitch=0.7, instrAmp=1;
SynthDef("dryIn", { arg in=0, instrPanModeIndex=0, out=2, sensorInstrPan=0, instrPitch=0.7, instrAmp=1;
var signal, dry, wet, instrPan, instrPanMode0, instrPanMode1, instrPanMode2, instrPanMode3, instrPanMode4, instrPanMode5;
instrPanMode0 = 0; //LFNoise1.kr(100).range(-0.2, 0.2);
@ -67,15 +57,12 @@ SynthDef("dryIn", { arg in=0, instrPanModeIndex=0, out=0, sensorInstrPan=0, ins
instrPanMode3 = LFNoise1.kr(10).range(-0.2, 0.2);
instrPanMode4 = LFSaw.kr(0.33).bipolar.range(-1,1);
instrPanMode5 = LFNoise1.kr(10).range(-1, 1);
instrPan = Select.kr(instrPanModeIndex,
[instrPanMode0, instrPanMode1, instrPanMode2, instrPanMode3,
instrPanMode4, instrPanMode5, sensorInstrPan]);
signal = SoundIn.ar(in);
//signal = PanAz.ar(4, signal, instrPan);
signal = signal * instrAmp;
//wet = PitchShift.ar(signal, pitchRatio: instrPitch, pitchDispersion: 0.3, timeDispersion: 0.1);
Out.ar(out, signal);
//Out.ar(0, Mix.ar( [signal, wet] ));
@ -84,12 +71,12 @@ SynthDef("dryIn", { arg in=0, instrPanModeIndex=0, out=0, sensorInstrPan=0, ins
(
SynthDef("freeVerb", {
arg in=0;
arg in=0, mix=0.5, room=0.8, damp = 0.5;
var signal, dry, wet;
dry = In.ar(in);
wet = FreeVerb.ar(dry, mix:0.5, room:0.99, damp:0.5,);
wet = FreeVerb.ar(dry, mix:mix, room:room, damp:damp,);
signal = wet * 0.9;
Out.ar(0, signal!2);
Out.ar(2, signal!2);
}).add;
);
@ -99,114 +86,13 @@ SynthDef("ringModulator", {
signal = In.ar(in);
multiplier = SinOsc.ar(mulrate);
rm = signal * SinOsc.ar(modulator, mul:multiplier);
signal = (rm + signal) * 0.5;
Out.ar(0, signal!2);
//signal = (rm + signal) * 0.5;
Out.ar(2, rm!2);
}).add;
);
// ---------~posMode = 1; -------------------------------------------
/*( // Granulator --------------------------------------r.get(\in).postln;
// ----------------------------------------------------
// a custom envelope
//var winenv;
//winenv = Env([0, 1, 0], [0.5, 0.5], [8, -8]);
//z = Buffer.sendCollection(s, winenv.discretize, 1);
// ~rndpos = LFNoise2.kr(0.1).range(0, 1);
SynthDef(\buf_grain, { | out=0, gate = 1, amp = 0.5,
sndbuf, envbuf, pan=0, imp=50,
pitchmodeindex=0, sensorpitch=1, sensorgdur=0.1, sensorgpan=0,
posModeindex=0, gdurmodeindex=0, gpanmodeindex=0,
sensorposition=0, impulsemodeindex=0, sensorimpulse=0,
signalChannelIndex=1, dseqarrayIndex=1,
rlow= -1, rhigh=10 |
var signal, env, freqdev, pos,
pitchmode0, pitchmode1, pitchmode2,pitchmode3,pitchmode4,pitchmode5, pitchmode6, pitch,
gdurmode0, gdurmode1, gdurmode2, gdurmode3, gdurmode4, gdurmode5, gdurmode6, gdur,
gpanmode0, gpanmode1, gpanmode2,gpanmode3, gpanmode4, gpanmode5,gpanmode6, gpanmode7, gpanmode8, gpan,
posMode0, posMode1, posMode2, posMode3, position,
impulsemode0, impulsemode1, impulse,
xdseq, dseq_array1, dseq_array2, dseq_array3, dseq_array4, dseq_array5, dseq_array6,
stereosignal, quadsignalL, quadsignalR, quadsignal, signalchannels;
// grain duration mode -untransposed, random, or sensor controlled
gdurmode0 = 0.2;
gdurmode1 = 0.5;
gdurmode2 = LFNoise1.kr.range(0.1, 0.3);
gdurmode3 = LFNoise1.kr.range(0.1, 0.6);
gdurmode4 = LFNoise1.kr.range(1, 2);
gdurmode5 = LFNoise1.kr.range(1, 4);
gdurmode6 = LFNoise1.kr.range(4, 4);
gdur = Select.kr(gdurmodeindex,
[gdurmode0, gdurmode1, gdurmode2, gdurmode3, gdurmode4, gdurmode5, gdurmode6, sensorgdur]);
// grain pan mode STEREO, QUAD, ROTATING
gpanmode0 = 0; //LFNoise1.kr(100).range(-0.2, 0.2);
gpanmode1 = 1; //LFNoise1.kr(100).range(-0.2, 0.2);
gpanmode2 = SinOsc.kr(0.33).range(-0.2, 0.2);
gpanmode3 = LFNoise1.kr(10).range(-0.2, 0.2);
gpanmode4 = LFSaw.kr(0.33).bipolar.range(-1,1);
gpanmode5 = LFNoise1.kr(10).range(-1, 1);
gpanmode6 = LFNoise1.kr(10).range(-1, 1);
gpanmode7 = LFNoise1.kr(10).range(-1, 1);
gpanmode8 = LFNoise1.kr(10).range(-1, 1);
gdurmode6 = LFNoise1.kr.range(4, 4);
gdurmode6 = LFNoise1.kr.range(4, 4);
gpan = Select.kr(gpanmodeindex,
[gpanmode0, gpanmode1, gpanmode2, gpanmode3, gpanmode4, gpanmode5, gpanmode6, gpanmode7, gpanmode8, sensorgpan]);
// grain pitch mode -untransposed, random, or sensor controlled
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, Drand([1,1, 1,1,1,1, 2, 3, 3, 0.5, 0.5], inf));
pitchmode2 = Demand.kr(Impulse.kr(imp), 0, Drand(Scale.minor.degrees.midiratio, inf) * Drand([0.5, 0.25,1,2], inf));
pitchmode3 = Demand.kr(Impulse.kr(imp), 0, Dseq([1,-1, -0.5, 1, 1.33, 1], inf));
pitchmode4 = Demand.kr(Impulse.kr(imp), 0, Drand([0.5, 0.25,1,2], inf));
pitchmode5 = Demand.kr(Impulse.kr(imp), 0, Drand(Scale.diminished.degrees.midiratio, inf));
pitchmode6 = LFNoise1.kr(imp).range(rlow, rhigh);
pitch = Select.kr(pitchmodeindex,
[pitchmode0, sensorpitch, pitchmode1, pitchmode2 ,pitchmode3, pitchmode4, pitchmode5, pitchmode6]);
// granular playhead mode - fixed random or sensor controlled
posMode0 = 0.2;
posMode1 = (Phasor.ar(0.01, 1 * BufRateScale.ir(b), 0, BufSamples.ir(b)) + LFNoise1.ar(100).bipolar(0.1 * SampleRate.ir) ) / BufSamples.ir(b);
posMode2 = LFNoise1.kr.range(0.05, (BufSamples.ir(b)-1) - 1000 );
posMode3 = LFNoise1.kr.range(0.1, 3.8 );
position = Select.kr(posModeindex,
[posMode0, posMode1, posMode2, posMode3, sensorposition]);
// grain impulse frequency mode - random, metric or sensor based impulse modes
impulsemode0 = Impulse.kr(imp);
impulsemode1 = Dust.kr(imp);
impulse = Select.kr(impulsemodeindex,
[impulsemode0, impulsemode1, sensorimpulse]);
env = EnvGen.kr( Env([0, 1, 0], [1, 1], \sin, 1), gate, levelScale: amp, doneAction: 2);
signal = TGrains.ar(4, impulse, b, pitch, position, gdur, gpan, amp, 4) * env;
Out.ar(0, signal);
}).add;
);*/
(
~micBus = Bus.audio(s,1);
~ptrBus = Bus.audio(s,1);
);
( ~micBus = Bus.audio(s,1); ~ptrBus = Bus.audio(s,1););
(
SynthDef.new(\mic, {
@ -217,14 +103,17 @@ SynthDef.new(\mic, {
}).add;
SynthDef.new(\ptr, {
arg out=0, buf=0;
arg out=0, buf=0, ptrMode=0;
var sig;
sig = Phasor.ar(0, BufRateScale.kr(buf), 0, BufFrames.kr(buf));
sig = Select.ar(ptrMode, [
Phasor.ar(0, BufRateScale.kr(buf), 0, BufFrames.kr(buf)),
LFNoise1.ar(100).exprange(10000, 1001)
//LFNoise1.ar(100).exprange(1/BufFrames.kr(buf), BufFrames.kr(buf))
]);
Out.ar(out, sig);
}).add;
b.numFrames;
SynthDef.new(\rec, {
arg ptrIn=0, micIn=0, buf=0;
var ptr, sig;
@ -236,10 +125,10 @@ SynthDef.new(\rec, {
( // mono buffer recorder ----------------------------
// with loop and overdub modes /////////////////////
SynthDef("recBuf",{
arg in=0, out=0, ptrIn=0, bufnum=0, t_trig=0, l=0, overdub=0;
arg micIn=0, out=0, ptrIn=0, bufnum=0, t_trig=0, l=0, overdub=0;
var sig, ptr, chain, onsets;
sig = SoundIn.ar(in, 1);
// ptr = In.ar(ptrIn, 1);
sig = In.ar(micIn, 1);
ptr = In.ar(ptrIn, 1);
// Onsets
//chain = FFT(LocalBuf(512), sig);
@ -249,14 +138,11 @@ SynthDef("recBuf",{
recLevel: 1,
preLevel: overdub,
doneAction: 0, trigger:t_trig,
//offset: ptr,
offset: ptr,
);
}).add;
);
SynthDef.new(\gran, {
arg amp=0.5, out=0, buf=0,
atk=1, rel=1, gate=1,
@ -276,7 +162,7 @@ SynthDef.new(\gran, {
panCtrl = pan + LFNoise1.kr(100).bipolar(panRand);
ptrRand = LFNoise1.ar(100).bipolar(ptrRandSamples);
totalDelay = max(ptrSampleDelay - ptrRand, minPtrDelay); // make sure value doesnt go below this value, which would cross discontinuity point
totalDelay = max(ptrSampleDelay - ptrRand, minPtrDelay); // make sure value doesnt go below this value and cross discontinuity point
ptr = In.ar(ptrBus, 1);
ptr = ptr - totalDelay; // how far ptr lags behind discontinuity point
@ -285,7 +171,6 @@ SynthDef.new(\gran, {
maxGrainDur = (totalDelay / rateCtrl) / SampleRate.ir;
durCtrl = min(durCtrl, maxGrainDur);
sig = GrainBuf.ar(
4,
densCtrl,
@ -303,125 +188,34 @@ SynthDef.new(\gran, {
}).add;
)
)
/*( // New Granulator --------------------------------------
SynthDef(\buf_grain, { | out=0, gate = 1, amp = 0.5,
sndbuf, envbuf, pan=0, imp=50,
pitchmodeindex=0, sensorpitch=1, sensordensity=1, sensorgdur=0.1, sensorgpan=0,
posModeindex=0, gdurmodeindex=0, gpanmodeindex=0, densitymodeindex=0,
sensorposition=0, impulsemodeindex=0, sensorimpulse=0,
signalChannelIndex=1, dseqarrayIndex=1,
rlow= -1, rhigh=10 |
var signal, env, freqdev, pos,
pitchmode0, pitchmode1, pitchmode2,pitchmode3,pitchmode4,pitchmode5, pitchmode6, pitch,
gdurmode0, gdurmode1, gdurmode2, gdurmode3, gdurmode4, gdurmode5, gdurmode6, gdur,
gpanmode0, gpanmode1, gpanmode2, gpan,
posMode0, posMode1, posMode2, posMode3, position,
densmode0,densmode1,densmode2,densmode3,densmode4,densmode5,densmode6,densmode7, density,
impulsemode0, impulsemode1, impulse,
xdseq, dseq_array1, dseq_array2, dseq_array3, dseq_array4, dseq_array5, dseq_array6,
stereosignal, quadsignalL, quadsignalR, quadsignal, signalchannels;
// grain duration mode -untransposed, random, or sensor controlled
gdurmode0 = 0.2;
gdurmode1 = 0.5;
gdurmode2 = LFNoise1.kr.range(0.1, 0.3);
gdurmode3 = LFNoise1.kr.range(0.1, 0.6);
gdurmode4 = LFNoise1.kr.range(1, 2);
gdurmode5 = LFNoise1.kr.range(1, 4);
gdurmode6 = LFNoise1.kr.range(4, 4);
gdur = Select.kr(gdurmodeindex,
[gdurmode0, gdurmode1, gdurmode2, gdurmode3, gdurmode4, gdurmode5, gdurmode6, sensorgdur]);
// grain pan mode STEREO, QUAD, ROTATING
gpanmode0 = LFNoise1.kr(100).range(-0.2, 0.2);
gpanmode1 = LFSaw.kr(0.33).bipolar.range(-1,1);
gpanmode2 = LFNoise1.kr(100).range(-1, 1);
gpan = Select.kr(gpanmodeindex,
[gpanmode0, gpanmode1, gpanmode2, sensorgpan]);
// 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;
//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));
pitchmode2 = Demand.kr(Impulse.kr(imp), 0, Drand(Scale.minor.degrees.midiratio, inf) * Drand([0.5, 0.25,1,2], inf));
pitchmode3 = Demand.kr(Impulse.kr(imp), 0, Dseq([1,-1, -0.5, 1, 1.33, 1], inf));
pitchmode4 = Demand.kr(Impulse.kr(imp), 0, Drand([0.5, 0.25,1,2], inf));
pitchmode5 = Demand.kr(Impulse.kr(imp), 0, Drand(Scale.diminished.degrees.midiratio, inf));
pitchmode6 = LFNoise1.kr(imp).range(rlow, rhigh);
pitch = Select.kr(pitchmodeindex,
[pitchmode0, sensorpitch, pitchmode1, pitchmode2 ,pitchmode3, pitchmode4, pitchmode5, pitchmode6]);
// granular playhead mode - fixed random or sensor controlled
posMode0 = 0.2;
posMode1 = (Phasor.ar(0.01, 1 * BufRateScale.ir(b), 0, BufSamples.ir(b)) + LFNoise1.ar(100).bipolar(0.1 * SampleRate.ir) ) / BufSamples.ir(b);
posMode2 = LFNoise1.kr.range(0.05, (BufSamples.ir(b)-1) - 1000 );
posMode3 = LFNoise1.kr.range(0.1, 3.8 );
position = Select.kr(posModeindex,
[posMode0, posMode1, posMode2, posMode3, sensorposition]);
// grain impulse frequency mode - random, metric or sensor based impulse modes
impulsemode0 = Impulse.kr(imp);
impulsemode1 = Dust.kr(imp);
impulse = Select.kr(impulsemodeindex,
[impulsemode0, impulsemode1, sensorimpulse]);
env = EnvGen.kr( Env([0, 1, 0], [1, 1], \sin, 1), gate, levelScale: amp, doneAction: 2);
signal = TGrains.ar(4, impulse, b, pitch, position, gdur, gpan, amp, 4) * env;
Out.ar(0, signal);
}).add;
)*/
))
( // RUNME 3 ==========================================
// START SYNTHS -------------------------------------
// START SYNTHS ---------------------------------
r = Synth(\recBuf, [\ptrIn, ~ptrBus, \micIn, ~micBus, \buf, b, \t_trig, 0], ~recGrp); // recorder
r = Synth(\recBuf, [\in, 0, \out, 0, \bufnum, b, \t_trig, 0]); // recorder
~gtrIn = Synth(\dryIn, [\instrAmp, 1, \out, ~reverbBus], ~sourceGroup); // dry audio signaL
~reverbFX = Synth(\freeVerb, [\in, ~reverbBus], ~fxGroup);
~ringMod = Synth(\ringModulator, [\in, ~ringModBus], ~fxGroup);
~gtrIn = Synth(\dryIn, [\instrAmp, 1, \out, ~reverbBus], ~sourceGroup); // dry audio signaL
~reverbFX = Synth(\freeVerb, [\in, ~reverbBus], ~fxGroup);
~ringMod = Synth(\ringModulator, [\in, ~ringModBus], ~fxGroup);
b.zero;
~g = 1.collect({
Synth(\mic, [\in, 0, \out, ~micBus], ~micGrp);
~pointer = Synth(\ptr, [\buf, b, \out, ~ptrBus], ~ptrGrp);
//.Synth(\rec, [\ptrIn, ~ptrBus, \micIn, ~micBus, \buf, b], ~recGrp);
b.zero;
~g = 4.collect({
arg n;
Synth(\gran,[
\amp, 0.15,
// \amp, n.linlin(0,4, -3,-20).dbamp,
\buf, b, // which buffer
\out, 0,
\atk, 1,
\rel, 1,
\atk, 10,
\rel, 10,
\gate, 1,
\sync, 1,
\dens, 21, // exprand(2,80),
@ -438,29 +232,30 @@ SynthDef(\buf_grain, { | out=0, gate = 1, amp = 0.5,
\ptrRandSamples, 2000, // how much to randomly jump around
\minPtrDelay, 1000, // dont get any closer to the ptr than this
], ~granGrp);
});
);
});
);
);
));
// RUNME 4 ==========================================
// ----------------------------------------------
// - - OSC Receivers // ENABLE SENSOR AND SWITCH VALUES
OSCFunc.trace(true); // Turn posting on
OSCFunc.trace(false); // Turn posting off
(( // OSC Receivers // ENABLE SENSOR AND SWITCH VALUES <--
( // ----------------------------------------------------
// ----------------------------------------------------
~overdubMode= 0; ~pitchMode = 0; ~posMode = 0; ~impulseMode = 1;
~gdurMode=0; ~gpanMode=0; ~channelmode=0;
~instrPanMode=0;
~overdubMode= 0; ~pitchMode = 0; ~posMode = 0; ~impulseMode = 0;
~gdurMode=0; ~gpanMode=0; ~channelmode=0; ~instrPanMode=0;
/*
~btnstate = [];
~btnsA = [];
~btnsB = [];
~btnsC = [];
~btnsC = [];*/
~btn0val = -1; ~btn1val = -1; ~btn2val = -1; ~btn3val = -1;
~btn4val = -1; ~btn5val = -1; ~btn6val = -1; ~btn7val = -1;
@ -469,90 +264,60 @@ OSCFunc.trace(false); // Turn posting off
~btn9val = -1; ~btn10val = -1; ~btn11val = -1; ~btn12val = -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
o = OSCdef(\test, { arg msg, time, addr, recvPort, rlow, rhigh;
o = OSCdef(\test, { arg msg, time, addr, recvPort, rlow, rhigh;
if ( ~pitchMode == 7,
{
//"it's 7".postln;
msg.postln;
~g.do({arg n; n.set(
\rate, msg[2].linlin(-1, 1, 0.5, 2);
\rateRand, msg[3].linlin(0, -0.5, 1, 10);
)}; );
},
{"not 7".postln;} );
if ( ~posMode == 7,
{
//"it's 7".postln;
msg.postln;
~ptr.do({arg n; n.set(
//\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)
)}; );
},
{"not 7".postln;} );
~g.do({arg n; n.set(\rateRand, msg[2].linlin(0, 1, 1, 50); )}; );
//~g.do({arg n; n.set(\rateRand, msg[2].linlin(0, 1, 1, 50).postln; )}; );
//~g.do({arg n; n.set(\rate, 1; )}; );
/* // PAN ------- X Roll
~g1.set(\pan, msg[1].linlin(-0.3, 0.3, -1, 1));
~g1.set(\gpanmodeindex, ~gpanMode );
// PITCH ------- Y Pitch
~g1.set(\sensorpitch, msg[3]+1 * 2);
~g1.set(\pitchmodeindex, ~pitchMode );
// POSITION ------- Z Yaw
~g1.set(\sensorposition, msg[1].linlin(-0.2, 0.6, 0.05, 3.99));
~g1.set(\posModeindex, ~posMode );
// RATE ------- X (roll [with PAN])
~g1.set(\sensorimpulse, msg[2].linlin(-1, 1, 5, 50));
~g1.set(\impulsemodeindex, ~impulseMode );
~g1.set(\sensorgdur, msg[2].linlin(-1, 1, 0.1, 1));
~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(\gpanmodeindex, ~gpanMode );
//~g1.set(\sensorgpan, msg[2].linlin(-1, 1, -1, 1));
//~g1.set(\signalChannelIndex, ~channelmode );
~gtrIn.set(\sensorInstrPan, msg[2].wrap(0, 5).linlin(0, 5, -1, 1));
~gtrIn.set(\instrPanModeIndex, ~instrPanMode);*/
//
//msg.postln;
}; , '/euler');
);
}; , '/euler');
);
// ----------------------------------------------------
// send message back to nodejs
m = NetAddr("127.0.0.1", 57100);
// on off osconoff accelerometer data
m.sendMsg("/xyzc", 1);
m.sendMsg("/xyzc", 0);
m = NetAddr("127.0.0.1", 57100);
// on off osconoff accelerometer data
m.sendMsg("/xyzc", 1);
m.sendMsg("/xyzc", 0);
// ----------------------------------------------------
// button press mapping ///////////////////////////////
// ----------------------------------------------------
n = NetAddr("127.0.0.1", NetAddr.langPort);
n = NetAddr("127.0.0.1", NetAddr.langPort);
//~switchArray = [0, 0, 0, 0 ,0 ,0 ,0, 0, 0, 0, 0, 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ];
//~switchArray.put(15, 1); ~switchArray.put(11, 1); ~switchArray.put(10, 1); ~switchArray.put(9, 1);
//j = List.new;
//j = ~switchArray.replace("[", "").replace("]", "");
//n.sendMsg("/keys", 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
//n.sendMsg("/keys",);
//n.sendMsg("/keys", 1,2,3,4,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);
p = OSCdef(\keys, { arg msg, time, addr, recvPort;
p = OSCdef(\keys, { arg msg, time, addr, recvPort;
//msg[1].postln;
~btnsA[~btn2val, ~btn3val];
/* ~btnsA[~btn2val, ~btn3val];
~btnsB[~btn4val, ~btn5val, ~btn6val, ~btn7val];
~btnsC[~btn5val];
~btnsC[~btn5val];*/
~btnstate = [~btnsA, ~btnsB, ~btnsC];
// ~btnstate = [~btnsA, ~btnsB, ~btnsC];
/// PRESETS !!!!!!!!!!!!!!!!!!!!!!!
@ -625,80 +390,88 @@ OSCFunc.trace(false); // Turn posting off
)
});
///// GUI UPDATER CODE /////////////////////////////////////////////////////////////////
///// GUI UPDATER CODE /////////////////////////////////////////////////////////////////
//// sampler gui
case
{~overdubMode == 0 }{{~overdubModeGui.value_(0) }.defer; r.set(\overdub, 0); }
{~overdubMode == 1 }{{~overdubModeGui.value_(1) }.defer; r.set(\overdub, 0.3); }
{~overdubMode == 2 }{{~overdubModeGui.value_(2) }.defer; r.set(\overdub, 0.5); }
{~overdubMode == 3 }{{~overdubModeGui.value_(3) }.defer; r.set(\overdub, 0.75); }
{~overdubMode == 4 }{{~overdubModeGui.value_(4) }.defer; r.set(\overdub, 0.9); }
{~overdubMode == 5 }{{~overdubModeGui.value_(5) }.defer; r.set(\overdub, 1); }
{~overdubMode == 6 }{{~overdubModeGui.value_(6) }.defer; r.set(\overdub, 0); }
{~overdubMode == 7 }{{~overdubModeGui.value_(7) }.defer; r.set(\overdub, 0); };
{~overdubMode == 5 }{{~overdubModeGui.value_(5) }.defer; r.set(\overdub, 1); };
// ~recTrigButton
// ~recModeGui
// granular gui ////////////////////////////////////////////////////////////////
// rrand(1,3); exprand(1,2); 5.rand; 1.0.linrand;
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.5, \rateRand, 1) }); }
{~pitchMode == 3 }{{~pitchModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 1.1) }); }
{~pitchMode == 3 }{{~pitchModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 1.1) }); }
{~pitchMode == 3 }{{~pitchModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 1.1) }); }
{~pitchMode == 3 }{{~pitchModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 1.1) }); }
{~pitchMode == 3 }{{~pitchModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 1.1) }); }
{~pitchMode == 3 }{{~pitchModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 1.1) }); }
{~pitchMode == 3 }{{~pitchModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 1.1) }); }
{~pitchMode == 3 }{{~pitchModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 1.1) }); }
{~pitchMode == 3 }{{~pitchModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 1.1) }); }
{~pitchMode == 3 }{{~pitchModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 1.1) }); }
{~pitchMode == 3 }{{~pitchModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 1.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.25, \rateRand, 5) }); }
{~pitchMode == 5 }{{~pitchModeGui.value_(5) }.defer; ~g.do({arg n; n.set(\rate, 0.1, \rateRand, 100) }); }
{~pitchMode == 6 }{{~pitchModeGui.value_(6) }.defer; ~g.do({arg n; n.set(\rate, 10, \rateRand, 1000) }); }
{~pitchMode == 7 }{{~pitchModeGui.value_(7) }.defer; ~g.do({arg n; n.set(\rate, 1) }); };
{~pitchMode == 4 }{{~pitchModeGui.value_(4) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 5) }); }
{~pitchMode == 5 }{{~pitchModeGui.value_(5) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 10) }); }
{~pitchMode == 6 }{{~pitchModeGui.value_(6) }.defer; ~g.do({arg n; n.set(\rate, 1, \rateRand, 100) }); }
{~pitchMode == 7 }{{~pitchModeGui.value_(7) }.defer; ~g.do({arg n; n.set() }); };
case
{~gdurMode == 0 }{{~durModeGui.value_(0) }.defer; ~g.do({arg n; n.set(\baseDur, 1, \durRand, 1)}); }
{~gdurMode == 1 }{{~durModeGui.value_(1) }.defer; ~g.do({arg n; n.set(\baseDur, 2, \durRand, 1)}); }
{~gdurMode == 2 }{{~durModeGui.value_(2) }.defer; ~g.do({arg n; n.set(\baseDur, 4, \durRand, 1)});}
{~gdurMode == 3 }{{~durModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\baseDur, 1/4, \durRand, 1)});}
{~gdurMode == 4 }{{~durModeGui.value_(4) }.defer; ~g.do({arg n; n.set(\baseDur, 1/8, \durRand, 1)});}
{~gdurMode == 5 }{{~durModeGui.value_(5) }.defer; ~g.do({arg n; n.set(\baseDur, 1/16, \durRand, 1)});}
{~gdurMode == 6 }{{~durModeGui.value_(6) }.defer; ~g.do({arg n; n.set(\baseDur, 1/32, \durRand, 1)});}
{~gdurMode == 7 }{{~durModeGui.value_(7) }.defer; ~g.do({arg n; n.set(\baseDur, 1/64, \durRand, 1)});};
{~gdurMode == 1 }{{~durModeGui.value_(1) }.defer; ~g.do({arg n; n.set(\baseDur, 4, \durRand, 1)}); }
{~gdurMode == 2 }{{~durModeGui.value_(2) }.defer; ~g.do({arg n; n.set(\baseDur, 1/4, \durRand, 5)});}
{~gdurMode == 3 }{{~durModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\baseDur, 1/8, \durRand, 100)});}
{~gdurMode == 4 }{{~durModeGui.value_(4) }.defer; ~g.do({arg n; n.set(\baseDur, 1/16, \durRand, 1)});}
{~gdurMode == 5 }{{~durModeGui.value_(5) }.defer; ~g.do({arg n; n.set(\baseDur, 1, \durRand, 100)});}
{~gdurMode == 6 }{{~durModeGui.value_(6) }.defer; ~g.do({arg n; n.set(\baseDur, 1, \durRand, 1000)});}
{~gdurMode == 7 }{{~durModeGui.value_(7) }.defer; ~g.do({arg n; n.set(\baseDur, 1, \durRand, 1)});};
case // \ptrSampleDelay
{~posMode == 0 }{{~posModeGui.value_(0) }.defer; ~g.do({arg n; n.set(
\ptrRandSamples, s.sampleRate * 0.125, \minPtrDelay, 1000, \ptrSampleDelay, s.sampleRate * 1) }); }
{~posMode == 1 }{{~posModeGui.value_(1) }.defer; ~g.do({arg n; n.set(
\ptrRandSamples, s.sampleRate * 0.25, \minPtrDelay, 1500, \ptrSampleDelay, s.sampleRate * 1) }); }
{~posMode == 2 }{{~posModeGui.value_(2) }.defer; ~g.do({arg n; n.set(
\ptrRandSamples, s.sampleRate * 0.5, \minPtrDelay, 1500, \ptrSampleDelay, s.sampleRate * 1) }); }
{~posMode == 3 }{{~posModeGui.value_(3) }.defer; ~g.do({arg n; n.set(
\ptrRandSamples, s.sampleRate * 1, \minPtrDelay, 1500, \ptrSampleDelay, s.sampleRate * 1) }); }
{~posMode == 4 }{{~posModeGui.value_(4) }.defer; ~g.do({arg n; n.set(
\ptrRandSamples, s.sampleRate * 2, \ptrSampleDelay, s.sampleRate * 1) }); }
{~posMode == 5 }{{~posModeGui.value_(5) }.defer; ~g.do({arg n; n.set(
\ptrRandSamples, s.sampleRate * 3, \ptrSampleDelay, s.sampleRate * 1) }); }
{~posMode == 6 }{{~posModeGui.value_(6) }.defer; ~g.do({arg n; n.set(
\ptrRandSamples, s.sampleRate * 5, \minPtrDelay, 1500, \ptrSampleDelay, s.sampleRate * 1) }); }
{~posMode == 7 }{{~posModeGui.value_(7) }.defer; ~g.do({arg n; n.set( ) }); }; //SENSOR MODE - SEE ABOVE
//[1,2,3].choose;
case
{~posMode == 0 }{{~posModeGui.value_(0) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, b.numFrames, \minPtrDelay, 1000) }); }
{~posMode == 1 }{{~posModeGui.value_(1) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, b.numFrames/4, \minPtrDelay, 1000 ) }); }
{~posMode == 2 }{{~posModeGui.value_(2) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, b.numFrames/8, \minPtrDelay, 1000 ) }); }
{~posMode == 3 }{{~posModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, b.numFrames/16, \minPtrDelay, 1000 ) }); }
{~posMode == 4 }{{~posModeGui.value_(4) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, b.numFrames/32) }); }
{~posMode == 5 }{{~posModeGui.value_(5) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, b.numFrames/64) }); }
{~posMode == 6 }{{~posModeGui.value_(6) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, 0.001, \minPtrDelay, 10 ) }); }
{~posMode == 7 }{{~posModeGui.value_(7) }.defer; ~g.do({arg n; n.set(\ptrRandSamples, b.numFrames/200000, \minPtrDelay, 1000;) }); };
case
{~densMode == 0 }{{~densityModeGui.value_(0) }.defer; ~g.do({arg n; n.set(\dens, 1, \amp, 1)}); }
{~densMode == 1 }{{~densityModeGui.value_(1) }.defer; ~g.do({arg n; n.set(\dens, 2, \amp, 1)}); }
{~densMode == 2 }{{~densityModeGui.value_(2) }.defer; ~g.do({arg n; n.set(\dens, 3, \amp, 1)});}
{~densMode == 3 }{{~densityModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\dens, 5, \amp, 1)});}
{~densMode == 4 }{{~densityModeGui.value_(4) }.defer; ~g.do({arg n; n.set(\dens, 8, \amp, 0.9)});}
{~densMode == 5 }{{~densityModeGui.value_(5) }.defer; ~g.do({arg n; n.set(\dens, 13, \amp, 0.85)});}
{~densMode == 6 }{{~densityModeGui.value_(6) }.defer; ~g.do({arg n; n.set(\dens, 21, \amp, 0.8)});}
{~densMode == 7 }{{~densityModeGui.value_(7) }.defer; ~g.do({arg n; n.set(\dens, 34, \amp, 0.75)}); }
{~densMode == 8 }{{~densityModeGui.value_(8) }.defer; ~g.do({arg n; n.set(\dens, 55, \amp, 0.65)}); }
{~densMode == 9 }{{~densityModeGui.value_(9) }.defer; ~g.do({arg n; n.set(\dens, 89, \amp, 0.5)}); }
{~densMode == 10 }{{~densityModeGui.value_(10) }.defer; ~g.do({arg n; n.set(\dens, 144, \amp, 0.45)}); }
{~densMode == 11 }{{~densityModeGui.value_(11) }.defer; ~g.do({arg n; n.set(\dens, 233, \amp, 0.4)}); }
{~densMode == 12 }{{~densityModeGui.value_(12) }.defer; ~g.do({arg n; n.set(\dens, 377, \amp, 0.2)}); };
{~densMode == 0 }{{~densModeGui.value_(0) }.defer; ~g.do({arg n; n.set(\dens, 1, )}); }
{~densMode == 1 }{{~densModeGui.value_(1) }.defer; ~g.do({arg n; n.set(\dens, 2, )}); }
{~densMode == 2 }{{~densModeGui.value_(2) }.defer; ~g.do({arg n; n.set(\dens, 3, )});}
{~densMode == 3 }{{~densModeGui.value_(3) }.defer; ~g.do({arg n; n.set(\dens, 5, )});}
{~densMode == 4 }{{~densModeGui.value_(4) }.defer; ~g.do({arg n; n.set(\dens, 8, )});}
{~densMode == 5 }{{~densModeGui.value_(5) }.defer; ~g.do({arg n; n.set(\dens, 13, )});}
{~densMode == 6 }{{~densModeGui.value_(6) }.defer; ~g.do({arg n; n.set(\dens, 21, )});}
{~densMode == 7 }{{~densModeGui.value_(7) }.defer; ~g.do({arg n; n.set(\dens, 34, )}); }
{~densMode == 8 }{{~densModeGui.value_(8) }.defer; ~g.do({arg n; n.set(\dens, 55, )}); }
{~densMode == 9 }{{~densModeGui.value_(9) }.defer; ~g.do({arg n; n.set(\dens, 89, )}); }
{~densMode == 10 }{{~densModeGui.value_(10) }.defer; ~g.do({arg n; n.set(\dens, 144, )}); }
{~densMode == 11 }{{~densModeGui.value_(11) }.defer; ~g.do({arg n; n.set(\dens, 233, )}); }
{~densMode == 12 }{{~densModeGui.value_(12) }.defer; ~g.do({arg n; n.set(\dens, 377, )}); };
case
{~gpanMode == 0 }{{~gPanModeGui.value_(0) }.defer; ~g.do({arg n; n.set(\panRand, 0.25, \pan, 0)}); }
@ -727,21 +500,26 @@ OSCFunc.trace(false); // Turn posting off
{~instrPanMode == 7 }{{~instrPanModeGui.value_(7) }.defer };
case
{~fxMode == 0 }{{~fxModeGui.value_(0) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 0, \mulrate, 0); }
{~fxMode == 1 }{{~fxModeGui.value_(1) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 77, \mulrate, 0.1); }
{~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); };
{~fxMode == 0 }{{~fxModeGui.value_(0) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 0, \mulrate, 0,); }
{~fxMode == 1 }{{~fxModeGui.value_(1) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 477, \mulrate, 100.1); }
{~fxMode == 2 }{{~fxModeGui.value_(2) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 277, \mulrate, 100.1);}
{~fxMode == 3 }{{~fxModeGui.value_(3) }.defer; ~gtrIn.set(\out, ~reverbBus); ~reverbFX.set(\room, 0.6, \mix, 0.5, \damp, 0); }
{~fxMode == 4 }{{~fxModeGui.value_(4) }.defer; ~gtrIn.set(\out, ~reverbBus); ~reverbFX.set(\room, 0.8, \mix, 0.5, \damp, 0); }
{~fxMode == 5 }{{~fxModeGui.value_(5) }.defer; ~gtrIn.set(\out, ~reverbBus); ~reverbFX.set(\room, 0.95, \mix, 1, \damp, 0);}
{~fxMode == 6 }{{~fxModeGui.value_(6) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 1, \mulrate, 3); }
{~fxMode == 7 }{{~fxModeGui.value_(7) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 2, \mulrate, 5); }
{~fxMode == 8 }{{~fxModeGui.value_(8) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 3, \mulrate, 7); }
{~fxMode == 9 }{{~fxModeGui.value_(9) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 5, \mulrate, 13); }
{~fxMode == 10 }{{~fxModeGui.value_(10) }.defer; ~gtrIn.set(\out, ~ringModBus); ~ringMod.set(\modulator, 8, \mulrate, 21); }
{~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); };
////////////////////////////////////////////////////////////////////
// BUTTON X ----> toggle fx
if (msg[13]==1,
{
( ~btn4val = (~btn4val + 1) % 8 ) ;
( ~btn4val = (~btn4val + 1) % 13 ) ;
switch( ~btn4val,
0, { ~fxMode=0; "fx0".postln; },
1, { ~fxMode=1; "fx1".postln; },
@ -751,6 +529,11 @@ OSCFunc.trace(false); // Turn posting off
5, { ~fxMode=5; "fx5".postln; },
6, { ~fxMode=6; "fx6".postln; },
7, { ~fxMode=7; "fx7".postln; },
8, { ~fxMode=8; "fx8".postln; },
9, { ~fxMode=9; "fx9".postln; },
10, { ~fxMode=10; "fx10".postln; },
11, { ~fxMode=11; "fx11".postln; },
12, { ~fxMode=12; "fx12".postln; },
);
});
@ -819,7 +602,6 @@ OSCFunc.trace(false); // Turn posting off
{
( ~btn10val = (~btn10val + 1) % 9 ) ;
switch(~btn10val,
0, { ~gtrIn.set(\instrAmp, 0 ); "DRY SIGNAL OFF".postln; },
@ -831,11 +613,9 @@ OSCFunc.trace(false); // Turn posting off
6, { ~instrPanMode=5; "DRY RaND {QUAD}".postln; },
7, { ~instrPanMode=6; "DRY SENSOR {QUAD}".postln; },
8, { ~instrPanMode=7; "DRY SENSOR {QUAD}".postln; },
)
});
// BUTTON X && X RESET/ZERO SENSORS [in firmware just here for notificaton]
if (msg[12] == 1, { " ===== EULER ZEROED! =====".postln }, {});
@ -902,12 +682,10 @@ OSCFunc.trace(false); // Turn posting off
}); // SHIFT ONE LOGIC ENDS HERE ================
} , '/keys');
} , '/keys');
// } , '/localhostInLevels');
));
);
~gdurMode = 2;
@ -917,8 +695,10 @@ OSCFunc.trace(false); // Turn posting off
// 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(\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
@ -930,39 +710,53 @@ r.set(\overdub, 0.9); // overdub mode 0 - 0.99 - MAPPED TO SWITCH 4
\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, 1 )});
~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(\rel, 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,1)});
~g.do({arg n; n.set(\dens,10)});
~g.do({arg n; n.set(\panRand, 1 )});
\ptrSampleDelay, n.linlin(0,4, 20000, s.sampleRate*2),
\ptrSampleDelay, n.linlin(0,4, 20000, s.sampleRate*5),
~g.do({arg n; n.set(\ptrSampleDelay, s.sampleRate * 1) });
~g.do({arg n; n.set(\ptrRandSamples, 20000 )});
~g.do({arg n; n.set(\minPtrDelay, 2000000 )});
~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([\baseDur, 10])});
~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.008, \durRand, 10.1)});
~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

View File

@ -0,0 +1,76 @@
<!DOCTYPE patchbay>
<patchbay version="0.9.1" name="live_jackpatchbay">
<output-sockets>
<socket client="system" name="system 1" type="jack-audio" exclusive="on">
<plug>capture_1</plug>
<plug>capture_2</plug>
<plug>capture_3</plug>
<plug>capture_4</plug>
</socket>
<socket client="ardour" name="ardour 1" type="jack-audio" exclusive="off">
<plug>Master\/audio_out\ 1</plug>
<plug>Master\/audio_out\ 2</plug>
</socket>
<socket client="ardour" name="ardour sc4ch" type="jack-audio" exclusive="off">
<plug>SC\ 4CHAN\/audio_out\ 1</plug>
<plug>SC\ 4CHAN\/audio_out\ 2</plug>
<plug>SC\ 4CHAN\/audio_out\ 3</plug>
<plug>SC\ 4CHAN\/audio_out\ 4</plug>
</socket>
<socket client="gx_head_amp" name="gx_head_amp 1" type="jack-audio" exclusive="off">
<plug>out_0</plug>
</socket>
<socket client="gx_head_fx" name="gx_head_fx" type="jack-audio" exclusive="off">
<plug>out_0</plug>
<plug>out_1</plug>
</socket>
<socket client="SuperCollider" name="SC2CH" type="jack-audio" exclusive="off">
<plug>out_1</plug>
<plug>out_2</plug>
</socket>
<socket client="SuperCollider" name="SC 3-4" type="jack-audio" exclusive="off">
<plug>out_3</plug>
<plug>out_4</plug>
</socket>
<socket client="SuperCollider" name="SuperCollider 4ch" type="jack-audio" exclusive="off">
<plug>out_1</plug>
<plug>out_2</plug>
<plug>out_3</plug>
<plug>out_4</plug>
</socket>
</output-sockets>
<input-sockets>
<socket client="gx_head_amp" name="gx_head_amp" type="jack-audio" exclusive="off">
<plug>in_0</plug>
</socket>
<socket client="gx_head_fx" name="gx_head_fx 1" type="jack-audio" exclusive="off">
<plug>in_0</plug>
</socket>
<socket client="SuperCollider" name="SC 4CH" type="jack-audio" exclusive="off">
<plug>in_1</plug>
<plug>in_2</plug>
<plug>in_3</plug>
<plug>in_4</plug>
</socket>
<socket client="ardour" name="sc2chan" type="jack-audio" exclusive="off">
<plug>SUPERCOLLIDER\/audio_in\ 1</plug>
<plug>SUPERCOLLIDER\/audio_in\ 2</plug>
</socket>
<socket client="system" name="system 1" type="jack-audio" exclusive="off">
<plug>playback_1</plug>
<plug>playback_2</plug>
<plug>playback_3</plug>
<plug>playback_4</plug>
</socket>
</input-sockets>
<slots/>
<cables>
<cable input="gx_head_amp" type="jack-audio" output="system 1"/>
<cable input="SC 4CH" type="jack-audio" output="gx_head_fx"/>
<cable input="system 1" type="jack-audio" output="SC 3-4"/>
<cable input="system 1" type="jack-audio" output="SuperCollider 4ch"/>
<cable input="system 1" type="jack-audio" output="ardour 1"/>
<cable input="gx_head_fx 1" type="jack-audio" output="gx_head_amp 1"/>
</cables>
</patchbay>

View File

@ -0,0 +1,112 @@
<!DOCTYPE patchbay>
<patchbay version="0.9.1" name="recording_jackpatchbay">
<output-sockets>
<socket client="system" type="jack-audio" name="system 1" exclusive="on">
<plug>capture_1</plug>
<plug>capture_2</plug>
<plug>capture_3</plug>
<plug>capture_4</plug>
</socket>
<socket client="ardour" type="jack-audio" name="ardour sc4ch" exclusive="off">
<plug>SC\ 4CHAN\/audio_out\ 1</plug>
<plug>SC\ 4CHAN\/audio_out\ 2</plug>
<plug>SC\ 4CHAN\/audio_out\ 3</plug>
<plug>SC\ 4CHAN\/audio_out\ 4</plug>
</socket>
<socket client="gx_head_amp" type="jack-audio" name="gx_head_amp 1" exclusive="off">
<plug>out_0</plug>
</socket>
<socket client="gx_head_fx" type="jack-audio" name="gx_head_fx" exclusive="off">
<plug>out_0</plug>
<plug>out_1</plug>
</socket>
<socket client="SuperCollider" type="jack-audio" name="SC2CH" exclusive="off">
<plug>out_1</plug>
<plug>out_2</plug>
</socket>
<socket client="SuperCollider" type="jack-audio" name="SC 3-4" exclusive="off">
<plug>out_3</plug>
<plug>out_4</plug>
</socket>
<socket client="SuperCollider" type="jack-audio" name="SuperCollider 4ch" exclusive="off">
<plug>out_1</plug>
<plug>out_2</plug>
<plug>out_3</plug>
<plug>out_4</plug>
</socket>
<socket client="ardour" type="jack-audio" name="ardour master out" exclusive="off">
<plug>Master\/audio_out\ 1</plug>
<plug>Master\/audio_out\ 2</plug>
</socket>
<socket client="ardour" type="jack-audio" name="ardour sc stereo" exclusive="off">
<plug>SUPERCOLLIDER\/audio_out\ 1</plug>
<plug>SUPERCOLLIDER\/audio_out\ 2</plug>
<plug>SC\ GTR\/audio_out\ 1</plug>
<plug>SC\ GTR\/audio_out\ 2</plug>
</socket>
<socket client="ardour" type="jack-audio" name="ardour sc gtr" exclusive="off">
<plug>SC\ GTR\/audio_out\ 1</plug>
<plug>SC\ GTR\/audio_out\ 2</plug>
</socket>
</output-sockets>
<input-sockets>
<socket client="gx_head_amp" type="jack-audio" name="gx_head_amp" exclusive="off">
<plug>in_0</plug>
</socket>
<socket client="gx_head_fx" type="jack-audio" name="gx_head_fx 1" exclusive="off">
<plug>in_0</plug>
</socket>
<socket client="SuperCollider" type="jack-audio" name="SC 4CH" exclusive="off">
<plug>in_1</plug>
<plug>in_2</plug>
<plug>in_3</plug>
<plug>in_4</plug>
</socket>
<socket client="ardour" type="jack-audio" name="ardour gtrx input" exclusive="off">
<plug>\ GuitarX\/audio_in\ 1</plug>
<plug>\ GuitarX\/audio_in\ 2</plug>
</socket>
<socket client="ardour" type="jack-audio" name="ardour SC2CH IN" exclusive="off">
<plug>SUPERCOLLIDER\/audio_in\ 1</plug>
<plug>SUPERCOLLIDER\/audio_in\ 2</plug>
</socket>
<socket client="ardour" type="jack-audio" name="ardour SC GTR" exclusive="off">
<plug>SC\ GTR\/audio_in\ 1</plug>
<plug>SC\ GTR\/audio_in\ 2</plug>
</socket>
<socket client="ardour" type="jack-audio" name="sc2chan" exclusive="off">
<plug>SUPERCOLLIDER\/audio_in\ 1</plug>
<plug>SUPERCOLLIDER\/audio_in\ 2</plug>
</socket>
<socket client="ardour" type="jack-audio" name="ardour sc4ch" exclusive="off">
<plug>SC\ 4CHAN\/audio_in\ 1</plug>
<plug>SC\ 4CHAN\/audio_in\ 2</plug>
<plug>SC\ 4CHAN\/audio_in\ 3</plug>
<plug>SC\ 4CHAN\/audio_in\ 4</plug>
</socket>
<socket client="ardour" type="jack-audio" name="ardour master in" exclusive="off">
<plug>Master\/audio_in\ 1</plug>
<plug>Master\/audio_in\ 2</plug>
</socket>
<socket client="system" type="jack-audio" name="system 1" exclusive="off">
<plug>playback_1</plug>
<plug>playback_2</plug>
<plug>playback_3</plug>
<plug>playback_4</plug>
</socket>
</input-sockets>
<slots/>
<cables>
<cable type="jack-audio" output="system 1" input="gx_head_amp"/>
<cable type="jack-audio" output="ardour master out" input="system 1"/>
<cable type="jack-audio" output="gx_head_amp 1" input="gx_head_fx 1"/>
<cable type="jack-audio" output="gx_head_fx" input="SC 4CH"/>
<cable type="jack-audio" output="gx_head_fx" input="ardour gtrx input"/>
<cable type="jack-audio" output="SC2CH" input="ardour SC2CH IN"/>
<cable type="jack-audio" output="SC 3-4" input="ardour SC GTR"/>
<cable type="jack-audio" output="SuperCollider 4ch" input="ardour sc4ch"/>
<cable type="jack-audio" output="ardour sc stereo" input="ardour master in"/>
<cable type="jack-audio" output="ardour sc gtr" input="ardour master in"/>
</cables>
</patchbay>

View File

@ -1,5 +1,7 @@
# /usr/bin/jackd -u -dalsa -dhw:USB -r44100 -p512 -n3 -S
killall -9 jackd
/usr/bin/jackd -u -dalsa -r44100 -p256 -n3 -D -Chw:U192k -Phw:U192k
/usr/bin/jackd -aa -u -dalsa -r44100 -p512 -n3 -D -Chw:U192k -Phw:U192k