@@ -122,7 +122,10 @@ def send_ls_cc(self, channel, cc, val):
122122 def send_all_notes_off (self ):
123123 if not self .midi_out :
124124 return
125- self .midi_write (self .midi_out , [0xb0 , 123 , 0 ], 0 )
125+ # for ch in range(0,15):
126+ ch = 0
127+ self .midi_write (self .midi_out , [0xb0 | ch , 120 , 0 ], 0 )
128+ self .midi_write (self .midi_out , [0xb0 | ch , 123 , 0 ], 0 )
126129
127130 def set_light (self , x , y , col , index = None , mark = False ): # col is [1,11], 0 resets
128131 """Set light to color `col` at x, y if in range and connected"""
@@ -933,6 +936,8 @@ def cb_visualizer(self, data, timestamp):
933936 self .mark (data [1 ] + self .vis_octave * 12 , 1 , True )
934937 elif msg == 8 : # note off
935938 self .mark (data [1 ] + self .vis_octave * 12 , 0 , True )
939+ # else:
940+ # print(msg, data)
936941
937942 def cb_foot (self , data , timestamp ):
938943 """Foot controller MIDI Callback"""
@@ -1818,7 +1823,9 @@ def clear_marks(self, use_lights=False):
18181823 # else:
18191824 self .reset_light (x , y )
18201825 y += 1
1821- self .dirty = self .dirty_lights = True
1826+ self .dirty = True
1827+ if use_lights :
1828+ self .dirty_lights = True
18221829
18231830 def mark_xy (self , x , y , state , use_lights = False ):
18241831 if self .flipped :
@@ -1927,6 +1934,9 @@ def logic(self, dt):
19271934 elif ev .type == pygame .KEYDOWN :
19281935 if ev .key == pygame .K_ESCAPE :
19291936 self .quit ()
1937+ elif ev .key == pygame .K_F1 :
1938+ self .clear_marks (use_lights = True )
1939+ self .send_all_notes_off ()
19301940 else :
19311941 try :
19321942 n = self .keys [ev .key ]
@@ -2011,9 +2021,11 @@ def logic(self, dt):
20112021 else :
20122022 self .transpose -= 3
20132023 self .rotated = True
2024+ self .dirty = self .dirty_lights = True
20142025 self .clear_marks (use_lights = False )
20152026 elif ev .ui_element == self .btn_flip :
20162027 self .flipped = not self .flipped
2028+ self .dirty = self .dirty_lights = True
20172029 self .clear_marks (use_lights = False )
20182030 elif ev .ui_element == self .btn_split :
20192031 if self .split_out :
0 commit comments