diff --git a/light9/effect/sequencer/eval_faders.py b/light9/effect/sequencer/eval_faders.py --- a/light9/effect/sequencer/eval_faders.py +++ b/light9/effect/sequencer/eval_faders.py @@ -38,23 +38,13 @@ class FaderEval: self.graph = graph self.faders: List[Fader] = [] - # self.simpleOutputs = SimpleOutputs(self.graph) log.info('fader adds handler') self.graph.addHandler(self._compile) self.lastLoopSucceeded = False - # self.codeWatcher = CodeWatcher(onChange=self.onCodeChange) - # have caller do this - #asyncio.create_task(self.startUpdating()) - - # async def startUpdating(self): - # await self.graph.addAsyncHandler(self.update) - # log.info('startupdating task done') - def onCodeChange(self): log.debug('seq.onCodeChange') self.graph.addHandler(self._compile) - #self.updateLoop() @metrics('compile_graph_fader').time() def _compile(self) -> None: @@ -68,17 +58,21 @@ class FaderEval: # this could go in a second, smaller addHandler call to avoid rebuilding Fader objs constantly for f in self.faders: - f.value = typedValue(float, self.graph, f.uri, L9['value']) + setting = typedValue(Node, self.graph, f.uri, L9['setting']) + f.value = typedValue(float, self.graph, setting, L9['value']) def computeOutput(self) -> DeviceSettings: - notesSettings:List[DeviceSettings] = [] + faderEffectOutputs: List[DeviceSettings] = [] now = UnixTime(time.time()) for f in self.faders: if f.value is None: raise TypeError('f.value should be set by now') effectSettings = EffectSettings(self.graph, [(f.effect, f.setEffectAttr, f.value)]) - notesSettings.append(f.ee.compute(effectSettings)) + if f.value < .001: + continue + + faderEffectOutputs.append(f.ee.compute(effectSettings)) # ee = effecteval.EffectEval(self.graph, f.effectClass, self.simpleOutputs) # deviceSettings, report = ee.outputFromEffect( @@ -89,4 +83,4 @@ class FaderEval: # log.info(f' 𝅘𝅥𝅮 {uriTail(f.uri)}: {effectSettings=} -> {deviceSettings=}') # if deviceSettings: # notesSettings.append(deviceSettings) - return DeviceSettings.merge(self.graph, notesSettings) + return DeviceSettings.merge(self.graph, faderEffectOutputs)