diff --git a/BuboShortcuts.sc b/BuboShortcuts.sc new file mode 100644 index 0000000..569519e --- /dev/null +++ b/BuboShortcuts.sc @@ -0,0 +1 @@ +Eu : Pbjorklund2 {} diff --git a/Classes/BuboBoot.sc b/Classes/BuboBoot.sc index e7571fb..a240c4c 100644 --- a/Classes/BuboBoot.sc +++ b/Classes/BuboBoot.sc @@ -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); + } + }