@@ -194,12 +194,16 @@ def set_mark_light(self, x, y, state=True):
194
194
195
195
def set_launchpad_light (self , x , y , color ):
196
196
"""Set launchpad light to color index"""
197
- if color is not None :
198
- col = self .options .colors [color ] / 4
199
- else :
200
- col = glm .ivec3 (0 ,0 ,0 )
201
197
if self .is_macro_button (x , 8 - y - 1 ):
202
198
col = glm .ivec3 (63 ,63 ,63 )
199
+ else :
200
+ if color != - 1 : # not mark
201
+ if color is not None and self .scale_notes [color ] != '.' :
202
+ col = self .options .colors [color ] / 4
203
+ else :
204
+ col = glm .ivec3 (0 ,0 ,0 )
205
+ else :
206
+ col = self .options .mark_color / 4
203
207
self .launchpad .LedCtrlXY (x , 8 - y , col [0 ], col [1 ], col [2 ])
204
208
205
209
def setup_lights (self ):
@@ -444,6 +448,10 @@ def init_board(self):
444
448
445
449
def midi_write (self , dev , msg , ts = 0 ):
446
450
"""Write MIDI message `msg` to device `dev`"""
451
+ # if type(dev) in (list,tuple):
452
+ # for d in dev:
453
+ # self.midi_write(d, msg, ts)
454
+ # return
447
455
if dev :
448
456
dev .send_raw (* msg )
449
457
@@ -931,7 +939,7 @@ def cb_launchpad_in(self, event, timestamp=0):
931
939
y = 8 - event [1 ]
932
940
if 0 <= x < 8 and 0 <= y < 8 :
933
941
note = y * 8 + x
934
- self .set_launchpad_light (x , y , 0 ) # red
942
+ self .set_launchpad_light (x , y , - 1 )
935
943
if not self .is_macro_button (x , 8 - y - 1 ):
936
944
self .note_on ([144 , note , event [2 ]], timestamp , width = 8 , force_channel = self .options .launchpad_channel )
937
945
else :
@@ -1086,7 +1094,7 @@ def __init__(self):
1086
1094
self .options .colors = list (self .options .colors .split ("," ))
1087
1095
self .options .colors = list (map (lambda x : glm .ivec3 (get_color (x )), self .options .colors ))
1088
1096
1089
- self .options .split_colors = get_option (opts , "colors " , DEFAULT_OPTIONS .split_colors )
1097
+ self .options .split_colors = get_option (opts , "split_colors " , DEFAULT_OPTIONS .split_colors )
1090
1098
self .options .split_colors = list (self .options .split_colors .split ("," ))
1091
1099
self .options .split_colors = list (map (lambda x : glm .ivec3 (get_color (x )), self .options .split_colors ))
1092
1100
@@ -1160,6 +1168,11 @@ def __init__(self):
1160
1168
self .options .show_lowest_note = get_option (
1161
1169
opts , "show_lowest_note" , DEFAULT_OPTIONS .show_lowest_note
1162
1170
)
1171
+
1172
+ self .options .y_bend = get_option (
1173
+ opts , "y_bend" , DEFAULT_OPTIONS .y_bend
1174
+ )
1175
+
1163
1176
# self.options.mpe = get_option(
1164
1177
# opts, "mpe", DEFAULT_OPTIONS.mpe
1165
1178
# ) or get_option(
@@ -1177,9 +1190,9 @@ def __init__(self):
1177
1190
opts , "split" , DEFAULT_OPTIONS .split
1178
1191
)
1179
1192
self .options .foot_in = get_option (opts , "foot_in" , DEFAULT_OPTIONS .foot_in )
1180
- self .options .sustain = get_option (
1181
- opts , "sustain" , DEFAULT_OPTIONS .sustain
1182
- ) # sustain scale
1193
+ # self.options.sustain = get_option(
1194
+ # opts, "sustain", DEFAULT_OPTIONS.sustain
1195
+ # )
1183
1196
1184
1197
# which split the sustain affects
1185
1198
self .options .sustain_split = get_option (
@@ -1529,14 +1542,22 @@ def __init__(self):
1529
1542
lp = launchpad .LaunchpadLPX ()
1530
1543
if lp .Open (1 ):
1531
1544
self .launchpad_mode = "lpx"
1532
- lp .LedCtrlXY (0 , 0 , 0 , 0 , 63 )
1533
- lp .LedCtrlXY (1 , 0 , 0 , 0 , 63 )
1534
- lp .LedCtrlXY (2 , 0 , 63 , 0 , 63 )
1535
- lp .LedCtrlXY (3 , 0 , 63 , 0 , 63 )
1536
1545
if self .launchpad_mode is not None :
1537
1546
self .launchpad = lp
1538
1547
1539
1548
self .done = False
1549
+
1550
+ if self .launchpad_mode == "lpx" :
1551
+ lp .LedCtrlXY (0 , 0 , 0 , 0 , 63 )
1552
+ lp .LedCtrlXY (1 , 0 , 0 , 0 , 63 )
1553
+ lp .LedCtrlXY (2 , 0 , 63 , 0 , 63 )
1554
+ lp .LedCtrlXY (3 , 0 , 63 , 0 , 63 )
1555
+
1556
+ # if self.launchpad:
1557
+ # # use the alternate colors
1558
+ # self.options.colors = get_option(opts, "colors", DEFAULT_OPTIONS.colors_alt)
1559
+ # self.options.colors = list(self.options.colors.split(","))
1560
+ # self.options.colors = list(map(lambda x: glm.ivec3(get_color(x)), self.options.colors))
1540
1561
1541
1562
if not self .midi_out :
1542
1563
error (
0 commit comments