less ugly

This commit is contained in:
2023-12-30 13:52:37 +01:00
parent da57969415
commit 562e82999b
2 changed files with 40 additions and 17 deletions

1
BuboShortcuts.sc Normal file
View File

@ -0,0 +1 @@
Eu : Pbjorklund2 {}

View File

@ -1,17 +1,30 @@
Boot {
classvar <>clock;
classvar <>localPath;
classvar <>samplePath;
*new {
arg samplePath;
arg configPath, samplePath;
var s = Server.default;
var p; var c;
var banner = "┳┓ ┓ ┳┓\n"
"┣┫┓┏┣┓┏┓ ┣┫┏┓┏┓╋\n"
"┻┛┗┻┗┛┗┛ ┻┛┗┛┗┛┗";
var ready = "┓ ┳┓┏┏┓ ┏┓┏┓┳┓┏┓ ┳┓┏┓┏┓┳┓┓┏\n"
"┃ ┃┃┃┣ ┃ ┃┃┃┃┣ ┣┫┣ ┣┫┃┃┗┫\n"
"┗┛┻┗┛┗┛ ┗┛┗┛┻┛┗┛ ┛┗┗┛┛┗┻┛┗┛";
var p; var c; var m;
var s = Server.default;
var clock = LinkClock(130 / 60).latency_(Server.default.latency).permanent_(true);
var localPath = this.class.filenameSymbol.asString.dirname +/+ "Configuration";
this.fancyPrint(banner, 40);
// Using Ableton Link Clock for automatic synchronisation with other peers
this.clock = LinkClock(130 / 60).latency_(Server.default.latency).permanent_(true);
c = this.clock;
// Defining the local path as default for configuration files if not configPath
this.localPath = this.class.filenameSymbol.asString.dirname +/+ "Configuration";
// Customizing server options: less conservative than SuperCollider defaults
s.options.numBuffers = 1024 * 128;
s.options.memSize = 8192 * 64;
s.options.numWireBufs = 2048;
@ -19,25 +32,24 @@ Boot {
s.options.device = "BlackHole 16ch";
s.options.numOutputBusChannels = 16;
s.options.numInputBusChannels = 16;
p = ProxySpace.push(Server.default.boot, clock: clock);
c = clock;
Bank.root = samplePath ? "/Users/bubo/.config/livecoding/samples";
p = ProxySpace.push(Server.default.boot, clock: this.clock);
this.samplePath = samplePath ? "/Users/bubo/.config/livecoding/samples";
// Setting up the audio samples/buffers manager
Bank.root = this.samplePath;
Bank.lazyLoading = true;
// Post actions: installing behavior after server boot
Server.default.waitForBoot({
"-> Loading config from: %".format(localPath +/+ "Startup.scd").postln;
(localPath+/+ "Startup.scd").load;
"-> Loading config from: %".format(configPath ? (this.localPath +/+ "Startup.scd")).postln;
(configPath ? (this.localPath +/+ "Startup.scd")).load;
StageLimiter.activate;
this.fancyPrint(ready, 40);
// this.installServerTreeBehavior();
});
}
/*
* Routine that prints the current state of the session every bar
*/
*monitorMessage {
CmdPeriod.add({})
}
/*
* Convenience method for printing a message with a fancy separator.
*/
@ -53,4 +65,14 @@ Boot {
each.postln;
});
}
*installServerTreeBehavior {
CmdPeriod.add({
"Dummy text".postln;
// var text = "Bubo SuperCollider Session\n Tempo: % =-= CPU: %".format(
// this.clock.tempo * 60, Server.default.avgCPU.round(2)
// );
}, Server.default);
}
}