aboutsummaryrefslogtreecommitdiffstats
path: root/.config/SuperCollider
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2017-12-21 21:45:39 +0100
committerDavid Runge <dave@sleepmap.de>2017-12-21 21:45:39 +0100
commit065deec4c33e6c2f65eb0aa8e68d7fffca8de555 (patch)
treec5a8e9c4e32852716743d81fdb3227833348a00a /.config/SuperCollider
parent9f64bd96586f944a1a95404adcbc5a172482f0a4 (diff)
downloaddotfiles-065deec4c33e6c2f65eb0aa8e68d7fffca8de555.tar.gz
dotfiles-065deec4c33e6c2f65eb0aa8e68d7fffca8de555.tar.bz2
dotfiles-065deec4c33e6c2f65eb0aa8e68d7fffca8de555.tar.xz
dotfiles-065deec4c33e6c2f65eb0aa8e68d7fffca8de555.zip
.config/SuperCollider/startup.scd: Using easier and more unified way to load standard num{Input,Output}BusChannels per interface. Using ffado-test still has to be setup for firewire devices.
Diffstat (limited to '.config/SuperCollider')
-rw-r--r--.config/SuperCollider/startup.scd35
1 files changed, 20 insertions, 15 deletions
diff --git a/.config/SuperCollider/startup.scd b/.config/SuperCollider/startup.scd
index 9d905a2..0c12dc3 100644
--- a/.config/SuperCollider/startup.scd
+++ b/.config/SuperCollider/startup.scd
@@ -1,23 +1,28 @@
-Server.local.options.numOutputBusChannels = 2;
-Server.local.options.numInputBusChannels = 2;
-Server.local.options.sampleRate = 48000.0;
-
if(PathName("/dev/fw1").isFile, {
- load(Platform.userConfigDir++"/startupfiles/rme_fireface800.scd");
-});
-if(("aplay -l |grep Babyface > /dev/null".systemCmd) == 0, {
- load(Platform.userConfigDir++"/startupfiles/rme_babyface.scd");
-});
-if(("aplay -l |grep XUSB > /dev/null".systemCmd) == 0, {
- load(Platform.userConfigDir++"/startupfiles/behringer_xusb.scd");
+// if(("which ffado-test").systemCmd == 0, {
+// ~ffadoDevice = ("ffado-test ListDevices |tail -1").unixCmdGetStdOut;
+// ~ffadoDevice.asArray.postln;
+// });
+ ~audioInterfaceOptions = ['RME Fireface 800', 28, 28];
+ "SC_JACK_DEFAULT_INPUTS".setenv("firewire_pcm");
+ "SC_JACK_DEFAULT_OUTPUTS".setenv("firewire_pcm");
+},{
+ if(("which aplay").systemCmd == 0, {
+ ~alsaDevices = ("aplay -l").unixCmdGetStdOut;
+ ~audioInterfaceOptions = case
+ {~alsaDevices.contains("Babyface")}{['RME Babyface', 12, 10]}
+ {~alsaDevices.contains("XUSB")}{['Behringer XUSB', 32, 32]}
+ {~alsaDevices.contains("Scarlett 18i20")}{['Focusrite Scarlett 18i20', 20, 18]};
+ });
});
-if(("aplay -l |grep 'Scarlett 18i20' > /dev/null".systemCmd) == 0, {
- load(Platform.userConfigDir++"/startupfiles/focusrite_scarlett18i20.scd");
-});
-postln("Loaded settings for: "++Server.local.options.device);
+~audioInterface = ~audioInterfaceOptions[0];
+Server.local.options.numOutputBusChannels = ~audioInterfaceOptions[1];
+Server.local.options.numInputBusChannels = ~audioInterfaceOptions[2];
+postln("Loaded settings for: "++~audioInterface);
postln("Initializing and connecting MIDI devices.");
MIDIClient.init;
MIDIIn.connectAll;
//TODO: load all quarks from ~/git/audio automatically, don't use symlinks
+