From e5cf15d7b0a98a97b194536f0882c57b4a67e1a4 Mon Sep 17 00:00:00 2001 From: jimmy Date: Fri, 19 Sep 2025 01:29:08 +1200 Subject: [PATCH] Fix rainbow pattern step range in lighting controller - Change step calculation from beat_index % 2 to beat_index % 256 - Provides full 0-255 step range for rainbow pattern color cycling - Fixes rainbow pattern that was limited to only 0 or 1 step values - Alternating phase patterns still use % 2 for proper phase offset --- src/midi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/midi.py b/src/midi.py index 09fd9bc..45a4f2f 100644 --- a/src/midi.py +++ b/src/midi.py @@ -152,7 +152,7 @@ class MidiHandler: "n1": self.n1, "n2": self.n2, "n3": self.n3, - "s": self.beat_index % 2, # Keep step small (0 or 1) for alternating patterns + "s": self.beat_index % 256, # Use full range for rainbow patterns } } @@ -233,7 +233,7 @@ class MidiHandler: "n2": self.n2, "n3": self.n3, "dl": self.delay, - "s": self.beat_index % 2, # Keep step small (0 or 1) for alternating patterns + "s": self.beat_index % 256, # Use full range for rainbow patterns }) # Add empty entries for each bar (they'll use defaults)