Add midiouts for macos
authorEugene Petkevich <nasedil.genio.code@gmail.com>
Wed, 6 Dec 2023 22:15:03 +0000 (23:15 +0100)
committerEugene Petkevich <nasedil.genio.code@gmail.com>
Wed, 6 Dec 2023 22:15:03 +0000 (23:15 +0100)
startup.scd

index c542853..5b7442f 100644 (file)
@@ -1,15 +1,22 @@
 // ==== Server setup
 //ServerOptions.outDevices
+
 s.options.outDevice = "Aggregate Device";
+
 //s.options.outDevice = "MA WFRIENDZ";
 //s.options.outDevice = "MacBook Air Speakers";
 //s.options.outDevice = "External Headphones";
 //s.options.outDevice = "EDIFIER R1080BT";
 //s.options.outDevice = "Scarlett 2i4 USB";
 //s.options.outDevice = "Bose Mini II SE SoundLink";
+
+s.options.inDevice = "Aggregate Device";
+
 //s.options.inDevice = "MacBook Air Microphone";
 //s.options.inDevice = "Scarlett 2i4 USB";
-s.options.inDevice = "Aggregate Device";
+//s.options.inDevice = "Scarlett Solo USB";
+
+// other server options
 s.options.maxNodes = 128 * 1024;
 s.options.maxSynthDefs = 32 * 1024;
 s.options.memSize = 1024 * 1024;
@@ -26,10 +33,11 @@ s.latency = 0.4;
 
 Platform.case(
   \osx, {
+    "Macos detected".postln;
     thisProcess.platform.recordingsDir = "/Users/genio/stock/audio/supercollider";
   },
-  \linux,     { "Linux".postln },
-  \windows,   { "Windows".postln }
+  \linux,     { "Linux detected".postln },
+  \windows,   { "Windows detected".postln }
 );
 
 // global nice variables
@@ -72,16 +80,34 @@ b = (
 };
 ~midiup.value;
 
-try {
-  ~macbookMidiOut = MIDIOut.newByName("IAC Driver", "Bus 1").latency_(s.latency);
-} {
-  "Cannot connect to macbook midi out".postln;
-};
+Platform.case(
+  \osx, {
+    try {
+      ~moutArdour1 = MIDIOut.newByName("IAC Driver", "Bus 1").latency_(s.latency);
+      ~moutArdour2 = MIDIOut.newByName("IAC Driver", "Bus 2").latency_(s.latency);
+      ~moutArdour3 = MIDIOut.newByName("IAC Driver", "Bus 3").latency_(s.latency);
+      ~moutArdour4 = MIDIOut.newByName("IAC Driver", "Bus 4").latency_(s.latency);
+      ~moutFl = MIDIOut.newByName("IAC Driver", "Bus 5").latency_(s.latency);
+      ~moutAbleton = MIDIOut.newByName("IAC Driver", "Bus 6").latency_(s.latency);
+      ~moutHydrogen = MIDIOut.newByName("IAC Driver", "Bus 7").latency_(s.latency);
+      ~mout8 = MIDIOut.newByName("IAC Driver", "Bus 8").latency_(s.latency);
+    } {
+      "Cannot connect to macbook midi out".postln;
+    };
+  },
+  \linux,     {  },
+  \windows,   {  }
+);
 
 m = (
-  hydrogenOut: ~macbookMidiOut,
-  abletonOut: ~macbookMidiOut,
-  ardourOut: ~macbookMidiOut,
+  arout1: ~moutArdour1,
+  arout2: ~moutArdour2,
+  arout3: ~moutArdour3,
+  arout4: ~moutArdour4,
+  about: ~moutAbleton,
+  flout: ~moutFl,
+  hyout: ~moutHydrogen,
+  out8: ~mout8
 );
 
 // recording