-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathStressTests.scd
147 lines (129 loc) · 3.73 KB
/
StressTests.scd
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
Conclusions from the tests below:
1000 events per second, while also changing rates at any moment are safe, *if one does not also load new synthdef functions while playing the task*. The CPU load on an I7 Intel Mac can be under 20%.
If loading new SynthDef functions while playing the task, then using rates above 100 or 200 events per second may result in hanging notes.
Future work: xTo make that safer, the SynthDef loading mechanism has to be combined with the Synth starting and freeing mechanism. This is not high on the priority list at the moment.
*/
//: Jaeh
(
{
{ SinOsc.arps(Rand(1000, 2000)).perc } +> \test0 *> 0.01;
loop {
[
{{ SinOsc.arps(Rand(1000, 2000)).perc } +> \test0;},
{{ SinOsc.arps(Rand(1000, 2000)) } +> \test0;},
{ // 200 events per second
[Pn(0.005, 120) ! 10, Pn(0.1, 4) ! 5, 0.5, 1.5].flat.prand **> \test0;
},
{ // 100, 1000, 5, 1 events per second
[0.01.pn(50), 0.001.pn(100), 0.2.pn(10), 1].prand **> \test0;
},
{ 0.001 **> \test0; } // 1000 events per second
].choose.value;
0.2.rrand(3.0).wait;
}
}.fork
)
//: 500 and 100 events per second, alternating at random. Stable ?
(
{
0.002 *> \test0; // Initialize at 500 events / second;
loop {
[ // occasionaly send synthdefs to create CPU load spikes:
{{ SinOsc.arps(Rand(1000, 2000)).perc } +> \test0 },
{{ SinOsc.arps(Rand(1000, 2000)) } +> \test0;},
{ 0.002 **> \test0; }, // 500 events / second
{ 0.01 **> \test0; } // 100 events / second
].choose.value;
[0.1, 0.01 exprand: 0.1, 2].choose.wait;
}
}.fork
)
//: As above, but remove synthef-sends from the loop
(
{
0.002 *> \test0; // Initialize at 500 events / second;
{ SinOsc.arps(Rand(1000, 2000)).perc } +> \test0;
0.1.wait;
loop {
[
{ 0.002 **> \test0; }, // 500 events / second
{ 0.01 **> \test0; } // 10 events / second
].choose.value;
[0.1, 0.01 exprand: 0.1, 2].choose.wait;
}
}.fork
)
//: As above, but at 1000 and 200 events per second
(
{
0.002 *> \test0; // Initialize at 500 events / second;
{ SinOsc.arps(Rand(1000, 2000)).perc } +> \test0;
0.1.wait;
loop {
[
{ 0.001 **> \test0; }, // 1000 events / second
{ 0.005 **> \test0; } // 200 events / second
].choose.value;
[0.1, 0.01 exprand: 0.5, 1].choose.wait;
}
}.fork
)
//: As above, but with released (not self-stopping enveloped) synth
(
{
0.002 *> \test0; // Initialize at 500 events / second;
{ SinOsc.arps(Rand(1000, 2000)) } +> \test0;
0.1.wait;
loop {
[
{ 0.001 **> \test0; }, // 1000 events / second
{ 0.1 **> \test0; } // 10 events / second. For distinctness
].choose.value;
[0.1, 0.01 exprand: 0.5, 1].choose.wait;
}
}.fork
)
//: Stable ???
(
{
0.001 *> \test0; // start playing task with 1000 events / second;
loop {
[
{{ SinOsc.arps(Rand(1000, 2000)).perc } +> \test0 },
{{ SinOsc.arps(Rand(1000, 2000)) } +> \test0;},
{ 0.001 **> \test0; },
{ 0.01 **> \test0; }
].choose.value;
[0.1, 0.01, 2].choose.wait;
}
}.fork
)
//:
(
{ SinOsc.arps(Rand(1000, 2000)).perc } +> \test0;
[Pn(0.005, 120) ! 10, Pn(0.1, 4) ! 5, 0.5, 1.5].flat.prand *> \test0;
)
//:
// More stress-tests.
(
{ SinOsc.arps(Rand(400, 5000)).perc } +> \test0 *> [0.01.pn(50), 0.05.pn(30), 1].prand;
)
//: With nodes released at each new event
(
{ SinOsc.arps(Rand(100, 5000)) } +> \test0 *> [0.02.pn(50), 0.2.pn(10), 1].prand;
)
//:
// Testing the limits ...:
(
0.001 *> \test0;
)
//:
(
{ SinOsc.arps(Rand(100, 300)).perc } +> \test0 *> 0.001;
)
//:
(
{ SinOsc.arps(Rand(100, 300)) } +> \test0 *> 0.001;
)
//: