Skip to content

Instantly share code, notes, and snippets.

@AvneeshSarwate
Created October 19, 2020 06:00
Show Gist options
  • Save AvneeshSarwate/b0651d4d55e803f1cb613436b6c1e6b1 to your computer and use it in GitHub Desktop.
Save AvneeshSarwate/b0651d4d55e803f1cb613436b6c1e6b1 to your computer and use it in GitHub Desktop.
(
var clock, midiOut, midiNote, bpm;
MIDIClient.init;
MIDIClient.destinations.postln;
//define these however you like
midiNote = 60;
bpm = 20;
midiOut = MIDIOut.newByName("IAC Driver", "Bus 1");
clock = TempoClock(bpm);
midiOut.latency = 0;
clock.sched(1, {
Task({
midiOut.noteOn(0, midiNote);
0.001.wait;
midiOut.noteOff(0, midiNote);
}).play;
1
});
)
/*
Test instructions:
- Set up an Ableton drum rack with a single drum sample on
the midi note specified in line 9.
- On line 11, select the virtual MIDI device/port name that
you'll use to communicate with Ableton
- Click into the outermost parenthesis and hit CTRL-Enter to run the script
(Might have to double check the hot-key to Evaluate the file
- Go to Langage > Reboot Interpreter to stop the file
- Test with BPMs in the 100-400 range - should get pretty clean tones
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment