-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakeRandomEnvTest_LoopExactDuration.scd
More file actions
99 lines (80 loc) · 2.08 KB
/
Copy pathmakeRandomEnvTest_LoopExactDuration.scd
File metadata and controls
99 lines (80 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
(
var makeRandomEnvDir;
var duration;
var maxSegments;
var env;
makeRandomEnvDir =
PathName(thisProcess.nowExecutingPath).pathOnly;
(makeRandomEnvDir +/+ "makeRandomEnv.scd").load;
duration = 60.0;
maxSegments = 11;
env = ~makeRandomEnv.(
duration: duration,
minLevel: 0.1,
maxLevel: 0.95,
minSegments: 5,
maxSegments: maxSegments,
minSegmentDuration: 2.0,
startLevel: 0.1,
endLevel: 0.1,
maxLevelChange: 0.1,
curve: \sin
);
s.waitForBoot({
SynthDef(\makeRandomEnvTestLoopExactDuration, {
|outBus = 0, amp = 0.2|
var envControl;
var loopTrigger;
var amplitude;
var signal;
envControl = NamedControl.kr(
\env,
Env.newClear(maxSegments).asArray
);
loopTrigger = Impulse.kr(duration.reciprocal);
SendReply.kr(
loopTrigger,
"/makeRandomEnvTestLoop"
);
amplitude = EnvGen.kr(envControl, loopTrigger);
signal = PinkNoise.ar(amp) * amplitude;
Out.ar(outBus, signal ! 2);
}).add;
s.sync;
~makeRandomEnvTestEnv = env;
~makeRandomEnvTestLoopCount = 0;
OSCdef(\makeRandomEnvTestLoopCount).tryPerform(\free);
OSCdef(
\makeRandomEnvTestLoopCount,
{
~makeRandomEnvTestLoopCount =
~makeRandomEnvTestLoopCount + 1;
(
"makeRandomEnv 60-second pass "
++ ~makeRandomEnvTestLoopCount
++ " started."
).postln;
},
"/makeRandomEnvTestLoop"
);
~makeRandomEnvTestSynth.tryPerform(\free);
~makeRandomEnvTestSynth = Synth(
\makeRandomEnvTestLoopExactDuration,
[
\outBus, 0,
\amp, 0.2,
\env, env
]
);
"makeRandomEnv 60-second closed-envelope test is looping.".postln;
(
duration: env.duration,
numSegments: env.times.size,
startLevel: env.levels.first,
endLevel: env.levels.last,
levels: env.levels,
times: env.times,
curve: env.curves
).postln;
});
)