aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <dave@sleepmap.de>2016-06-30 13:00:59 +0200
committerDavid Runge <dave@sleepmap.de>2016-06-30 13:00:59 +0200
commit7e89ddf046689e5691e0479ad3690c04315c2407 (patch)
tree591f606eb3f2d4b00e24e719e7278de8153860c9
parent63955c90f2c16dffb3e59d9d3e37b58387154cbf (diff)
downloadbowelyzer-0.3.tar.gz
bowelyzer-0.3.tar.bz2
bowelyzer-0.3.tar.xz
bowelyzer-0.3.zip
Bowelyzer.sc: Simplifying calls to setupLevelListener. Adding comments. Adding config write upon using toggle functionality.0.3
-rw-r--r--Bowelyzer.sc19
1 files changed, 13 insertions, 6 deletions
diff --git a/Bowelyzer.sc b/Bowelyzer.sc
index 84ba4da..85a6edc 100644
--- a/Bowelyzer.sc
+++ b/Bowelyzer.sc
@@ -82,16 +82,17 @@ Bowelyzer{
}.play(AppClock);
// stop the listener for LevelIndicator by name and start a new one based upon the updated name
OSCdef(\levels_++name).free;
- this.setupLevelListener(update, NetAddr.new(config.config.at(\synthServerAddress), config.config.at(\synthServerPort)));
+ this.setupLevelListener(update, hub.synthServer);
// free the synth on the server and start a new one according to the config
analyzer.freeAnalysisSynth(name.asSymbol);
analyzer.synths.removeAt(name);
analyzer.addSynthWithName(update);
- //TODO: only start the Synth, if the channel toggle button is okay
+ // start the Synth (possibly paused)
Routine{
1.wait;
analyzer.startSynthWithNameAndControls(update.asSymbol, config.config.at(\controls).at(update), config.config.at(\inputs).at(update));
}.play;
+ // rename the hub listener for the Synth
hub.freeSynthListener(name);
hub.addSynthListener(update);
hub.startSynthListener(update);
@@ -117,11 +118,17 @@ Bowelyzer{
var name = msg[1],
toggle = msg[2];
postln("Received: "++msg);
- if(msg[1].notNil && msg[2].notNil && msg[2].isInteger,{
+ if(name.notNil && toggle.notNil && toggle.isInteger,{
if(config.config.at(\inputs).includesKey(name),{
switch(toggle,
- 0,{analyzer.startAnalysisSynth(name)},
- 1,{analyzer.stopAnalysisSynth(name)}
+ 0,{
+ config.config.at(\controls).at(name).put(\active, true);
+ analyzer.startAnalysisSynth(name);
+ },
+ 1,{
+ config.config.at(\controls).at(name).put(\active, false);
+ analyzer.stopAnalysisSynth(name);
+ }
);
});
});
@@ -136,7 +143,7 @@ Bowelyzer{
this.setupIndicatorListener;
// add and start a listener for each channel's LevelIndicator
config.config.at(\inputs).pairsDo({|key,value|
- this.setupLevelListener(key, NetAddr.new(config.config.at(\synthServerAddress), config.config.at(\synthServerPort)));
+ this.setupLevelListener(key, hub.synthServer);
});
}