-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKorgParticles_200227.sc
79 lines (64 loc) · 3.18 KB
/
KorgParticles_200227.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
72
73
74
75
76
77
78
/*
KorgParticles_200227.start
~startAppTask.start
// Particles
NetAddr("127.0.0.1", 9005).sendMsg("/particleView", 0.asInteger)
NetAddr("127.0.0.1", 9005).sendMsg("/particleView", 1.asInteger)
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "bounce", 100,100,500,900)
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "bounce", 100,100,800,900)
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "particleNeighborhood", 4)
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "particleNeighborhood", 20)
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "conColor", 255.asInteger,255.asInteger,255.asInteger,25.asInteger)
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "dotColor", 255.asInteger,255.asInteger,255.asInteger,255.asInteger)
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "forceRadius", 35.asInteger)
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "forceScale", 100.asInteger)
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "pushParticles", 1.asInteger)
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "pushParticles", 0.asInteger)
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "push", 300.asInteger, 200.asInteger)
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "lineOpacity", 2)
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "push", 150,150)
*/
KorgParticles_200227 {
*start {
Task({
this.mapControllers;
0.5.wait;
}).start;
}
*mapControllers {
~xStart = 0;~yStart = 0;~xEnd = 1920; ~yEnd = 1020;
~midi42 = CCResponder({ |src,chan,num,value|
[src,chan,num,value].postln;
~yStart = LinLin.kr( value, 0, 126, 1020, 0);
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "bounce", ~xStart, ~yStart, ~xEnd, ~yEnd);
}, nil, nil, 42, nil);
~midi57 = CCResponder({ |src,chan,num,value|
[src,chan,num,value].postln;
~xStart = LinLin.kr( value, 0, 126, 0, 1920);
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "bounce", ~xStart, ~yStart, ~xEnd, ~yEnd);
}, nil, nil, 57, nil);
~midi43 = CCResponder({ |src,chan,num,value|
[src,chan,num,value].postln;
~yEnd = LinLin.kr( value, 0, 126, 1020, 0);
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "bounce", ~xStart, ~yStart, ~xEnd, ~yEnd);
}, nil, nil, 43, nil);
~midi58 = CCResponder({ |src,chan,num,value|
[src,chan,num,value].postln;
~xEnd = LinLin.kr( value, 0, 126, 0, 1920);
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "bounce", ~xStart, ~yStart, ~xEnd, ~yEnd);
}, nil, nil, 58, nil);
//NetAddr("127.0.0.1", 12345).sendMsg("/particle", "particleNeighborhood", 4)
~midi66 = CCResponder({ |src,chan,num,value|
[src,chan,num,value].postln;
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "particleNeighborhood", LinLin.kr( value, 0, 126, 0, 50));
}, nil, nil, 66, nil);
~midi65 = CCResponder({ |src,chan,num,value|
[src,chan,num,value].postln;
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "dotColor", 255.asInteger,255.asInteger,255.asInteger,LinLin.kr( value, 0, 126, 0, 255).asInteger);
}, nil, nil, 65, nil);
~midi63 = CCResponder({ |src,chan,num,value|
[src,chan,num,value].postln;
NetAddr("127.0.0.1", 12345).sendMsg("/particle", "conColor", 255.asInteger,255.asInteger,255.asInteger,LinLin.kr( value, 0, 126, 0, 255).asInteger);
}, nil, nil, 63, nil);
}
}