Skip to content

Commit 521c21f

Browse files
committedNov 26, 2018
karma push
1 parent 565db43 commit 521c21f

5 files changed

+53
-5
lines changed
 

‎busses.scd

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
3+
// a trigger signal
4+
(
5+
SynthDef(\trig, {|out = 0|
6+
Out.ar(out, Impulse.ar(0.5));
7+
}).add;
8+
)
9+
10+
// a synth with a gated envelope. gate is received from input bus
11+
(
12+
SynthDef(\tosc, {|out=0, in=0|
13+
var sig, env, gate;
14+
gate = In.ar(in, 1);
15+
env = EnvGen.ar(Env.perc(), gate);
16+
sig = SinOsc.ar(mul:env);
17+
Out.ar(out, Pan2.ar(sig, 0));
18+
}).add;
19+
)
20+
21+
Bus.clear;
22+
b = Bus.audio(s, 1);
23+
b.index
24+
25+
// order of execution is important here, new synths are added on top
26+
c = Synth(\tosc, [\in, b.index]);
27+
d = Synth(\trig, [\out, b.index]);
28+
29+
30+
c.free
31+
d.free

‎midiin.scd

+10-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@
22

33
// see "https://github.com/sensestage/interface2instrument/blob/master/4_MIDI.scd"
44

5+
// s.latency = 0.01;
6+
// s.reboot;
7+
// s.options.hardwareBufferSize = 512;
8+
// s.options.blockSize = 512;
9+
// s.options.blockSize;
10+
511
SynthDef(\perc,
612
{
713
|amp=0.1, pan=0|
814
var sig;
9-
sig = SinOsc.ar(mul: EnvGen.ar(Env.perc(0.001)));
15+
sig = SinOsc.ar(mul: EnvGen.ar(Env.perc(0.001), doneAction:2));
1016
Out.ar(0, Pan2.ar(sig*amp, pan));
1117
}).add;
1218

@@ -21,20 +27,20 @@ MIDIFunc.trace( false );
2127
MIDIdef.noteOn(\noteOnTest, {
2228
|vel, nn |
2329
Synth(\perc, [\amp, vel/127]);
24-
postf("NOTE ON vel:% nn: %\n", vel, nn);
30+
// postf("NOTE ON vel:% nn: %\n", vel, nn);
2531

2632
};
2733
);
2834

2935
MIDIdef.noteOff(\noteOffTest, {
3036
|vel, nn |
31-
[vel, nn].postln;
37+
// [vel, nn].postln;
3238
};
3339
);
3440

3541
MIDIdef.cc(\ccTest, {
3642
|val|
37-
val.postln;
43+
// val.postln;
3844
};);
3945

4046

‎proutBasics.scd

+10
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,14 @@ Pbind(
2929
\freq, p { loop { ([1000, 2000].choose + [100, 200].choose + [10, 20].choose).postln.yield } },
3030
\dur, 0.1
3131
).play;
32+
)
33+
34+
(
35+
var a;
36+
a = Environment.make({
37+
~a = 100;
38+
~b = 200;
39+
~c = 300;
40+
});
41+
a.postln;
3242
)

‎routineBasics.scd

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ a = Routine.new({ 1.yield; 2.yield; });
44
a.next.postln;
55
a.next.postln;
66
a.next.postln;
7+
a.reset;
78

89
//---------------
910

‎synth_percSin.scd

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ SynthDef(\perc,
55
{
66
|amp=0.1, pan=0|
77
var sig;
8-
sig = SinOsc.ar(mul: EnvGen.ar(Env.perc(0.001)));
8+
sig = SinOsc.ar(mul: EnvGen.ar(Env.perc(0.001), doneAction:2));
99
Out.ar(0, Pan2.ar(sig*amp, pan));
1010
}).add;
1111
)

0 commit comments

Comments
 (0)
Please sign in to comment.