Make installation more generic

This commit is contained in:
2024-05-14 10:48:15 +02:00
parent 38670a6931
commit 176004f7c4
2 changed files with 31 additions and 48 deletions

View File

@ -8,87 +8,62 @@ Boot {
*new { *new {
arg configPath, samplePath, serverOptions; arg configPath, samplePath, serverOptions;
var p; var c; var t; var s; var d; var e; var b; var p; var c; var t; var s; var d; var e; var b;
Server.killAll;
BuboUtils.fancyPrint(BuboUtils.banner, 40); BuboUtils.fancyPrint(BuboUtils.banner, 40);
Server.killAll;
MIDIClient.init; MIDIClient.init;
if (serverOptions == nil, if (serverOptions == nil, {
{
"-> Booting using default server configuration".postln; "-> Booting using default server configuration".postln;
s = Server.default; s = Server.default;
s.options.numBuffers = (2048 * 2048) * 2; s.options.numBuffers = (2048 * 2048) * 2;
s.options.maxLogins = 1; s.options.maxLogins = 1;
s.options.memSize = 8192 * 64; s.options.memSize = 8192 * 64;
s.options.numWireBufs = 2048; s.options.numWireBufs = 2048;
s.options.outDevice = "BlackHole 64ch";
s.options.maxNodes = 1024 * 32; s.options.maxNodes = 1024 * 32;
s.options.numOutputBusChannels = 24; s.options.numOutputBusChannels = 24;
s.options.numInputBusChannels = 16; s.options.numInputBusChannels = 16;
}, }, {
{
"-> Booting using custom server configuration".postln; "-> Booting using custom server configuration".postln;
s = Server.default; s = Server.default;
// Imposing a very high number of buffers! // Imposing a very high number of buffers!
serverOptions.numBuffers = (2048 * 512) * 2; serverOptions.numBuffers = (2048 * 512) * 2;
s.options = serverOptions; s.options = serverOptions;
}, });
);
// Using Ableton Link Clock for automatic synchronisation with other peers // Using Ableton Link Clock to sync with other peers
this.clock = LinkClock(130 / 60).latency_(Server.default.latency).permanent_(true); this.clock = LinkClock(130 / 60).latency_(Server.default.latency).permanent_(true);
TempoClock.default = this.clock; TempoClock.default = this.clock;
c = this.clock; c = this.clock;
t = this.clock.tempo; t = this.clock.tempo;
// Defining the local path as default for configuration files if not configPath // Defaut local path for configuration files if not configPath
this.localPath = this.class.filenameSymbol.asString.dirname +/+ "Configuration"; this.localPath = this.class.filenameSymbol.asString.dirname +/+ "Configuration";
this.samplePath = samplePath;
p = ProxySpace.push(s.boot, clock: this.clock); p = ProxySpace.push(s.boot, clock: this.clock);
p.quant = 4; p.fadeTime = 0.01; p.quant = 4;
this.samplePath = samplePath ? "/Users/bubo/.config/livecoding/samples"; p.fadeTime = 0.01;
// Setting up the audio samples/buffers manager // Setting up the audio samples/buffers manager
Bank.lazyLoading = true; Bank.lazyLoading = true;
Bank.root = this.samplePath; Bank.root = this.samplePath;
// Post actions: installing behavior after server boot // Post actions: installing behavior after server boot
Server.default.waitForBoot({ Server.default.waitForBoot({
if (false) {
// d = ();
// Exceptional Dual Sardine Boot
// d.dirt = SuperDirt(2, s);
// d.dirt.fileExtensions = ["wav","aif","aiff","aifc","mp3"];
// d.dirt.loadSoundFiles("/Users/bubo/Library/Application\ Support/Sardine/SON/*");
// d.dirt.loadSoundFiles("/Users/bubo/.config/livecoding/samples/*");
// d.dirt.doNotReadYet = true;
// d.dirt.start(57120, [ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22]);
// (
// d.d1 = d.dirt.orbits[0]; d.d2 = d.dirt.orbits[1]; d.d3 = d.dirt.orbits[2];
// d.d4 = d.dirt.orbits[3]; d.d5 = d.dirt.orbits[4]; d.d6 = d.dirt.orbits[5];
// d.d7 = d.dirt.orbits[6]; d.d8 = d.dirt.orbits[7]; d.d9 = d.dirt.orbits[8];
// d.d10 = d.dirt.orbits[9]; d.d11 = d.dirt.orbits[10]; d.d12 = d.dirt.orbits[11];
// );
// d.dirt.soundLibrary.addMIDI(\midi, MIDIOut.newByName("MIDI", "Bus 1"));
// d.dirt.soundLibrary.addMIDI(\midi2, MIDIOut.newByName("MIDI", "Bus 2"));
};
s.latency = 0.3; s.latency = 0.3;
// Resume normal boot sequence // Resume normal boot sequence
"-> Loading config from: %".format(configPath ? (this.localPath +/+ "Startup.scd")).postln; "-> Loading config from: %".format(configPath ? (this.localPath +/+ "Startup.scd")).postln;
(configPath ? (this.localPath +/+ "Startup.scd")).load; (configPath ? (this.localPath +/+ "Startup.scd")).load;
BuboUtils.fancyPrint(BuboUtils.ready, 40); BuboUtils.fancyPrint(BuboUtils.ready, 40);
this.installServerTreeBehavior(); this.installServerTreeBehavior();
this.clock.enableMeterSync(); this.clock.enableMeterSync();
// Installing Safety for Sound
Safety.all; Safety.all;
Safety(s).defName = \safeLimit; Safety(s).defName = \safeLimit;
Safety.setLimit(1); Safety.setLimit(1);
e = currentEnvironment; e = currentEnvironment;
// Setting up the archive
"Retrieving code archives".postln;
b = Archive.global.at(\bubo);
}); });
} }
@ -96,12 +71,22 @@ Boot {
*installServerTreeBehavior { *installServerTreeBehavior {
CmdPeriod.add({ CmdPeriod.add({
BuboUtils.fancyPrint("\nBubo SuperCollider Session\nTempo: % | Peers: %\nCPU: % | Peak: %\n".format( BuboUtils.fancyPrint("\nBubo SuperCollider Session\nTempo: % | Peers: %\nCPU: % | Peak: %\n".format(
this.clock.tempo * 60, this.clock.numPeers, this.clock.tempo * 60, this.clock.numPeers, Server.default.avgCPU.round(2), Server.default.peakCPU.round(2)), 40);
Server.default.avgCPU.round(2),
Server.default.peakCPU.round(2)), 40) // This Routine prints the current server state
Tdef(\log, {
loop {
"TP: %/% CPU: %".format(
TempoClock.default.bar,
TempoClock.default.beats,
Server.default.avgCPU
).postln;
1.0.wait;
}
}).play;
}, Server.default); }, Server.default);
// This custom event is used for audio looping
Event.addEventType(\buboLoopEvent, { Event.addEventType(\buboLoopEvent, {
arg server; arg server;
if (~sp.notNil && ~nb.notNil, { if (~sp.notNil && ~nb.notNil, {
@ -118,7 +103,6 @@ Boot {
currentEnvironment.play; currentEnvironment.play;
}); });
// This custom event makes it easier to play samples
Event.addEventType(\buboEvent, { Event.addEventType(\buboEvent, {
arg server; arg server;
if (~sp.notNil && ~nb.notNil, { if (~sp.notNil && ~nb.notNil, {

View File

@ -156,11 +156,11 @@ m = MIDIOut.newByName("MIDI", "Bus 1");
( (
~ground => [pat: "[kick:2(5,16)/16, fgood:11/2]", release: 4]; ~ground => [pat: "[kick:2(5,16)/16, fgood:11/2]", release: 4, quant: 4];
~snare => [pat: "[~ snare]/16", release: 4]; ~snare => [pat: "[~ snare]/16", release: 4, quant: 4];
~snare.fx1(0.7, {arg in; MiVerb.ar(in, time: 0.7)}); ~snare.fx1(0.7, {arg in; MiVerb.ar(in, time: 0.7)});
~hat => [pat: "[sound:2|hat:5] hat:2 hat:3!2", release: 1/32, ~hat => [pat: "[sound:2|hat:5] hat:2 hat:3!2", release: 1/32,
amp: [0.0,-12.0].pwhite(inf) amp: [0.0,-12.0].pwhite(inf), quant: 4
]; ];
~hat.play; ~hat.play;
~snare.play; ~snare.play;
@ -171,11 +171,13 @@ m = MIDIOut.newByName("MIDI", "Bus 1");
amp: -12, curve: -2, tune: [0, [2, 4, 8].pseq(inf)], amp: -12, curve: -2, tune: [0, [2, 4, 8].pseq(inf)],
release: {LFNoise0.kr(c.dur).range(0.1, 1)} * 4, release: {LFNoise0.kr(c.dur).range(0.1, 1)} * 4,
scale: Scale.chromatic, scale: Scale.chromatic,
quant: 4,
modSpeed: 8, pat: "[0(5,8) 3(5,8)]/8", modSpeed: 8, pat: "[0(5,8) 3(5,8)]/8",
]; ];
~vorb.play; ~vorb.play;
~apply => [ ~apply => [
instrument: 'kraut', instrument: 'kraut',
quant: 4,
octave: [5, 6].pxrand(inf), octave: [5, 6].pxrand(inf),
amp: -12, curve: -2, tune: 2, amp: -12, curve: -2, tune: 2,
release: {LFNoise0.kr(c.dur).range(0.1, 1)}, release: {LFNoise0.kr(c.dur).range(0.1, 1)},
@ -188,6 +190,3 @@ m = MIDIOut.newByName("MIDI", "Bus 1");
}); });
~apply.play; ~apply.play;
) )
nil.isNil