Compare commits

...

2 Commits

Author SHA1 Message Date
Rob Canning 94168debe9 bowing wav added 2023-10-16 17:33:27 +02:00
Rob Canning b3ab447a36 post mfru mods 2023-10-16 17:32:44 +02:00
2 changed files with 33 additions and 23 deletions

View File

@ -1,7 +1,9 @@
/*RUN*/
s.options.numInputBusChannels = 4;
s.options.numOutputBusChannels = 4;
s.options.numInputBusChannels = 8;
s.options.numOutputBusChannels = 8;
~channels = 2;
b = NetAddr.new("192.168.0.100", 8888); // create the NetAddr
//b.sendMsg("/led", [0,1].choose); // send the application the message "hello" with the parameter "there"
@ -47,9 +49,9 @@ s.waitForBoot{
env= EnvGen.kr(Env.asr(atk,1,rel),gate, doneAction:2);
sig = PlayBuf.ar(1, bufnum, rate*tpse*dir, t_trig, startPos: spos, loop:loop, doneAction: 0);
sig = sig * env * amp;
sig = Pan2.ar(sig, FSinOsc.kr(panRate));
//sig = Pan2.ar(sig, FSinOsc.kr(panRate));
//sig = PanAz.ar(4, sig, FSinOsc.kr(panRate));
//sig = Pan4.ar(sig, FSinOsc.kr(panRate));
/// //sig = Pan4.ar(sig, FSinOsc.kr(panRate));
Out.ar(out, sig);
@ -59,14 +61,14 @@ s.waitForBoot{
~oPA = 8.collect({
arg itt, rate=1, out=0, sdir=\bowl,
amp=0.8, loop=0, panRate=rrand(0.05,0.75), group=~sGA;
Synth.new(\splay, [ \bufnum, ~smp[sdir][rrand(0,~smp[sdir].size-1)], \out, out, \loop, loop, panRate: panRate], group);
amp=0.8, loop=0, panRate=rrand(0.05,0.15), group=~sGA;
Synth.new(\splay, [ \bufnum, ~smp[sdir][rrand(0,~smp[sdir].size-1)], \out, rrand(0,(~channels-1)), \loop, loop, panRate: panRate], group);
});
~oPB = 8.collect({
arg itt, rate=1, out=0, sdir=\bowl,
amp=0.8, loop=0, panRate=rrand(0.05,0.75), group=~sGB;
Synth.new(\splay, [\bufnum, ~smp[sdir][rrand(0,~smp[sdir].size-1)], \out, out, \loop, loop, panRate: panRate], group);
amp=0.8, loop=0, panRate=rrand(0.05,0.15), group=~sGB;
Synth.new(\splay, [\bufnum, ~smp[sdir][rrand(0,~smp[sdir].size-1)], \out, rrand(0,(~channels-1)), \loop, loop, panRate: panRate], group);
});
// RECEIVE OSC MESSAGES FROM ESP32s
@ -121,7 +123,6 @@ s.waitForBoot{
~loopStateA = [0,0,0,0,0,0,0,0];
~loopStateB = [0,0,0,0,0,0,0,0];
//~dirState.put(3,1);
//~scales[2].tuning; ~scales[2].size; ~scales[2].pitchesPerOcatave;
@ -145,16 +146,30 @@ s.waitForBoot{
postln("PITCHCLASS: " + ~psetA[msg[2]] );
b.sendMsg("/led", msg[2], ~psetA[msg[2]], msg[4]);
~loopStateA.put(msg[2],0);
w = case
{ msg[2] == 0} { ~oPA[0].set(\rate, ~scaleA[~psetA[0]].midiratio, \t_trig, 1, \gate, 1, \tpse, 1, \dir, 1, \loop, 0, \spos, 0); }
{ msg[2] == 1} { ~oPA[1].set(\rate, ~scaleA[~psetA[1]].midiratio, \t_trig, 1, \gate, 1, \tpse, 1, \dir, 1, \loop, 0, \spos, 0); }
{ msg[2] == 2} { ~oPA[2].set(\rate, ~scaleA[~psetA[2]].midiratio, \t_trig, 1, \gate, 1, \tpse, 1, \dir, 1, \loop, 0, \spos, 0); }
{ msg[2] == 3} { ~oPA[3].set(\rate, ~scaleA[~psetA[3]].midiratio, \t_trig, 1, \gate, 1, \tpse, 1, \dir, 1, \loop, 0, \spos, 0); }
{ msg[2] == 4} { ~oPA[4].set(\rate, ~scaleA[~psetA[4]].midiratio, \t_trig, 1, \gate, 1, \tpse, 1, \dir, 1, \loop, 0, \spos, 0); }
{ msg[2] == 5} { ~oPA[5].set(\rate, ~scaleA[~psetA[5]].midiratio, \t_trig, 1, \gate, 1, \tpse, 1, \dir, 1, \loop, 0, \spos, 0); }
{ msg[2] == 6} { ~oPA[6].set(\rate, ~scaleA[~psetA[6]].midiratio, \t_trig, 1, \gate, 1, \tpse, 1, \dir, 1, \loop, 0, \spos, 0); }
{ msg[2] == 0} { ~oPA[0].set(\rate, ~scaleA[~psetA[0]].midiratio,
\t_trig, 1, \gate, 1, \tpse, 1, \dir, 1, \loop, 0, \spos, 0, \out, rrand(0,~channels-1)); }
{ msg[2] == 1} { ~oPA[1].set(\rate, ~scaleA[~psetA[1]].midiratio,
\t_trig, 1, \gate, 1, \tpse, 1, \dir, 1, \loop, 0, \spos, 0, \out, rrand(0,~channels-1)); }
{ msg[2] == 2} { ~oPA[2].set(\rate, ~scaleA[~psetA[2]].midiratio,
\t_trig, 1, \gate, 1, \tpse, 1, \dir, 1, \loop, 0, \spos, 0, \out, rrand(0,~channels-1)); }
{ msg[2] == 3} { ~oPA[3].set(\rate, ~scaleA[~psetA[3]].midiratio,
\t_trig, 1, \gate, 1, \tpse, 1, \dir, 1, \loop, 0, \spos, 0, \out, rrand(0,~channels-1)); }
{ msg[2] == 4} { ~oPA[4].set(\rate, ~scaleA[~psetA[4]].midiratio,
\t_trig, 1, \gate, 1, \tpse, 1, \dir, 1, \loop, 0, \spos, 0, \out, rrand(0,~channels-1)); }
{ msg[2] == 5} { ~oPA[5].set(\rate, ~scaleA[~psetA[5]].midiratio,
\t_trig, 1, \gate, 1, \tpse, 1, \dir, 1, \loop, 0, \spos, 0, \out, rrand(0,~channels-1)); }
{ msg[2] == 6} { ~oPA[6].set(\rate, ~scaleA[~psetA[6]].midiratio,
\t_trig, 1, \gate, 1, \tpse, 1, \dir, 1, \loop, 0, \spos, 0, \out, rrand(0,~channels-1)); }
// TODO: LOGIC TO FIX NEXT OCTAVE IN 7 NOTE VS OTHER NOTE LENGTH SCALES ~psetA.size
// if logic below not workingif (~scaleA.size == 7 ) {t
@ -163,10 +178,10 @@ s.waitForBoot{
{ msg[2] == 7} { if (~scaleA.size == 7 ) {
~oPA[7].set(\rate, ~scaleA[~psetA[0]].midiratio + 1 ,\t_trig, 1, \gate, 1, \tpse, 1, \loop, 0, \spos, 0);
postln("notes in scale: " + ~scaleA );};
postln("notes in scale: " + ~scaleA )};
if (~scaleA.size == 12 ) { ~oPA[7].set(\rate, ~scaleA[~psetA[0]].midiratio,\t_trig, 1, \gate, 1, \tpse, 2, \loop, 0, \spos, 0);
postln("notes in scale: " + ~scaleA + "not>>> debug");}
postln("notes in scale: " + ~scaleA + "not>>> debug")}
}
} {
~dirStateA.put(msg[2],0);
@ -234,8 +249,6 @@ s.waitForBoot{
} // set the state for neopixel // when released
};
// SCALE CHANGER ---------------------------------
if (~shiftA==1 && msg[2] == 9 && msg[3] == 1) {
@ -248,7 +261,6 @@ s.waitForBoot{
// todo color code for SCALE CHANGER... red not updating
//b.sendMsg("/led", 9, ~ssA, msg[4]);
// PITCH SET SCRAMBLER ---------------------------------
if (~shiftA==0 && ~ctrlA==0 && msg[2] == 9 && msg[3] == 1) {
@ -269,10 +281,8 @@ s.waitForBoot{
~smpA = (~smpA + 1) % 4;
// use key release to
~sdir = ~sampleDir[~smpA];
postln("NEW SAMPLE DIRECTORY SELECTED:"+ ~sampleDir[~smpA] + " : " + ~sampleDir);
b.sendMsg("/led", 8, ~smpA, msg[4]);
};
// SAMPLE DIRECTORY MAPPINGS ---------------------------------

Binary file not shown.