-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredFrik-8.scd
134 lines (120 loc) · 3.86 KB
/
redFrik-8.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
/* 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-8.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);
)
//--tweet0080 xOr disco stereo sweep NICE!!! play with 0082
//play{a=SinOsc;b=a.ar(1/3);Duty.ar(SampleDur.ir,0,Dseq([0,1],inf)).bitXor(a.ar(b>0*30+60,0,a.ar(4,0,a.ar([3,2]/9,b*3,9))))/9}//#SuperCollider
(
Ndef(\x).fadeTime = 20;
Ndef(\x).fadeTime = 5;
Ndef(\x, { a=SinOsc;b=a.ar(1/3);Duty.ar(SampleDur.ir,0,Dseq([0,1],inf)).bitXor(a.ar(b>0*30+60,0,a.ar(4,0,a.ar([3,2]/9,b*3,9))))/9} );
)
//--tweet0082 grr, grrr, grrrrr, whip!
//play{a=LFTri.ar(1/9)*0.07+0.0708;CombN.ar(Decay2.ar(Duty.ar(Dseq([1e-4,a/2],inf),0!2,Dseq([-1,0,1,0],inf)),a/9,a)/5,1,1,12)}//#SuperCollider
(
a.stop;
Ndef(\y, {a=LFTri.ar(1/9)*0.07+0.0708;CombN.ar(Decay2.ar(Duty.ar(Dseq([1e-4,a/2],inf),0!2,Dseq([-1,0,1,0],inf)),a/9,a)/5,1,1,12)} );
Ndef(\y).play;
Ndef(\y).play;
)
//--tweet0050 clonky percussion exploration. play with 51
//play{a=Saw;b=(2..12);c=0.015;GVerb.ar(Splay.ar(Klank.ar(`[b*50+b,c,c],Hasher.ar(a.ar(b/4pi,a.ar(c)*b+b).ceil)))/9,5.rand+1)}//#SuperCollider
(
Ndef(\x).fadeTime = 15;
b.stop;
b= Task({
20.do({ arg i;
Ndef(\x, {
a=Saw;b=(2..12);c=0.015;GVerb.ar(Splay.ar(Klank.ar(`[b*50+b,c,c],Hasher.ar(a.ar(b/4pi,a.ar(c)*b+b).ceil)))/9,5.rand+1) });
});
});
b.start;
Ndef(\x).play;
)
//--tweet0051 mix with 50 above
//play{a=Saw;GVerb.ar(Splay.ar(BBandPass.ar(a.ar("sunday".ascii),a.ar(9/"slow".ascii)*400+500,a.ar(7/"coding".ascii)+1.1)/5))}//#SuperCollider
(
Ndef(\y).fadeTime = 15;
a.stop;
a = Task({
2.do({ arg i;
Ndef(\y, {
a=Saw; GVerb.ar(
Splay.ar(BBandPass.ar(a.ar("sunday".ascii),a.ar(9/"slow".ascii)*400+500,a.ar(7/"coding".ascii)+1.1)/5))});
});
});
a.start;
Ndef(\y).play;
)
//--tweet0004 whirring soundscape 4 & 5
//r{loop{ z=20.rand+6;x={y=LFTri.ar(z).abs/9/z;RLPF.ar(TDuty.ar(y,0,y),z*600,0.06,9)!2}.play(s,0,z);wait(26-z);x.release}}.play//#SuperCollider
// this one needs another def to start.
(
Ndef(\x).fadeTime = 15;
b.stop;
b = Task({
4.do({ arg i;
Ndef(\x).map(\s, i);
Ndef(\x, { z=20.rand+6;x={ y=LFTri.ar(z).abs/9/z;RLPF.ar(TDuty.ar(y,0,y),z*600,0.06,9)!2}} );
Ndef(\x).fadeTime = 26-20.rand+6;
});
});
b.start;
Ndef(\x).play;
)
b.stop;
b.start;
//--tweet0007 nice room plucked instrument with strums and nice growing druming.
//r{loop{x={BPF.ar(Pluck.ar(Crackle.ar([1.9,1.8]),Impulse.ar(5.rand+1),0.05,0.05.linrand),1200.rand)}.play(s,0,9);wait(9);x.release(69)}}.play
(
Ndef(\y).fadeTime = 25;
a.stop;
a = Task({
5.do({ arg i;
Ndef(\y).map(\s, i);
Ndef(\y, { BPF.ar(Pluck.ar( Crackle.ar([1.9,1.8]),Impulse.ar(5.rand+1),0.05,0.05.linrand),1200.rand)*5} );
Ndef(\y).fadeTime = (9);
9.wait;
});
});
a.start;
Ndef(\y).play;
)