Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made a whoosh bubble sound

  • Loading branch information...
commit 33a87a83d013fdcaaafbf7ea40d1554c189b826e 1 parent 3abb0ba
@sparks sparks authored
Showing with 34 additions and 3 deletions.
  1. +34 −3 snippets/gamesounds.scd
View
37 snippets/gamesounds.scd
@@ -25,14 +25,45 @@ SynthDef(\bubblebub, {
Out.ar(out, son);
}).store;
-
+SynthDef(\whooshbubble, {
+ arg
+ out=0, t_trig=0, doneAction=0,
+ b_attack=0.01, b_decay=0.08, b_pitchcurvelen=0.1, b_freq=400, b_amp=0.1,
+ wamp=1, wlp_gain=3.8, wfreq=75;
+ var wampenv, wbtrig, w_pitch, w_sound, b_pitch, b_sound;
+
+
+
+ wampenv = EnvGen.ar(Env.new([0, 1, 0], [0.5, 0.01]), t_trig, doneAction: doneAction);
+ wamp = wamp * wampenv;
+ w_pitch = wfreq * EnvGen.ar(Env.new([1, 10, 0], [0.5, 0.01]), t_trig, doneAction: doneAction);
+
+ w_sound = wamp * WhiteNoise.ar(1);
+ w_sound = MoogFF.ar(w_sound, w_pitch, wlp_gain);
+
+ wbtrig = Done.kr(wampenv);
+
+ b_amp = b_amp * EnvGen.ar(Env.perc(b_attack, b_decay).delay(0.003), wbtrig, doneAction: doneAction);
+ b_pitch = b_freq * EnvGen.ar(Env.new([0,0,1],[0,1]).exprange(1, 2.718), wbtrig, timeScale: b_pitchcurvelen);
+
+ b_sound = SinOsc.ar(b_pitch);
+ // high-pass to remove any lowpitched artifacts, scale amplitude
+ b_sound = HPF.ar(b_sound, 500) * b_amp * 10;
+
+
+ Out.ar(out, w_sound+b_sound);
+}).store;
+
x = Synth(\whoosh);
-x.set(\t_trig, 1); // run this line multiple times, to get multiple (very similar) bubbles!
+x.set(\t_trig, 1);
y = Synth(\bubblebub);
-y.set(\t_trig, 1); // run this line multiple times, to get multiple (very similar) bubbles!
+y.set(\t_trig, 1);
+z = Synth(\whooshbubble);
+z.set(\t_trig, 1);
+z.free;
x.free;
y.trig;
Please sign in to comment.
Something went wrong with that request. Please try again.