ws: adopt nested {'0': {...}} payloads

midi: bind patterns to notes 36+; beat triggers selected pattern; include n index; CC map: 30=R 31=G 32=B 33=brightness 34=n1 35=n2 36=delay; send n1/n2 raw 0-127

gui: show n1 and n2 in status
This commit is contained in:
2025-09-17 20:22:11 +12:00
parent 1da2e30d4c
commit 8d0c9edf5d
3 changed files with 73 additions and 94 deletions

View File

@@ -60,9 +60,11 @@ class App:
self.lbl_g = ttk.Label(status_frame, text="G: -")
self.lbl_b = ttk.Label(status_frame, text="B: -")
self.lbl_pattern = ttk.Label(status_frame, text="Pattern: -")
self.lbl_n1 = ttk.Label(status_frame, text="n1: -")
self.lbl_n2 = ttk.Label(status_frame, text="n2: -")
self.lbl_bpm = ttk.Label(status_frame, text="BPM: -")
for w in (self.lbl_delay, self.lbl_brightness, self.lbl_r, self.lbl_g, self.lbl_b, self.lbl_pattern, self.lbl_bpm):
for w in (self.lbl_delay, self.lbl_brightness, self.lbl_r, self.lbl_g, self.lbl_b, self.lbl_pattern, self.lbl_n1, self.lbl_n2, self.lbl_bpm):
w.pack(anchor="w")
# schedule periodic UI updates
@@ -98,6 +100,8 @@ class App:
g = getattr(self.midi_handler, 'color_g', 0)
b = getattr(self.midi_handler, 'color_b', 0)
pattern = getattr(self.midi_handler, 'current_pattern', '') or '-'
n1 = getattr(self.midi_handler, 'n1', '-')
n2 = getattr(self.midi_handler, 'n2', '-')
bpm = getattr(self.midi_handler, 'current_bpm', None)
bpm_text = f"{bpm:.2f}" if isinstance(bpm, (float, int)) else "-"
@@ -107,6 +111,8 @@ class App:
self.lbl_g.config(text=f"G: {g}")
self.lbl_b.config(text=f"B: {b}")
self.lbl_pattern.config(text=f"Pattern: {pattern}")
self.lbl_n1.config(text=f"n1: {n1}")
self.lbl_n2.config(text=f"n2: {n2}")
self.lbl_bpm.config(text=f"BPM: {bpm_text}")
# reschedule