From 042440072266fdc0c3c8e3d202ef9cefe7d21ca8 Mon Sep 17 00:00:00 2001 From: David Runge Date: Mon, 4 Mar 2019 21:50:39 +0100 Subject: .config/SuperCollider/functions.scd: Setting default gain of SSR sources to 1.0 (because usually one uses something else to mix). Adding helper function to bind eight control channels of a MIDI device to a given ZZZES3 instance, to set clocks. --- .config/SuperCollider/functions.scd | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/.config/SuperCollider/functions.scd b/.config/SuperCollider/functions.scd index 3f27e31..d4dd058 100644 --- a/.config/SuperCollider/functions.scd +++ b/.config/SuperCollider/functions.scd @@ -105,7 +105,7 @@ postln('Loading custom functions.'); // adds a source to an SSR instance ~ssrAddSource = { arg ssr, name, model = "point", port, x = 0.0, y = 0.0, orientation = 0.0, - gain = 0.0, movability = $F, orientationMovability = $F, mute = $F; + gain = 1.0, movability = $F, orientationMovability = $F, mute = $F; if (ssr.isKindOf(NetAddr), { if (name.isString, { if (model.isString, { @@ -170,3 +170,23 @@ postln('Loading custom functions.'); error('Argument key must be of type Symbol: '++key.class); }); }; + +// setting clock of ZZZES3 to bpm (in given range) +~midiControlToClockBPM = { + arg key, msgNum, chan, uid, zzz, range; + MIDIdef.new( + key, + { + arg ...args; + var bpm = args[0].linexp(0, 127, range[0], range[1]).asInteger; + zzz.setClock( + msgNum.indexOf(args[1].asInteger)+1, + bpm/60 + ); + }, + msgNum, + chan, + \control, + uid + ); +}; -- cgit v1.2.3-54-g00ecf