Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: replace .send(s) with .add #2208

Merged
merged 2 commits into from
Jun 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/GUI examples/analog-drum-tuner.scd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ s.waitForBoot({

SynthDef(\ringz, { |ffreq = 20, decay = 0.01, in, out, amp = 0|
Out.ar(out, Ringz.ar(In.ar(in, 1), ffreq, decay, amp))
}).send(s);
}).add;

nodes = Array.new(10);
ffreqs = [];
Expand Down Expand Up @@ -235,7 +235,7 @@ s.waitForBoot({
envCtl = Control.names(\env).kr(0 ! 100); // allow 25 env nodes maximum
sig = SynthDef.wrap(func, nil, [trig]) * EnvGen.ar(envCtl, trig);
Out.ar(outbus, sig)
}).send(s);
}).add;
{ src.free;
src = Synth(\source, [\trigbus, trigbus, \outbus, percBus], percGroup,
addAction: \addToTail);
Expand Down
2 changes: 1 addition & 1 deletion examples/demonstrations/SC_website_example.scd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ This example comes from supercollider.sourceforge.net as of 2003. It uses a loop
i_bus,
Pan2.ar( out, rrand(-1.0,1.0))
);
}).send(s); // send synthdef to server
}).add;
});
)

Expand Down
6 changes: 3 additions & 3 deletions examples/other/keepyuppy.scd
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ s.boot; // First make sure the server is on
(
SynthDef(\kuball, { |amp=0.5, pan=0, freq=100|
Out.ar(0, Pan2.ar(amp * 2 * (BPF.ar(WhiteNoise.ar, freq, 0.1)*10).clip2 * SinOsc.ar(4.5), pan))
}).send(s);
}).add;

SynthDef(\gameover, { Out.ar(0, SinOsc.ar(
Line.kr(200, 100, 1.0, doneAction:0),
0,
EnvGen.kr(Env([0.3, 0.2, 0.2, 0], [0.1, 0.8, 0.1]), 1, doneAction:2)
).dup(2))}).send(s);
).dup(2))}).add;

SynthDef(\whackit, {Out.ar(0, SinOsc.ar(74, 0.5pi,
EnvGen.kr(Env.perc(0, 0.05), doneAction:2)).dup(2))}).send(s);
EnvGen.kr(Env.perc(0, 0.05), doneAction:2)).dup(2))}).add;

);

Expand Down
2 changes: 1 addition & 1 deletion examples/pieces/RM-octaver.scd
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ s = Server.local.waitForBoot({
in = SoundIn.ar(0) ;
# freq, hasFreq = Pitch.kr(in) ;
Out.ar(out, SinOsc.ar(freq: freq*0.5)*in+in);
}).send(s) ;
}).add ;
})
)

Expand Down
12 changes: 6 additions & 6 deletions examples/pieces/acid_otophilia.scd
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Routine.run {var c; c = Condition.new; s.freeAll; TempoClock.all.do{|x|x.clear};
out = out.clip2(1);

Out.ar(outBus, out.dup);
}).send(s);
}).add;

SynthDef("snare", {
arg outBus=0, amp=0.8;
Expand All @@ -57,7 +57,7 @@ Routine.run {var c; c = Condition.new; s.freeAll; TempoClock.all.do{|x|x.clear};
out = out.clip2(1) * amp;

Out.ar(outBus, out.dup);
}).send(s);
}).add;

SynthDef("clap", {
arg outBus=0, amp = 0.5;
Expand All @@ -79,7 +79,7 @@ Routine.run {var c; c = Condition.new; s.freeAll; TempoClock.all.do{|x|x.clear};
out = out.softclip * amp;

Out.ar(outBus, out.dup);
}).send(s);
}).add;

SynthDef("hat", {
arg outBus=0, amp=0.3;
Expand Down Expand Up @@ -116,7 +116,7 @@ Routine.run {var c; c = Condition.new; s.freeAll; TempoClock.all.do{|x|x.clear};
out = out * amp;

Out.ar(outBus, out.dup);
}).send(s);
}).add;

SynthDef("acid", {
arg outBus=0, gate=1, pitch=50, amp=0.1;
Expand All @@ -130,7 +130,7 @@ Routine.run {var c; c = Condition.new; s.freeAll; TempoClock.all.do{|x|x.clear};
out = out * env1;

Out.ar(outBus, out.dup);
}).send(s);
}).add;

SynthDef("fx", {
arg outBus=0, gate=0;
Expand All @@ -142,7 +142,7 @@ Routine.run {var c; c = Condition.new; s.freeAll; TempoClock.all.do{|x|x.clear};
out = Limiter.ar(out, 1.0, 0.02);

ReplaceOut.ar(outBus, out);
}).send(s);
}).add;
);

s.sync(c);
Expand Down
6 changes: 3 additions & 3 deletions examples/pieces/aftergoeyvaerts.scd
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ env= EnvGen.kr(Env([0,1,0.4,0.7,0],[Rand(0.001,0.005),0.005,0.005,sustain]), don

Out.ar(0,Pan2.ar(source*env,pan))

}).send(s);
}).add;

//preferred version if you have the FreeVerb UGen, commented out by default
//SynthDef(\goeyfx, {
//ReplaceOut.ar(0,FreeVerb.ar(In.ar(0,2),0.33,1.5))
//}).send(s);
//}).add;

//adapted from JmC reverb
SynthDef(\goeyfx, {
Expand All @@ -40,7 +40,7 @@ a.do({ y = AllpassN.ar(y, 0.051, [rrand(0.01, 0.05),rrand(0.01, 0.05)], 1) });
// add original sound to reverb and play it :
Out.ar(0,(0.2*y));

}).send(s);
}).add;

)

Expand Down
6 changes: 3 additions & 3 deletions examples/pieces/atheoryofharmony.scd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ detune=SinOsc.kr(detrate,0,det,det);

slip= Mix.ar(Pulse.ar([note-detune,note+detune].midicps,Lag.kr(LFNoise0.kr(wrate,wspan,0.5)),0.1))*EnvGen.ar(Env([0,1,0],[atk,0.5]),doneAction:2);
Out.ar(0,Pan2.ar(slip,pan));
}).send(s);
}).add;

SynthDef(\fastatk,{arg note=60,dcy=0.3,pan=0.0;
var osc;
Expand All @@ -24,7 +24,7 @@ osc= LPF.ar(Mix.ar(LFPar.ar(note.midicps,[0,1],0.12, PinkNoise.ar(XLine.kr(0.3,0
*EnvGen.ar(Env([0,1,0],[0.01,dcy]),doneAction:2);

Out.ar(0,Pan2.ar(osc,pan));
}).send(s);
}).add;

SynthDef(\reverb,{
var a,c,z,y,in;
Expand All @@ -43,7 +43,7 @@ a.do({ y = AllpassN.ar(y, 0.051, [rrand(0.01, 0.05),rrand(0.01, 0.05)], 1) });

// add original sound to reverb and play it :
ReplaceOut.ar(0,in+(0.2*y));
}).send(s)
}).add
)


Expand Down
10 changes: 5 additions & 5 deletions examples/pieces/autohausen.scd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ source= Impulse.ar(freq);
filter= BPF.ar(source*env*amp*10,freq,bandwidth/freq);

Out.ar(0,PanAz.ar(numChannels,filter,pan))
}).send(s);
}).add;


SynthDef(\sinarpegg1, {arg freq=440, amp=0.1,attack=0.01, sustain=0.1, decay=0.01,pan=0.0;
Expand All @@ -29,7 +29,7 @@ filter= CombN.ar(source*EnvGen.kr(Env([1,1,0],[attack,0.01])),0.025,0.025,5);
env= EnvGen.kr(Env([0,0,1,1,0],[attack, 0.01,sustain, decay]), doneAction:2);

Out.ar(0,PanAz.ar(numChannels,filter*env*0.5*amp,pan))
}).send(s);
}).add;


SynthDef(\pitchednoise, {arg freq=440, amp=0.1,attack=0.01, sustain=0.1, decay=0.01,pan=0.0, bandwidth=100;
Expand All @@ -42,7 +42,7 @@ source= WhiteNoise.ar;
filter= BPF.ar(source*env*2*amp,freq,bandwidth/freq);

Out.ar(0,PanAz.ar(numChannels,filter,pan))
}).send(s);
}).add;


//preferred version if you have the FreeVerb UGen, commented out by default
Expand All @@ -57,7 +57,7 @@ Out.ar(0,PanAz.ar(numChannels,filter,pan))
//
//ReplaceOut.ar(0,FreeVerb.ar(((shift*shifted)+((1.0-shift)*input)),0.33,1.5))
//
//}).send(s);
//}).add;


SynthDef(\stockyfx, {arg shift=0.0, rate=1.0;
Expand Down Expand Up @@ -85,7 +85,7 @@ a.do({ y = AllpassN.ar(y, 0.051, [rrand(0.01, 0.05),rrand(0.01, 0.05)], 1) });

ReplaceOut.ar(0,(0.33*y) + input);

}).send(s);
}).add;

)

Expand Down