-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredFrik-3.scd
141 lines (121 loc) · 3.67 KB
/
redFrik-3.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
/* from Fredrik Olofsson https://sccode.org/1-4Qy
* This is the first set of sc tweets converted to Ndefs to play them
* The intent is to stick to triptychs
* alternating between two Ndefs swapping voices.
*/
Ndef.clear;
(
//t.stop; //t.start; t.pause; t.resume;
Ndef.clear;
a.stop;
b.stop;
c.stop;
s.free;
t.free;
u.free;
v.free;
w.free;
)
(
s.boot; // start the server
MIDIIn.connectAll;
r = Recorder(s);
//setup
Ndef.clear;
m = NdefGui.new;
n = NdefGui.new;
m.object_(Ndef(\x));
n.object_(Ndef(\y));
// volume control via midi
i = MIDIFunc.cc( {arg ...args; Ndef(\y).vol_(args[0]/127.0)}, 0); // match cc 0
j = MIDIFunc.cc( {arg ...args; Ndef(\x).vol_(args[0]/127.0)}, 1); // match cc 1
// record via midi
s = MIDIFunc.cc({arg ...args;
if (args[0] > 0,
{ r.record(path:"~/Audio/supercollider/olofsson-triptychs/red-3.aiff"); },
{ r.stopRecording } )} , 41); // match cc 41 is record onkontrol2
// pause resume via midi
t = MIDIFunc.cc({arg ...args; if (args[0] > 0, { Ndef(\y).resume}, {Ndef(\y).pause })} , 48); // match cc 48
u = MIDIFunc.cc({arg ...args; if (args[0] > 0, { Ndef(\x).resume}, {Ndef(\x).pause })} , 49);
v = MIDIFunc.cc({arg ...args; if (args[0] > 0, { Ndef(\y).play}, {Ndef(\y).stop })} , 64);
w = MIDIFunc.cc({arg ...args; if (args[0] > 0, { Ndef(\x).play}, {Ndef(\x).stop })} , 65);
)
//--tweet0087 funny wobbly arpeggio (play with 82 grrrr) play against crack caliope
play{BLowPass4.ar(Splay.ar(VarSaw.ar(200*Duty.kr(1/(1..5),0,Dseq(flat({|x|{|y|y+1/(x+1)}!8}!8),inf)))),5e3,LFTri.kr(9)+1.1)}//#SuperCollider
//--tweet0036 ohm song.
//play{Splay.ar({|i|SinOsc.ar(i+SinOsc.ar(0.01,a=pi/[2,4,8]@@i,0.1,1)*80+SinOsc.ar(i+1*1e-4+i),a,SinOsc.ar(i+1*1e-3,a)/4)}!9)}//#SuperCollider
(
Ndef(\y).fadeTime = 10;
b.stop;
b = Task({
1.do({ arg i;
Ndef(\y, {
Splay.ar( {|i| SinOsc.ar(i+SinOsc.ar(0.01,a=pi/[2,4,8]@@i,0.1,1)*80+SinOsc.ar(i+1*1e-4+i),a,SinOsc.ar(i+1*1e-3,a)/4) }!9) });
});
});
b.start;
Ndef(\y).play;
)
//--tweet0038 funky boing rythm pingpong play with ohm 36
//play{PingPong.ar(LocalBuf(3e4,2).clear,Ringz.ar(CuspN.ar*Impulse.kr([9,8]/12)/9,LFPar.kr(1/[3,2]).range(51,[99,17])*9),0.5)}//#SuperCollider
(
Ndef(\x).fadeTime = 10;
a = Task({
1.do({ arg i;
Ndef(\x, {
PingPong.ar(LocalBuf(3e4,2).clear,Ringz.ar(CuspN.ar*Impulse.kr([9,8]/12)/9,LFPar.kr(1/[3,2]).range(51,[99,17])*9),0.5) });
});
});
a.start;
Ndef(\x).play;
)
//--tweet0028 another fibonacci tune (beeping)
//play{MoogFF.ar(LFTri.ar(CombN.ar(Duty.ar(1/8,0,Dseq(Dshuf(List.fib(16)%8*99,8),inf)),4,4,16))/4,LFTri.kr(1/16,0,2e3,3e3))!2}//#SuperCollider
(
Ndef(\y).fadeTime = 15;
b.stop;
b = Task({
1.do({ arg i;
Ndef(\y, {MoogFF.ar(LFTri.ar(
CombN.ar(
Duty.ar(1/8,0,Dseq(Dshuf(
List.fib(16)%8*99,8),inf)),4,4,16))/4,LFTri.kr(1/16,0,2e3,3e3))!2} );
9.wait;
});
});
b.start;
Ndef(\y).play;
)
//--tweet0037 caliope on crack!
//play{a=LFCub;n=8;Splay.ar(a.ar({|i|pow(i+1,a.kr(1/n,i/n,1/n,1))}!n*150,0,a.kr({|i|pow(i+1,a.kr(i+0.5/n,i/n))}!n).max(0))/4)}//#SuperCollider
(
Ndef(\x).fadeTime = 5;
a.stop;
a = Task({
1.do({ arg i;
Ndef(\x, {
a=LFCub;n=8;
Splay.ar(a.ar({|i|pow(i+1,a.kr(1/n,i/n,1/n,1))}!n*150,0,a.kr({|i|pow(i+1,a.kr(i+0.5/n,i/n))}!n).max(0))/4) });
});
});
a.start;
Ndef(\x).play;
)
// SKIP for now
//--tweet0032 drone with ticks WATCH volume
//{Splay.ar({|i|l=LFTri.ar(1/6,i/1.5,2.5,3.5).round;SinOsc.ar(142.857*l,lag(l,i-3/6),1-poll(0.142857*l,10/6,"\t\t"))}!6)}.play//#SuperCollider
(
Ndef(\y).fadeTime = 9;
b.stop;
b = Task({
1.do({ arg s;
Ndef(\y).map(\i, s);
Ndef(\y, { |i|
Splay.ar({|i|l=LFTri.ar(1/6,i/1.5,2.5,3.5).round;
SinOsc.ar(142.857*l,lag(l,i-3/6),1-poll(0.142857*l,10/6,"\t\t"))}!6)});
9.wait;
});
});
b.start;
Ndef(\y).play;
)