aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2018-01-05 17:21:44 +0100
committerDavid Runge <dave@sleepmap.de>2018-01-05 17:21:44 +0100
commitc217cfcbd89d534b3b54f7790cfbfc00047d6256 (patch)
treeb24b6636a221c9326248f826a63e7a1c532ade3a
parent42508b4673bf9f297d16cbaf8e053548ed57af98 (diff)
downloaddotfiles-c217cfcbd89d534b3b54f7790cfbfc00047d6256.tar.gz
dotfiles-c217cfcbd89d534b3b54f7790cfbfc00047d6256.tar.bz2
dotfiles-c217cfcbd89d534b3b54f7790cfbfc00047d6256.tar.xz
dotfiles-c217cfcbd89d534b3b54f7790cfbfc00047d6256.zip
.config/SuperCollider/startup.scd: Creating Dictionary objects for RME Fireface UFX/800 (and soon all other audio interfaces in use) to hold information about their names, in and outputs and convenience identifiers.
-rw-r--r--.config/SuperCollider/startup.scd72
1 files changed, 62 insertions, 10 deletions
diff --git a/.config/SuperCollider/startup.scd b/.config/SuperCollider/startup.scd
index 0c12dc3..14f934d 100644
--- a/.config/SuperCollider/startup.scd
+++ b/.config/SuperCollider/startup.scd
@@ -3,23 +3,75 @@ if(PathName("/dev/fw1").isFile, {
// ~ffadoDevice = ("ffado-test ListDevices |tail -1").unixCmdGetStdOut;
// ~ffadoDevice.asArray.postln;
// });
- ~audioInterfaceOptions = ['RME Fireface 800', 28, 28];
+ ~audioInterfaceOptions = Dictionary.with(*[
+ \name->'RME Fireface 800',
+ \numInputs->28,
+ \numOutputs->28,
+ \inputs->Dictionary.with(*[
+ \adat1->Array.series(8, 12, 1),
+ \adat2->Array.series(8, 20, 1),
+ \analog->Array.series(10, 0, 1),
+ \spdif->Array.series(2, 8, 1)
+ ]),
+ \outputs->Dictionary.with(*[
+ \adat1->Array.series(8, 12, 1),
+ \adat2->Array.series(8, 20, 1),
+ \analog->Array.series(8, 0, 1),
+ \headphones1->Array.series(2, 10, 1),
+ \spdif->Array.series(2, 8, 1)
+ ])
+ ]);
"SC_JACK_DEFAULT_INPUTS".setenv("firewire_pcm");
"SC_JACK_DEFAULT_OUTPUTS".setenv("firewire_pcm");
},{
- if(("which aplay").systemCmd == 0, {
+ if(("which aplay > /dev/null").systemCmd == 0, {
~alsaDevices = ("aplay -l").unixCmdGetStdOut;
+ // case defining name, number of input and output channels and a Dictionary
+ // holding Symbols for accessing groups of inputs and outputs by name
~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]};
+ {
+ ~alsaDevices.contains("Babyface")
+ }{
+ ['RME Babyface', 12, 10]
+ }
+ {
+ ~alsaDevices.contains("XUSB")
+ }{
+ ['Behringer XUSB', 32, 32]
+ }
+ {
+ ~alsaDevices.contains("Scarlett 18i20")
+ }{
+ ['Focusrite Scarlett 18i20', 20, 18]
+ }
+ {
+ ~alsaDevices.contains("Fireface UFX ")
+ }{
+ Dictionary.with(*[
+ \name->'RME Fireface UFX',
+ \numInputs->22,
+ \numOutputs->22,
+ \inputs->Dictionary.with(*[
+ \adat1->Array.series(8, 14, 1),
+ \adat2->Array.series(8, 0, 1),
+ \analog->Array.series(12, 0, 1),
+ \spdif->Array.series(2, 12, 1)
+ ]),
+ \outputs->Dictionary.with(*[
+ \adat1->Array.series(8, 14, 1),
+ \adat2->Array.series(8, 0, 1),
+ \analog->Array.series(8, 0, 1),
+ \headphones1->Array.series(2, 8, 1),
+ \headphones2->Array.series(2, 10, 1),
+ \spdif->Array.series(2, 12, 1)
+ ])
+ ])
+ };
});
});
-~audioInterface = ~audioInterfaceOptions[0];
-Server.local.options.numOutputBusChannels = ~audioInterfaceOptions[1];
-Server.local.options.numInputBusChannels = ~audioInterfaceOptions[2];
-postln("Loaded settings for: "++~audioInterface);
-
+Server.local.options.numInputBusChannels = ~audioInterfaceOptions.at(\numInputs);
+Server.local.options.numOutputBusChannels = ~audioInterfaceOptions.at(\numOutputs);
+postln("Loaded settings for: "++~audioInterfaceOptions.at(\name));
postln("Initializing and connecting MIDI devices.");
MIDIClient.init;
MIDIIn.connectAll;