From 065deec4c33e6c2f65eb0aa8e68d7fffca8de555 Mon Sep 17 00:00:00 2001 From: David Runge Date: Thu, 21 Dec 2017 21:45:39 +0100 Subject: .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. --- .config/SuperCollider/startup.scd | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to '.config/SuperCollider') 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 + -- cgit v1.2.3-70-g09d2