-
Notifications
You must be signed in to change notification settings - Fork 0
/
Proto.scd
71 lines (45 loc) · 1.01 KB
/
Proto.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
a = [{"1".postln;},{"2".postln;}]
b = a[0]
b.()
//------------------------------------------------------
c = 0
c.addUniqueMethod(\test,{|a| "hi %".format(a)});
c.test
d = c.shallowCopy
d = 1
//------------------------------------------------------
n = Proto({
~mul = { |x, y| [x, y, x * y] };
});
n.mul(5, 4);
p = n.copy
q = n.clone({
~mul = { |x, y| [x, y, (x * x) + (y * y)] };
});
p.mul(3,2);
q.mul(5,4);
//------------------------------------------------------
(
~serviceProto = Proto({
~basePath = "Error : need to imp.";
~searchWithText = {|searchString, itrFunc, completeFunc|
"searching % for % ....".format(~basePath,searchString);
};
});
~freesoundProto = ~serviceProto.clone({
~basePath = "freesound";
~searchWithText = {|searchString, itrFunc, completeFunc|
"searching % for % ....".format(~basePath,searchString);
10.do({|i| itrFunc.(i);});
};
});
~localDiskProto = ~serviceProto.clone({
~basePath = "local disk";
});
~freesoundProto.searchWithText("e",
{|itr|
},
{|result|
}
);
)