# Generating impulses around a mean frequency

Hi,

I’m looking for a Ugen that would generate impulses following a sort of Gaussian function (with a mean value and a deviation parameter)?
For a zero deviation, it would output an impulse regularly like Impulse Ugen does.
If deviation increases, the impulses would be a little off of the mean frequency, and for large deviations, that would be similar to Dust Ugen.
Does anyone know about such a Ugen or maybe some workaround to achieve similar results?

Thanks

There is a nice trick where you use .midiratio.
0.midiratio = 1.
-1.midiratio = 0.94387431268191;
-2.midiratio = 0.89089871814075
1.midiratio = 1.0594630943591;
2.midiratio = 1.1224620483089
(etc…)

I am only using Trig here for the impulses generated by Impulse.ar to be easier to see on the plot, a trigger lasts 0.1 seconds.
A devamout of 0 produces a steady rate, since the rate is just being multiplied with 0.midiratio = 1, and for values higher than 0 you get an increasingly more ‘noicy’ distribution of triggers around the rate value.

``````(
{

var rate = 10;
var devamount = 2; // change this value to see different results;
var dev = LFNoise0.ar(rate).bipolar(devamount).midiratio;
Trig.ar(Impulse.ar(rate * dev), 0.1)
}.plot(1)
)
``````

GaussTrig will do it: GaussTrig | SuperCollider 3.12.2 Help

Best,
Paul

1 Like

Ah yes, never used it, read about it but forgot. And alos, my code is not a gaussian (I think) as new values are deviations from old the previous value rather than deviations from quantized value.

Hi @TXMod ,
I’ll have to see how it fits into my Synthdef but at first sight GaussTrig seems to be exactly what I was looking for.
Thanks very much