thanks a lot for the example i thought of rewriting it in a more generalized way using DynKlank
instead of the parallel BPFs (wood filter) + Delay Lines (square panel) to then be able to play around with the frequencies and decays. but its sounds really different. any ideas how to convert the example into a modal synthesis approach using DynKlank instead?
(
SynthDef(\slipstick, {
var force, noise, inMotion, slipEvents, forceBuildup, evtAmp, evtDecayTime, evts;
var sig, freqs, rqs, times;
var f0, ratios, decays, amps;
var exc;
//f0 = \freq.kr(125);
//ratios = [62.5, 125, 250, 395, 560, 790]; //f0 * [0.5, 1, 1.58, 2.24, 2.92, 2, 2.55, 3.16];
//amps = [1, 1, 2, 2, 3, 3];
//decays = 1 / 6;
//decays = [4.52, 5.06, 6.27, 8, 5.48, 7.14, 10.12, 16];
force = MouseX.kr(0,1).lag(0.1);
inMotion = force > 0.1;
force = Impulse.ar(force.linlin(0.1, 1, 1, 1 / 0.003));
noise = LFDNoise1.ar(50).squared.linexp(-1, 1, 0.5, 2);
slipEvents = inMotion * force * noise;
forceBuildup = Phasor.ar(slipEvents, 10 * SampleDur.ir, 0, inf).min(1);
evtAmp = Latch.ar(Delay1.ar(forceBuildup.sqrt), slipEvents);
evtDecayTime = evtAmp.sqrt;
sig = EnvGen.ar(Env.perc(0.001, 1), slipEvents, evtAmp, 0, evtDecayTime * 0.01);
//sig = DynKlank.ar(Ref([freqs, amps, decays]), exc, 1, 0, \decayScale.kr(0.001));
//sig = sig + (exc * 0.2);
// wood filter
freqs = [62.5, 125, 250, 395, 560, 790];
rqs = 1 / [1, 1, 2, 2, 3, 3];
sig = BPF.ar(sig, freqs, rqs).sum + (sig * 0.2);
// square panel
times = [4.52, 5.06, 6.27, 8, 5.48, 7.14, 10.12, 16] * 0.001;
sig = DelayC.ar(sig, times, times).mean;
sig = HPF.ar(sig, 125);
sig * 4;
sig = Pan2.ar(sig, \pos.kr(0), \amp.kr(1));
Out.ar(\out.kr(0), sig);
}).play;
)
and is there somebody who knows about the ranges for the methods and outputs of the Friction
Ugen? I was trying to figure out if the Fb1_MSD
examples from the helpfile could be rewritten with the Friction
Ugen.
For example this one:
(
SynthDef(\fb1_msd, {
var f = 1.5, mass = 0.04, spring = 200, dampen = 0.05;
var sig, freq;
sig = Fb1_MSD.kr(f, mass, spring, dampen);
//sig = Friction.kr(f, 0.5, 0.2, 0.3, 0.001);
freq = sig[1].linlin(-1, 1, [100, 90], 700);
sig = SinOsc.ar(freq);
sig = Pan2.ar(sig, \pan.kr(0), \amp.kr(0.25));
Out.ar(\out.kr(0), sig);
}).play
)