@@ -153,6 +153,13 @@ def send_all_notes_off(self):
153
153
self .midi_write (self .midi_out , [0xb0 | ch , 120 , 0 ], 0 )
154
154
self .midi_write (self .midi_out , [0xb0 | ch , 123 , 0 ], 0 )
155
155
156
+ def ls_color (self , x , y , col ):
157
+ """Set LinnStrument pad color"""
158
+ if self .linn_out :
159
+ self .send_ls_cc (0 , 20 , x + 1 )
160
+ self .send_ls_cc (0 , 21 , self .board_h - y - 1 )
161
+ self .send_ls_cc (0 , 22 , col )
162
+
156
163
def set_light (self , x , y , col , index = None , mark = False ): # col is [1,11], 0 resets
157
164
"""Set light to color `col` at x, y if in range and connected"""
158
165
if y < 0 or y >= self .board_h :
@@ -164,10 +171,8 @@ def set_light(self, x, y, col, index=None, mark=False): # col is [1,11], 0 rese
164
171
index = self .get_note_index (x , y , transpose = False )
165
172
166
173
self .mark_lights [y ][x ] = mark
167
- if self .linn_out :
168
- self .send_ls_cc (0 , 20 , x + 1 )
169
- self .send_ls_cc (0 , 21 , self .board_h - y - 1 )
170
- self .send_ls_cc (0 , 22 , col )
174
+
175
+ self .ls_color (x , y , col )
171
176
172
177
if index is not None :
173
178
for lp in self .launchpads :
@@ -1753,15 +1758,15 @@ def __init__(self):
1753
1758
num_launchpads = 0
1754
1759
if self .options .launchpad :
1755
1760
launchpads = []
1756
- lp = launchpad .LaunchpadPro ()
1761
+ lp = launchpad .LaunchpadProMk3 ()
1757
1762
if lp .Check (0 ):
1758
1763
if lp .Open (0 ):
1759
- self .launchpads += [Launchpad (self , lp , "pro " , num_launchpads )]
1764
+ self .launchpads += [Launchpad (self , lp , "promk3 " , num_launchpads )]
1760
1765
num_launchpads += 1
1761
- lp = launchpad .LaunchpadProMk3 ()
1766
+ lp = launchpad .LaunchpadPro ()
1762
1767
if lp .Check (0 ):
1763
1768
if lp .Open (0 ):
1764
- self .launchpads += [Launchpad (self , lp , "promk3 " , num_launchpads )]
1769
+ self .launchpads += [Launchpad (self , lp , "pro " , num_launchpads )]
1765
1770
num_launchpads += 1
1766
1771
lp = launchpad .LaunchpadLPX ()
1767
1772
if lp .Check (1 ):
@@ -2026,7 +2031,7 @@ def mark(self, midinote, state, use_lights=False, only_row=None):
2026
2031
octave = self .get_octave (x , y )
2027
2032
if octave == midinote // 12 :
2028
2033
# print(octave)
2029
- self .board [y + self .flipped ][x ] = state
2034
+ self .board [y + self .flipped ][x + self . position . x ] = state
2030
2035
if use_lights :
2031
2036
if state :
2032
2037
self .set_light (x , y , self .options .mark_light , mark = True )
0 commit comments