@@ -122,7 +122,10 @@ def send_ls_cc(self, channel, cc, val):
122
122
def send_all_notes_off (self ):
123
123
if not self .midi_out :
124
124
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 )
126
129
127
130
def set_light (self , x , y , col , index = None , mark = False ): # col is [1,11], 0 resets
128
131
"""Set light to color `col` at x, y if in range and connected"""
@@ -933,6 +936,8 @@ def cb_visualizer(self, data, timestamp):
933
936
self .mark (data [1 ] + self .vis_octave * 12 , 1 , True )
934
937
elif msg == 8 : # note off
935
938
self .mark (data [1 ] + self .vis_octave * 12 , 0 , True )
939
+ # else:
940
+ # print(msg, data)
936
941
937
942
def cb_foot (self , data , timestamp ):
938
943
"""Foot controller MIDI Callback"""
@@ -1818,7 +1823,9 @@ def clear_marks(self, use_lights=False):
1818
1823
# else:
1819
1824
self .reset_light (x , y )
1820
1825
y += 1
1821
- self .dirty = self .dirty_lights = True
1826
+ self .dirty = True
1827
+ if use_lights :
1828
+ self .dirty_lights = True
1822
1829
1823
1830
def mark_xy (self , x , y , state , use_lights = False ):
1824
1831
if self .flipped :
@@ -1927,6 +1934,9 @@ def logic(self, dt):
1927
1934
elif ev .type == pygame .KEYDOWN :
1928
1935
if ev .key == pygame .K_ESCAPE :
1929
1936
self .quit ()
1937
+ elif ev .key == pygame .K_F1 :
1938
+ self .clear_marks (use_lights = True )
1939
+ self .send_all_notes_off ()
1930
1940
else :
1931
1941
try :
1932
1942
n = self .keys [ev .key ]
@@ -2011,9 +2021,11 @@ def logic(self, dt):
2011
2021
else :
2012
2022
self .transpose -= 3
2013
2023
self .rotated = True
2024
+ self .dirty = self .dirty_lights = True
2014
2025
self .clear_marks (use_lights = False )
2015
2026
elif ev .ui_element == self .btn_flip :
2016
2027
self .flipped = not self .flipped
2028
+ self .dirty = self .dirty_lights = True
2017
2029
self .clear_marks (use_lights = False )
2018
2030
elif ev .ui_element == self .btn_split :
2019
2031
if self .split_out :
0 commit comments