Thanks for the answer. I want to do it inside the synth with a UGen. I play speaker setups with lots of discreet channels. To fill the channels I iterate a function for multichannel expansion.
I like the idea of a synth as autonomous sound object that lives it’s own life. I don’t like sequencing from outside.
It’s a GaussTrig that pings a BPF.
(
SynthDef.new(\GaussPing,
{
arg tempo=4, dev=0,pitch=220, q=12, amp=1, out=0;
var sig;
sig = {BPF.ar(GaussTrig.ar(tempo,dev),pitch*exprand(1,8),1/q,sqrt(q)*5)}!16;
sig=Splay.ar(sig);
sig = Limiter.ar(sig*amp,0.7);
Out.ar(0,sig);
}
).add
)
x = Synth(\GaussPing);
x.set(\tempo,4);
x.set(\dev,0);
x.set(\pitch,220);
x.set(\q,44);
x.set(\amp,1);
x.set(\out,0);
x.free;
For the moment I use a work around with LFDNoise0 modulating a TDelay. Not really gauss-distribution but works. Now it can go to chaos and back to sync.
(
(
SynthDef.new(\RandomPing,
{
arg tempo=4, dev=0,pitch=220, q=12, amp=1, lag=0.2, out=0;
var sig, env, trig, del;
trig = Impulse.ar(tempo.lag(lag));
dev = (dev/tempo).lag(lag);
sig = {BPF.ar(TDelay.ar(trig,LFDNoise0.kr(tempo,dev/2,dev).lag(lag)),pitch*exprand(1,8),1/q,sqrt(q)*5)}!16;
sig=Splay.ar(sig);
sig = sig.tanh;
sig = Limiter.ar(sig*amp,0.7);
Out.ar(0,sig);
}
).add
)
x = Synth(\RandomPing);
x.set(\tempo,5);
x.set(\dev,1.0);
x.set(\lag,2);
x.set(\pitch,420);
x.set(\q,44);
x.set(\amp,3);
x.set(\out,0);
x.free;
Could Latch the output from some Gaussian noise UGen as the deviation, multiply it by a randomness factor from 0-1 where 0 is no randomness, then add that value to your central trigger rate value?
Just getting back into the scsynth world, so apologies for such a late reply. You could do something like the following, and it would, to some extent, preserve the autonomous behavior you desire:
(
SynthDef(\gaussTrig, {|tempo=4, dev=0, out=0|
var trig = GaussTrig.ar(tempo!16,dev);
SendReply.ar(trig, '/gausstrig', [dev]);
Out.ar(out, trig);
}).add;
SynthDef(\ping, {
arg trigIn = 30, pitch=220, q=12, amp=1, out=0;
var trig, sig;
trig = In.ar(trigIn, 16);
sig = BPF.ar(trig,pitch*ExpRand(1,8),1/q,sqrt(q)*5);
sig=Splay.ar(sig);
sig = Limiter.ar(sig*amp,0.7);
Out.ar(out,sig);
}).add;
b=Bus.audio(s, 16);
)
(
var lastDev = 0;
x=Group.new;
p = Synth(\ping, [\trigIn, b], x);
g = Synth(\gaussTrig, [\out, b, \dev, lastDev], x);
o=OSCFunc({|msg|
var dev = msg[3];
(lastDev > 0.0).and(dev == 0.0).if({
g = Synth.replace(g, \gaussTrig, [\out, b, \dev, 0]);
});
lastDev = dev;
}, '/gausstrig');
)
x.set(\dev, 0.01);
x.set(\tempo,4);
x.set(\dev,0);
x.set(\pitch,220);
x.set(\q,44);
x.set(\amp,1);
x.set(\out,0);
x.free;