-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstartup.scd
More file actions
266 lines (241 loc) · 9.59 KB
/
Copy pathstartup.scd
File metadata and controls
266 lines (241 loc) · 9.59 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
// make sure you have sc3 plugins installed first
(
var multiServerSetup = false;
//"Server.killAll".unixCmd
//s.volume_(-6)
var inOut = Server.default.options;
//inOut.outDevice = "BlackHole 2ch"; inOut.inDevice = "BlackHole 2ch";
//inOut.outDevice = "BlackHole 16ch"; inOut.inDevice = "BlackHole 16ch";
//inOut.outDevice = "BlackHole 64ch"; inOut.inDevice = "BlackHole 64ch";
//inOut.outDevice = "BlackHole 128ch"; inOut.inDevice = "BlackHole 128ch";
//inOut.outDevice = "BlackHole 256ch"; inOut.inDevice = "BlackHole 256ch";
//inOut.outDevice = "BH2+KA6"; inOut.inDevice = "BH2+KA6";
//inOut.outDevice = "Audient iD14"; inOut.inDevice = "Audient iD14";
//inOut.outDevice = "Komplete Audio 6 MK2"; inOut.inDevice = "Komplete Audio 6 MK2";
//inOut.outDevice = "Double Kompletes"; inOut.inDevice = "Double Kompletes";
//inOut.outDevice = "External Headphones"; inOut.inDevice = "External Microphone";
//inOut.outDevice = "MADIface USB (23949544)"; inOut.inDevice = "MADIface USB (23949544)"; // LR
//inOut.outDevice = "MADIface USB (24053751)"; inOut.inDevice = "MADIface USB (24053751)"; // IAC
s.options.bindAddress = "0.0.0.0";
//s.maxNumClients = 4;
s.options.maxLogins = 4;
s.options.numBuffers = 1024 * 64; // increase if you need to load more samples
s.options.numWireBufs = 1024 * 2; // increase if you get "exception in GraphDef_Recv: exceeded number of interconnect buffers." // 1024 before
s.options.numAudioBusChannels = 4096; // increase if you get "ERROR: Meta_Bus:audio: failed to get an audio bus allocated." // 2048 before
s.options.memSize = 8192 * 256; // increase if you get "alloc failed" messages
s.options.maxNodes = 1024 * 32; // increase if drop outs and the message "too many nodes"
s.options.sampleRate= 44100;
//s.options.blockSize = 4096; // default is 64
//s.options.hardwareBufferSize = 2048;
s.options.maxSynthDefs_(10000);
s.options.numOutputBusChannels = 64; // OUTPUT CHANNELS GO HERE
//s.recSampleFormat = "float32";
s.recSampleFormat = "int24";
s.recHeaderFormat="wav";
s.options.numInputBusChannels = 0; // set to hardware input channel size, if necessary
s.latency = 0.3; // 0.3
MIDIClient.init;
MIDIIn.connectAll;
m = MIDIOut.new(0); // Maybe yours is different? // could be newByName
m.latency = 0.6; // This should match s.latency
n = NetAddr("127.0.0.1", 8000);
thisProcess.platform.recordingsDir = "/Users/danielmkarlsson/sc-rec/"; // choose where supercollider recordings end up
//~m1 = MIDIOut.newByName("IAC Driver", "Bus 1");
//~m2 = MIDIOut.newByName("Komplete Audio 6 MK2", "Komplete Audio 6 MK2");
//~m1.latency = 0.3;
//~m2.latency = 0.3;
// ~m3 = MIDIOut.newByName("IAC Driver", "Bus 3");
// ~m4 = MIDIOut.newByName("IAC Driver", "Bus 4");
// ~m5 = MIDIOut.newByName("IAC Driver", "Bus 5");
// ~m6 = MIDIOut.newByName("IAC Driver", "Bus 6");
// ~m7 = MIDIOut.newByName("IAC Driver", "Bus 7");
// ~m8 = MIDIOut.newByName("IAC Driver", "Bus 8");
// scnvim
if (\SCNvim.asClass.notNil) {
Server.default.doWhenBooted {
\SCNvim.asClass.updateStatusLine(1, \SCNvim.asClass.port); // 9670
}
};
QtGUI.palette = QPalette.dark; // switch to night mode for floating windows like the meter for example.
// A simple triangle wave synth in stereo with panning and a simple low pass filter
// This synthDef builds on the work of Mads Kjeldgaard and requires the sc3 plugins
s.doWhenBooted{
SynthDef.new(\default, {
arg dur, attack=0.01, release=1.0,
t_gate=1, out, freq=440, cutoff=5500,
rq=1, pan=0.0, amp=0.5;
var env = EnvGen.kr(Env.perc(attack, release), t_gate, timeScale: dur, doneAction: 2);
var sig = DPW3Tri.ar(freq: freq, mul: env);
sig = RLPF.ar(sig, cutoff.clip(20.0, 20000.0), rq.clip(0.0,1.0));
sig = Pan2.ar(sig, pan);
Out.ar(out, sig * amp);
}).add;
};
/*
fork {
var cond, runResponder;
s.options.bindAddress = "0.0.0.0";
s.options.maxLogins = 8;
o = ServerOptions.new;
o.maxLogins = 12;
o.bindAddress = "0.0.0.0";
Server.default = s = Server.remote(\remote2, NetAddr("192.168.44.98", 57110), o); // replace "192.168.0.100"
cond = Condition({ s.serverRunning });
// 'signal' will allow the forked routine to advance
// only when 'serverRunning' finally becomes true
runResponder = SimpleController(s).put(\serverRunning, { cond.signal });
//cond.wait;
runResponder.remove;
};
CmdPeriod.freeServers = false;
*/
//SuperClean.irPath = Main.packages.asDict.at('SuperClean') +/+ "IRs" +/+ "akg.wav";
//SuperClean.irPath = Main.packages.asDict.at('SuperClean') +/+ "IRs" +/+ "mir.wav";
SuperClean.irPath = Main.packages.asDict.at('SuperClean') +/+ "IRs" +/+ "spg.wav";
//SuperClean.irPath = Main.packages.asDict.at('SuperClean') +/+ "IRs" +/+ "sst.wav";
SuperClean.resonatorSeed = 16; // tired of the same old filter frequencies? Go ahead, change this number.
// the above line can't be commented out. Check core-synths-global.scd
if (multiServerSetup) {
// Multi-server setup
// be able to load core synths, by pretending that we have a clean instance
~clean = ();
~clean.numChannels = 2;
~servers = 4.collect{|i| // depends maybe, try lowering if no go
var id = 57110;
// var server = Server.new("server"++i, NetAddr("localhost", id+i), Server.local.options); // .boot
var server = Server.new("server"++i, NetAddr("localhost", id+i), s.options); // .boot
~cleanInstances = [];
server.waitForBoot {
var instance = SuperClean(numChannels: 2, server: server);
~cleanInstances = ~cleanInstances.add(instance);
instance.loadSoundFiles; // hot swap in samples from anywhere!
server.sync;
instance.start((0, 2 .. 62)); // 64 auxes
//instance.start((0, 2 .. 126)); // 128 auxes really
//instance.start((0, 2 .. 254)); // all the auxes! well, 256 auxes really
//instance.start([0, 2, 4, 6, 8]);
};
};
} {
// Single server setup
s.waitForBoot {
~clean = SuperClean(2, s); // two output channels
~clean.loadSoundFiles; // hot swap in samples from anywhere!
// for example: ~clean.loadSoundFiles("~/Downloads/rnb");
s.sync; // optionally: wait for samples to be read
//~clean.start((0, 2 .. 62)); // all the auxes!, well, 64 auxes really
SuperClean.default = ~clean; // make the clean key sequenceable inside of SuperCollider
//~clean.start([0]); // can't have any less
//~clean.start([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]); // 24 auxes are sending to the first stereo output
//~clean.start([0].dup(32)); // 32 auxes are sending to the first stereo output
//~clean.start([0, 2]); // quad
//~clean.start([0, 2, 4, 6]); // eight out
//~clean.start([0, 2, 4, 6, 8, 10, 12, 14]); // sixteen out
~clean.start((0, 2 .. 62)); // sixtyfour out
//~clean.start((0, 2 .. 254)); // twohundredandfiftysix out
//~clean.start(Array.series(32, 0, 2).dupEach(2)); // double all the auxes
"[ SuperClean up + running ]".postln;
};
}
//
// (
// r.stop;
// r = {
// loop {
// s.record("~/snd/tmp/continousOverwrite.wav", 2);
// exprand(1, 2).wait;
// s.stopRecording;
// 0.1.wait;
// ~clean.lsf("~/snd/tmp");
// 0.1.wait;
// }
// }.fork;
// );
//
// (
// Pdef(0,
// Pbind(*[
// type: \cln,
// snd: \tmp,
// amp: 1,
// dur: Pdup(Plprand(1, 2), Pwhite(0.1, 1.0)),
// spd: Prand([0.5, 1.0], inf),
// bgn: Plprand(0.0, 0.5) + Prand([0, 2], inf),
// jpr: 1/2,
// jpg: Plprand(0.0, 1.5),
// jps: Pwhite(0.0, 1.0)
// ])
// ).play
// );
//};
//
//
//
//
)
//(
//var inOut = Server.default.options;
//inOut.outDevice = "Komplete Audio 6 MK2"; inOut.inDevice = "Komplete Audio 6 MK2";
//s.options.bindAddress = "0.0.0.0";
//s.options.maxLogins = 4;
//s.options.numBuffers = 1024 * 64; // increase if you need to load more samples
//s.options.numWireBufs = 1024; // increase if you get "exception in GraphDef_Recv: exceeded number of interconnect buffers."
//s.options.numAudioBusChannels = 2048; // increase if you get "ERROR: Meta_Bus:audio: failed to get an audio bus allocated."
//s.options.memSize = 8192 * 256; // increase if you get "alloc failed" messages
//s.options.maxNodes = 1024 * 32; // increase if drop outs and the message "too many nodes"
//s.options.sampleRate= 44100;
//s.options.blockSize = 512; // default is 64
//s.options.maxSynthDefs_(10000);
//s.options.numOutputBusChannels = 64; // OUTPUT CHANNELS GO HERE
//s.recSampleFormat = "int24";
//s.recHeaderFormat="wav";
//s.options.numInputBusChannels = 2; // set to hardware input channel size, if necessary
//s.latency = 0.6; // 0.3
//n = NetAddr("127.0.0.1", 8000);
//QtGUI.palette = QPalette.dark; // switch to night mode for floating windows like the meter for example.
//s.doWhenBooted{
// SynthDef(\default, { |out = 2|
// var input = SoundIn.ar([0, 1]);
// Out.ar(out, CombN.ar(input * 0.dbamp, 0.5, 0.5, 0.001))
// }).play;
//};
//s.waitForBoot {
// ~clean = SuperClean(2, s); // two output channels
// ~clean.loadSoundFiles; // hot swap in samples from anywhere!
// s.sync; // optionally: wait for samples to be read
// ~clean.start((0, 2 .. 62)); // all the auxes!, well, 64 auxes really
// SuperClean.default = ~clean; // make the clean key sequenceable inside of SuperCollider
// "[ SuperClean up + running ]".postln;
// (
// r.stop;
// r = {
// loop {
// s.record("~/snd/tmp/continousOverwrite.wav", 2);
// exprand(3, 6).wait;
// s.stopRecording;
// 0.1.wait;
// ~clean.lsf("~/snd/tmp");
// 0.1.wait;
// }
// }.fork;
// );
// (
// Pdef(0,
// Pbind(*[
// type: Pwrand2([\cln, \], [2, 1], inf),
// snd: \tmp,
// amp: 1,
// dur: Pdup(Plprand(1, 2), Pwhite(0.1, 3.0)),
// spd: Pwrand2([0.5, 1.0], [1, 4], inf),
// bgn: Plprand(0.0, 0.5) + Prand([0, 2], inf),
// jpr: 1/4,
// jpg: Plprand(0.0, 2.0),
// jps: Pseq([Plprand(0.0, 0.5, 1), Phprand(0.5, 1.0, 1)], inf),
// flp: Pwhite(0, 1),
// pan: Pmeanrand(0.25, 0.75),
// hpf: 200,
// ])
// ).play
// );
//};
//)