aboutsummaryrefslogtreecommitdiffstats
path: root/.config/SuperCollider/startup.scd
blob: 0c12dc303504e640fc7e302c5a143cb67221467b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
if(PathName("/dev/fw1").isFile, {
//  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]};
  });
});
~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