diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-03-17 21:54:57 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-03-17 21:54:57 +0100 |
commit | f0797fc579dab6edc62968c965733a894b6411c2 (patch) | |
tree | 307ce2b77fa802e0cd2e3bbfb6e452fca07c626b /examples | |
parent | ... (diff) | |
download | blueshift-f0797fc579dab6edc62968c965733a894b6411c2.tar.gz blueshift-f0797fc579dab6edc62968c965733a894b6411c2.tar.bz2 blueshift-f0797fc579dab6edc62968c965733a894b6411c2.tar.xz |
m + _clip
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/lisp-esque | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/examples/lisp-esque b/examples/lisp-esque index c419746..8686bb4 100644 --- a/examples/lisp-esque +++ b/examples/lisp-esque @@ -646,8 +646,17 @@ def _clip(mods, args): monitor (or all of them) on whether to clip the curve, 'yes' implied for all monitors if empty ''' + red = 'red' in mods + green = 'green' in mods + blue = 'blue' in mods args = evaluate_tree(args, True) - pass + if len(args) == 0: + args = ['yes'] + args = [[arg, arg, arg] if isinstance(arg, str) else arg for arg in args] + args = [[a == 'yes' for a in arg] for arg in args] + if red or green or blue: + args = [[arg[0] and red, arg[1] and green, arg[2] and blue] for arg in args] + adjustments.append(lambda monitor : clip(*(args[monitor % len(args)]))) def _sigmoid(mods, args): @@ -704,6 +713,8 @@ def _linearise(mods, args): green = 'green' in mods blue = 'blue' in mods args = evaluate_tree(args, True) + if len(args) == 0: + args = ['yes'] args = [[arg, arg, arg] if isinstance(arg, str) else arg for arg in args] args = [[a == 'yes' for a in arg] for arg in args] if red or green or blue: @@ -760,6 +771,8 @@ def _standardise(mods, args): green = 'green' in mods blue = 'blue' in mods args = evaluate_tree(args, True) + if len(args) == 0: + args = ['yes'] args = [[arg, arg, arg] if isinstance(arg, str) else arg for arg in args] args = [[a == 'yes' for a in arg] for arg in args] if red or green or blue: |