diff options
author | David Runge <dave@sleepmap.de> | 2019-03-04 21:50:39 +0100 |
---|---|---|
committer | David Runge <dave@sleepmap.de> | 2019-03-04 21:50:39 +0100 |
commit | 042440072266fdc0c3c8e3d202ef9cefe7d21ca8 (patch) | |
tree | a8dcfbab915f4e4e4fb55387fe63231a7d4bb07d | |
parent | c1e5d08d58034c8b53d4789dd32983016f4a5456 (diff) | |
download | dotfiles-042440072266fdc0c3c8e3d202ef9cefe7d21ca8.tar.gz dotfiles-042440072266fdc0c3c8e3d202ef9cefe7d21ca8.tar.bz2 dotfiles-042440072266fdc0c3c8e3d202ef9cefe7d21ca8.tar.xz dotfiles-042440072266fdc0c3c8e3d202ef9cefe7d21ca8.zip |
.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.
-rw-r--r-- | .config/SuperCollider/functions.scd | 22 |
1 files changed, 21 insertions, 1 deletions
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 + ); +}; |