aboutsummaryrefslogtreecommitdiffstats
path: root/.config/SuperCollider
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2019-03-04 21:50:39 +0100
committerDavid Runge <dave@sleepmap.de>2019-03-04 21:50:39 +0100
commit042440072266fdc0c3c8e3d202ef9cefe7d21ca8 (patch)
treea8dcfbab915f4e4e4fb55387fe63231a7d4bb07d /.config/SuperCollider
parentc1e5d08d58034c8b53d4789dd32983016f4a5456 (diff)
downloaddotfiles-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.
Diffstat (limited to '.config/SuperCollider')
-rw-r--r--.config/SuperCollider/functions.scd22
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
+ );
+};