-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScenes.sc
71 lines (51 loc) · 1.01 KB
/
Scenes.sc
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
Scenes{
classvar index;
classvar list;
classvar sources;
classvar instance;
classvar p;
*new{|proxyspace|
p = proxyspace;
instance.isNil.if(
instance = this;
// CmdPeriod.add(this);
);
index = 1;
list = List.new;
sources = List.new;
}
*reset{
list = List.new;
sources = List.new;
}
*save{
var cnt = 0;
p.playingProxies.collect{ cnt = cnt + 1; };
if(cnt>0){
list.add(List.new);
sources.add(List.new);
("saving scene no.:"+(list.size-1)).postln;
p.playingProxies.postln;
p.playingProxies.collect{|n|
var synth = p[n.asSymbol];
list[list.size-1].add(synth);
sources[sources.size-1].add(synth.source.asCompileString)
}
}{ "no playing proxies found".postln};
}
*load{|id|
var idx = 0;
index = id;
"loading scene no.:"+index;
p.playingProxies.collect{|n|
var synth = p[n.asSymbol];
synth.stop(1.1);
};
list[index].collect{|n|
n = sources[index][idx].interpret;
sources[index][idx].postln;
n.play();
idx=idx+1;
}
}
}