//__________mon cheri (north asian version)
(
var scale, in, fReally, fVirtual, delta, gate, out, round;
scale = (Signal[60, 64, 67, 69, 72, 74]-10).midicps;
{
in = AudioIn.ar([1, 2])*2;
fReally = Pitch.kr(LPF.ar(in.at(0), 200)).at(0);
gate = Lag.kr(Amplitude.kr(Mix.ar(in)) > 0.01, 0.1, 0.2);
round = MouseX.kr(10, 80);
fVirtual = Index.kr(scale, fReally.trunc(round)/round);
delta = (fVirtual - fReally) / fReally + 1;
delta = Lag.ar(delta, 0.1);
out = PitchShift.ar(in, 0.03, delta, 0.002, 0.1, gate);
out = CombL.ar(out, 1, fVirtual.reciprocal, 0.3);
}.scope;
)
//mon cheri 2
//uses a different frequency rounding mechanism
(
var scale, in, fReally, fVirtual, delta, gate, out, round;
scale = FloatArray[0, 1, 4, 5, 7, 9];
{
in = AudioIn.ar([1, 2])*2;
// in = [SinOsc.ar(LFNoise2.kr(0.8, 500, 1000), 0, 0.1)];
fReally = Pitch.kr(LPF.ar(in.at(0), 1000)).at(0);
gate = Lag.kr(Amplitude.kr(Mix.ar(in)) > 0.01, 0.1, 0.2);
round = MouseX.kr(10, 80);
fVirtual = RoundToScale.kr(scale, fReally);
delta = (fVirtual - fReally) / fReally + 1;
delta = Lag.ar(delta, 0.1);
out = PitchShift.ar(in, 0.03, delta, 0.002, 0.1, gate);
out = CombL.ar(out, 1, fVirtual.reciprocal, 0.3);
}.scope;
)
/*authors so far: jrh */ |
//this patch needs KeyToDegree classes ! |