-
Notifications
You must be signed in to change notification settings - Fork 3
/
republic_basicpatterns.scd
110 lines (87 loc) · 2.3 KB
/
republic_basicpatterns.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
// share a synthdef
(
SynthDef(\xxx, {|out, zzf = 440, sustain = 1, mod = 0.5, amp = 0.1, pan|
var env = Line.kr(1, 0, sustain, doneAction: 2);
Out.ar(out,
Pan2.ar(
RLPF.ar(
LFPulse.ar(zzf, 0, SinOsc.kr(mod * zzf)),
zzf * (env.cubed + mod + 0.5),
0.2
),
pan, env * amp
))
}).share;
)
// post all synthdefs, snd examples for events and patterns that use it
r.postSynthDefs;
r.postEvents;
r.postPdefs;
// play a pattern that goes around all members
(
Pdef(\x,
Pbind(
\instrument, \xxy,
\server, r.s,
\where, Prand(r.nameList, 8), //
\dur, 1,
\legato, 0.3,
\freq, Pwhite().linexp(0, 1, 500, 2000)
).trace
).play;
)
// getting to the different servers:
r.servers;
r.nameList;
// play an event with that synthdef on your computer:
(server: r.myServer, instrument: \xxy, freq: exprand(300, 1000)).play;
// or choose random member:
(server: r.servers.choose, instrument: \xxy, freq: exprand(300, 1000)).play;
// using where: //
// send a synth to everyone:
(server: r.s, where: \all, instrument: \xxy, freq: exprand(300, 1000)).play;
// or to a specific member (replace \XXX with someone's nickname)
(server: r.s, instrument: \xxy, where: \XXX, freq: exprand(300, 1000)).play;
// or to a subset of the members
(server: r.s, where: [\jrhbr, \adc], instrument: \xxy, freq: [400, 1600]).play;
// by an index - same as r.nameList.wrapAt(index)
(server: r.s, where: 1, instrument: \xxy, freq: [400, 1600]).play;
// by a list of indices - same as r.nameList.wrapAt(indices)
(server: r.s, where: [1, 2], instrument: \xxy, freq: [400, 1600]).play;
// test if pattern works here:
(
Pdef(\x,
Pbind(
\instrument, \xxx,
\server, r.servers[r.nickname],
\zzf, Pseq([8700, 800, 720], inf),
\mod, Pwhite(0.1, 0.7, inf),
\dur, Prand([0.3, 0.5, Pn(0.04, 5)], inf)
)
).play
)
// send synth messages to random participants:
(
Pdef(\x,
Pbind(
\instrument, \xxx,
\server, r.s,
\where, r.nameList.scramble.keep(3),
\zzf, Pseq([8700, 800, 720], inf) * [ 1, 1.5, 2.5],
\strum, 0.03,
\mod, Pwhite(0.1, 0.7, inf),
\dur, Prand([0.3, 0.5, Pn(0.04, 5)], inf)
)
).play
)
(
Pdef(\x,
Pbind(
\instrument, \xxx,
\server, Pfunc { r.servers.choose } .trace,
\zzf, Pseq([8700, 800, 720], inf),
\mod, Pwhite(0.1, 0.7, inf),
\dur, Prand([0.3, 0.5, Pn(0.04, 5)], inf)
)
).play
)