Skip to content

Instantly share code, notes, and snippets.

@kindohm
Created December 12, 2025 03:15
Show Gist options
  • Select an option

  • Save kindohm/351da961bb0ff9e00da5ac5c0dd0dcb4 to your computer and use it in GitHub Desktop.

Select an option

Save kindohm/351da961bb0ff9e00da5ac5c0dd0dcb4 to your computer and use it in GitHub Desktop.
MIke's superdirt bootup
(
// you should be able to eval this ENTIRE file in one
// Command+Enter key combination.
SuperDirt.postBadValues = false;
s.options.device_("BlackHole 16ch");
// these settings increase memory to load more samples
s.options.numBuffers = 1024 * 16;
s.options.memSize = 8192 * 16;
s.options.maxNodes = 1024 * 64;
// I/O
s.options.numOutputBusChannels = 2;
s.options.numInputBusChannels = 0;
s.waitForBoot {
~dirt = SuperDirt(2, s);
s.sync;
~dirt.start(57120, 0);
// uncomment to load samples:
// ~dirt.loadSoundFiles("/Users/kindohm/studio/baldino-remix/daw/tidal/*");
// ~dirt.loadSoundFiles;
// MIDI STUFF
// you can always evaluate this single line by itself at
// any time to get the strings/names of the MIDI devices
MIDIClient.init;
">>>> loading MIDI devices".postln;
MIDIClient.sources.do({ arg item, i;
"πŸ€” ".catArgs(item.device).catArgs(" ").catArgs(item.name).postln;
if (item.name == "Bus 1", {
~harmorOut = MIDIOut.newByName("IAC Driver", "Bus 1");
~harmorOut.latency = 0;
~dirt.soundLibrary.addMIDI(\harmor, ~harmorOut);
"😍 added harmor".postln;
});
if (item.name == "Bus 2", {
~harmor2Out = MIDIOut.newByName("IAC Driver", "Bus 2");
~harmor2Out.latency = 0;
~dirt.soundLibrary.addMIDI(\harmor2, ~harmor2Out);
"😍 added harmor2".postln;
});
if (item.name == "Bus 3", {
~harmor3Out = MIDIOut.newByName("IAC Driver", "Bus 3");
~harmor3Out.latency = 0;
~dirt.soundLibrary.addMIDI(\harmor3, ~harmor3Out);
"😍 added harmor3".postln;
});
if (item.device == "MIDI 1U", {
~modOut = MIDIOut.newByName("MIDI 1U", "MIDI 1U");
~modOut.latency = 0;
~dirt.soundLibrary.addMIDI(\mod, ~modOut);
"😍 added modular".postln;
});
if (item.device == "Elektron Analog Rytm MKII", {
~rytmOut = MIDIOut.newByName("Elektron Analog Rytm MKII", "Elektron Analog Rytm MKII");
~rytmOut.latency = 0;
~dirt.soundLibrary.addMIDI(\rytm, ~rytmOut);
"😍 added RYTM".postln;
});
if (item.device == "Elektron Syntakt", {
~synOut = MIDIOut.newByName("Elektron Syntakt", "Elektron Syntakt");
~synOut.latency = 0;
~dirt.soundLibrary.addMIDI(\syntakt, ~synOut);
"😍 added Syntakt".postln;
});
if (item.device == "Elektron Digitone II", {
~dtOut = MIDIOut.newByName("Elektron Digitone II", "Elektron Digitone II");
~dtOut.latency = 0;
~dirt.soundLibrary.addMIDI(\dt, ~dtOut);
"😍 added Digitone".postln;
});
// This block is for MIDI input from the MIDI Fighter controller.
// The ~osc / MIDIFunc stuff then routes the MIDI input _into Tidal_ code functions.
if (item.device == "Midi Fighter Twister 4", {
"attempting to connect to MIDI input to Midi Fighter Twister".postln;
"going for device at index".catArgs(" ").catArgs(1).catArgs(", ").catArgs("whatever it is:").postln;
MIDIClient.sources.at(i).device.catArgs(" ").catArgs(MIDIClient.sources.at(i).name).postln;
~osc = NetAddr.new("127.0.0.1", 6010);
MIDIIn.connect(inport: 0, device: i);
MIDIFunc.cc({ |val, num, chan, src|
// chan.postln;
if (chan == 0, {
"debug: ".catArgs(chan).catArgs(" ").catArgs(num).catArgs(" ").catArgs(val).postln;
~osc.sendMsg("/ctrl", num.asString, val/127);
});
});
"MIDI input attached".postln
});
});
"<<<< done loading MIDI devices".postln;
// This stuff here is for forwarding any OSC messages received
// to a different address/port/application.
// I use this for custom visuals in p5js or other apps.
"setting up OSC forwarding to 5150".postln;
~addr = NetAddr.new("127.0.0.1", 5150);
OSCFunc({ |msg, time, tidalAddr|
var latency = time - Main.elapsedTime;
msg = msg ++ ["time", time, "latency", latency];
// msg.postln;
~addr.sendBundle(latency, msg);
}, '/dirt/play').fix;
};
s.latency = 0;
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment