From 30370f70eee27f7737bdcd16aa6d38c856f4d18c Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Tue, 4 Oct 2022 14:36:46 +0100 Subject: [PATCH] print bus level values in observer example --- examples/observer/__main__.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/examples/observer/__main__.py b/examples/observer/__main__.py index b9cb8ce..cf9caf5 100644 --- a/examples/observer/__main__.py +++ b/examples/observer/__main__.py @@ -18,14 +18,9 @@ class Observer: elif subject == "mdirty": print("mdirty!") elif subject == "ldirty": - info = ( - f"[{self.vm.bus[0]} {self.vm.bus[0].levels.isdirty}]", - f"[{self.vm.bus[1]} {self.vm.bus[1].levels.isdirty}]", - f"[{self.vm.bus[2]} {self.vm.bus[2].levels.isdirty}]", - f"[{self.vm.bus[3]} {self.vm.bus[3].levels.isdirty}]", - f"[{self.vm.bus[4]} {self.vm.bus[4].levels.isdirty}]", - ) - print(" ".join(info)) + for bus in self.vm.bus: + if bus.levels.isdirty: + print(bus, bus.levels.all) elif subject == "midi": current = self.vm.midi.current print(f"Value of midi button {current} is {self.vm.midi.get(current)}")