Compare commits
No commits in common. "d0be4a3b6755db5198efc1ab69a0f427d2177e07" and "e1c1a5b82dd6d435f8b1d88e0150d2cf7f8b021f" have entirely different histories.
d0be4a3b67
...
e1c1a5b82d
|
@ -24,22 +24,9 @@ OSCdef.freeAll;
|
|||
|
||||
~quantspeed = { |v| 2.pow((v * 4 + 0.5).round - 5) };
|
||||
|
||||
|
||||
~quantharmonics = {
|
||||
arg f, quantise=0;
|
||||
if(quantise != 0, {
|
||||
var fraction = f.asFraction(7, false);
|
||||
fraction[0] / fraction[1];
|
||||
},
|
||||
{ f }
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// control ganging is hella laggy, do it in TouchOSC
|
||||
|
||||
|
||||
|
||||
~setspeed = { | track, v |
|
||||
var speed, qv = if(~speedquant > 0, { ~quantspeed.value(v) }, { v });
|
||||
speed = qv / ~buflen;
|
||||
|
@ -107,15 +94,6 @@ OSCdef.freeAll;
|
|||
|
||||
~to.button('/grains/quant', 0, { |v| ~speedquant = v });
|
||||
|
||||
~to.button('/grains/metronome', 0, { |v|
|
||||
if( v == 1, {
|
||||
~bps = ~beatsperbar / ~buflen;
|
||||
~tc.tempo_(~bps);
|
||||
});
|
||||
|
||||
~metromix.set(\amp, v)
|
||||
});
|
||||
|
||||
|
||||
// Page 2: track
|
||||
|
||||
|
@ -132,9 +110,6 @@ OSCdef.freeAll;
|
|||
~to.button('/track/slope', 0, { |v| ~granulator.slope_(v) });
|
||||
|
||||
~to.button('/track/chorus', 0, { |v| ~granulator.chorus_(v) });
|
||||
~to.slider('/track/harmonics', 2, TouchOSCScale(0.5, 3), { |v|
|
||||
~granulator.harmonics_(~quantharmonics.value(v, 1))
|
||||
});
|
||||
~to.slider('/track/detune', 0, TouchOSCScale(0, 0.059), { |v| ~granulator.detune_(v) });
|
||||
~to.slider('/track/pitch', 0, TouchOSCScale(-2, 2), { |v| ~granulator.pitch_(v.round) });
|
||||
|
||||
|
@ -159,7 +134,6 @@ OSCdef.freeAll;
|
|||
~to.v_('/track/slope', ~granulator.slope);
|
||||
~to.v_('/track/back', ~granulator.back);
|
||||
~to.v_('/track/chorus', ~granulator.chorus);
|
||||
~to.v_('/track/harmonics', ~granulator.harmonics);
|
||||
~to.v_('/track/detune', ~granulator.detune);
|
||||
~to.v_('/track/pitch', ~granulator.pitch);
|
||||
});
|
||||
|
@ -212,6 +186,52 @@ OSCdef.freeAll;
|
|||
~to.slider('/lfos/cfreq', 0.5,TouchOSCScale(0.1, 200), { |v| ~lfoc.set(\freq, v) } );
|
||||
~to.slider('/lfos/camp', 0, TouchOSCScale(0, 1), { |v| ~lfoc.set(\amp, v) });
|
||||
|
||||
// metronome code here is a bit gross but easier
|
||||
|
||||
~beatsperbar = 4;
|
||||
~bps = ~beatsperbar / ~buflen;
|
||||
~tc = TempoClock.new(~bps);
|
||||
|
||||
SynthDef(\metronome, {
|
||||
arg out=0, amp=1, pan=0, filter=1000, atk=0.01, rel=0.1;
|
||||
var sig, env;
|
||||
env = EnvGen.kr(Env.perc(atk, rel, amp), doneAction: Done.freeSelf);
|
||||
sig = HPF.ar(WhiteNoise.ar(), filter);
|
||||
Out.ar(out, Pan2.ar(sig * env, pan));
|
||||
}
|
||||
).add;
|
||||
|
||||
~metrob = Bus.audio(s, 2);
|
||||
|
||||
~metromix = SynthDef(\metromix, {
|
||||
arg in=1, out=0, amp=1;
|
||||
Out.ar(out, amp * In.ar(in, 2));
|
||||
}).play(s, [\in, ~metrob, \out, 0, \amp, 0]);
|
||||
|
||||
|
||||
|
||||
|
||||
~metronome = Pbind(
|
||||
\instrument, \metronome,
|
||||
\dur, 1,
|
||||
\amp, 0.5,
|
||||
\pan, 0,
|
||||
\out, ~metrob
|
||||
).play(~tc);
|
||||
|
||||
|
||||
~to.button('/grains/metronome', 0, { |v|
|
||||
// reset tempo when turning metronome on
|
||||
if( v == 1, {
|
||||
~bps = ~beatsperbar / ~buflen;
|
||||
~tc.tempo_(~bps);
|
||||
});
|
||||
// FIXME
|
||||
~metromix.set(\amp, v)
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
|
21
main.scd
21
main.scd
|
@ -11,23 +11,6 @@ Server.killAll;
|
|||
(
|
||||
Routine.run({
|
||||
|
||||
~usbinput = 2;
|
||||
~usbinput1 = 2;
|
||||
~usbinput2 = 3;
|
||||
|
||||
~bpm = 55;
|
||||
~bps = ~bpm / 60;
|
||||
~beatsperbar = 4;
|
||||
~buflen = ~beatsperbar / ~bps;
|
||||
|
||||
[ "bpm", ~bpm ].postln;
|
||||
[ "buffer length", ~buflen ].postln;
|
||||
|
||||
~tc = TempoClock.new(~bps);
|
||||
|
||||
|
||||
~touchosc_ip = "192.168.0.209";
|
||||
|
||||
("./synths.scd").loadRelative;
|
||||
Granulator.init(s);
|
||||
s.sync;
|
||||
|
@ -37,11 +20,11 @@ Routine.run({
|
|||
s.sync;
|
||||
("./effects.scd").loadRelative;
|
||||
s.sync;
|
||||
("./sequencer.scd").loadRelative;
|
||||
s.sync;
|
||||
~touchosc_ip = "192.168.0.209";
|
||||
("./interface.scd").loadRelative;
|
||||
});
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
|
||||
(
|
||||
|
||||
|
||||
SynthDef(\metronome, {
|
||||
arg out=0, amp=1, pan=0, filter=1000, atk=0.01, rel=0.1;
|
||||
var sig, env;
|
||||
env = EnvGen.kr(Env.perc(atk, rel, amp), doneAction: Done.freeSelf);
|
||||
sig = HPF.ar(WhiteNoise.ar(), filter);
|
||||
Out.ar(out, Pan2.ar(sig * env, pan));
|
||||
}
|
||||
).add;
|
||||
|
||||
~metrob = Bus.audio(s, 2);
|
||||
|
||||
~metromix = SynthDef(\metromix, {
|
||||
arg in=1, out=0, amp=1;
|
||||
Out.ar(out, amp * In.ar(in, 2));
|
||||
}).play(s, [\in, ~metrob, \out, 0, \amp, 0]);
|
||||
|
||||
|
||||
~metronome = Pbind(
|
||||
\instrument, \metronome,
|
||||
\dur, 1,
|
||||
\amp, 0.5,
|
||||
\pan, 0,
|
||||
\out, ~metrob
|
||||
).play(~tc);
|
||||
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,12 @@
|
|||
(
|
||||
|
||||
~usbinput = 2;
|
||||
~usbinput1 = 2;
|
||||
~usbinput2 = 3;
|
||||
|
||||
~buflen = 4.0;
|
||||
~beatsperbar = 4;
|
||||
|
||||
SynthDef(\pos_sine, {
|
||||
arg out, speed=1;
|
||||
Out.kr(out, 0.5 + SinOsc.kr(speed * 0.5, 0, 0.5));
|
||||
|
|
Loading…
Reference in New Issue