From ca9d41147d1a0672e520c1d43c904d62cf3803d8 Mon Sep 17 00:00:00 2001 From: David Runge Date: Thu, 30 Jun 2016 12:57:19 +0200 Subject: BowelyzerConfig.sc: Extending the controls by an \active flag, indicating whether the input is supposed to be running when initialized. Adding hasToBeBool check and extenting getControlValue by it. Adding TODO for writeConfigurationFile. Removing useless comments. Cleaning up comments. --- BowelyzerConfig.sc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/BowelyzerConfig.sc b/BowelyzerConfig.sc index 70672c9..7a45148 100644 --- a/BowelyzerConfig.sc +++ b/BowelyzerConfig.sc @@ -57,14 +57,14 @@ BowelyzerConfig{ \sendReplyFreq ]; + const true, \amplitudeAttackTime -> 0.01, \amplitudeReleaseTime -> 0.1, \hfHainsworth -> 1.0, @@ -223,6 +225,8 @@ BowelyzerConfig{ }); } + //TODO: add writeConfigurationFile + // return a control value as correct type and within its defined ControlSpec range getControlValue{ arg control, value; @@ -233,6 +237,14 @@ BowelyzerConfig{ if(hasToBeInteger.includes(control.asSymbol),{ ^control.asSymbol.asSpec.constrain(value.asInteger).asInteger; }); + if(hasToBeBool.includes(control.asSymbol),{ + switch(value, + 0,{^false}, + 1,{^true}, + "true",{^true}, + "false",{^false} + ); + }); },{ ^nil; }); -- cgit v1.2.3-70-g09d2