Insect ambience

An ambience of synthesised insect sounds

9 Likes

Found the code used in this piece.

(
SynthDef(“bugs”,{arg out = 0, amp = 1.2, lag = 20, cut_freq = 600, nse = 0.1, n_freq =800;
var src;
src = {(LPF.ar(PinkNoise.ar(nse),n_freq) * SinOsc.ar(1750) * SinOsc.ar(160) )}.dup;
src = PitchShift.ar(src, 0.2, LFTri.ar(20).range(0.9, 5), 0.01, 0.0001);
src = Limiter.ar(src,0.9)* amp.lag(lag);
src = HPF.ar(src, cut_freq) ;
Out.ar(out, src * EnvGate.new)
}).add;
)
g = Synth(“bugs”).autogui

~click = {Resonz.ar(HPF.ar(WhiteNoise.ar(0.5), LFSaw.kr(5.0, 0, 100, 22010), 0.03), LFSaw.kr(1.0, 1, 1000, 30000), 0.01 ! 2) }.play
~click.free

~frog = {Blip.ar([10.001,10],mul:LFPulse.kr([0.1,0.1]).range(0,1)) * 0.02}.play

~frog.free

~backgrdhiss = {{HPF.ar(Crackle.ar(1.96),900) * Vibrato.kr(50.0,1,0.02) * 0.0001}.dup }.play

~backgrdhiss.free

(
SynthDef(“thestart”, { arg out=0, amp = 0, gate = 1, tm =0, fre = 1000, pos = 1, plag = 30;
var src;

src  = Mix.fill(3,{ HPF.ar(BPF.ar(PinkNoise.ar(amp.lag(tm)), [450,250,150], 0.2),LFNoise2.ar([0.1,0.11,0.14]).range(100,800)) }!2);

src = XFade2.ar(src,LPF.ar(src,fre),pos.lag(plag));
Out.ar(out, src * EnvGen.kr(Env.asr, gate, doneAction: 2))

}).add;
)
g = Synth(“thestart”).autogui
(
SynthDef(“StaticLoss”, { arg out=0, amp = 1, freq = 1200,rq = 1,db = -45, gate = 1, pan = -1;
var src;
src = WaveLoss.ar(PinkNoise.ar(0.1),39) ;
src = BPeakEQ.ar(src,freq,rq,db,amp);
src = Pan2.ar(src,pan);
src = src * EnvGen.kr(Env.asr, gate, doneAction: 2);
Out.ar(out, src )
}).add;
)
~pn = Synth(“StaticLoss”).autogui(specs:(\pan: [-1,1, \lin,0.1,0]));

(
SynthDef(“Storm”, { arg out=0, amp = 0, gate = 1, lag = 1002, cut = 165, hicut = 440, clag = 20 ;
var src;
src = Mix.fill(6,{RLPF.ar( Crackle.ar(1.9 + 0.05.rand),cut.lag(clag))});
src = LeakDC.ar(Decay2.ar(src,0.01,0.1),0.995,amp.lag(lag))!2;
src = HPF.ar(src,hicut);
src = Limiter.ar(src,0.9,0.1);
Out.ar(out, src * EnvGen.kr(Env.asr, gate, doneAction: 2) )
}).add;
)
~ku = Synth(“Storm”).autogui

(
SynthDef(“Rumble”, { arg out=0, amp = 0, gate = 1, lag = 1200 , freq = 240, frq = 490;
var src;
src = LeakDC.ar(Decay2.ar( ClipNoise.ar(0.2), 0.01, 0.1),0.995,amp.varlag(lag)) ! 2 ;
src = RLPF.ar(src,freq);
src = LeakDC.ar(LPF.ar(src,frq));
Out.ar(out, src * EnvGen.kr(Env.asr, gate, doneAction: 2) )
}).add;
)

~ru = Synth(“Rumble”).autogui

/////////not used but adds something more- cricket(?) from “https://en.wikibooks.org/wiki/Designing_Sound_in_SuperCollider/Insects” ///////

(
a = {
var modulator, mod1, mod2, mod3;

// repeat time is 0.7s: equates to 1.43 Hz.
modulator = LFSaw.ar(1.43, 1, 0.5, 0.5);
mod2 = (modulator * 40.6 * 2pi).cos.squared;
mod3 = modulator * 3147;
mod3 = (mod3 * 2pi).cos + ((mod3 * 2 * 2pi).cos * 0.3);
mod1 = ((Wrap.ar(modulator.min(0.1714) * 5.84) - 0.5).squared * (-4) + 1) * (mod2 * mod3);
mod1 = (mod1 * 0.01)!2;

}.play;
)

1 Like

Thank you so much for sharing! That’s beautiful, and very helpful.
The syntax “name of the synt” dosen’t work for me (I’m on SuperCollider 3.11.2), I had to rephrase it as \name.
Is there an alternative for the “autogui” object without installing an extension?

The code block was formatted as regular text, which breaks quotation marks.

Code should always be put within code formatting tags:

```
code here
```

If it isn’t formatted this way, it will make other users confused when they try to run it.

hjh

Thanks for the positive comment.
Apologies for the messy post I was not familiar with the formatting at the time. Also I’m not the tidiest coder.
I don’t know of any built in alternatives to .autogui , it’s not critical, I just used it to play with parameters.
I would probably do something like this now.

(
SynthDef(\Storm, { arg out=0, amp = 0, gate = 1, lag = 1002, cut = 165, hicut = 440, clag = 20;
var src;
src = Mix.fill(6,{RLPF.ar( Crackle.ar(1.9 + 0.05.rand),cut.lag(clag))});
src = LeakDC.ar(Decay2.ar(src,0.01,0.1),0.995,amp.lag(lag))!2;
src = HPF.ar(src,hicut);
src = Limiter.ar(src,0.9,0.1);
Out.ar(out, src * EnvGen.kr(Env.asr, gate, doneAction: 2) )
}).add;
)
~ku = Synth(\Storm)

~ku.set(\amp, 0.2)

Cheers
Daniel

1 Like

Thank you for your quick reply! :hugs:

1 Like

nice stuff, five years later!

1 Like