@@ -194,12 +194,16 @@ def set_mark_light(self, x, y, state=True):
194194
195195 def set_launchpad_light (self , x , y , color ):
196196 """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 )
201197 if self .is_macro_button (x , 8 - y - 1 ):
202198 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
203207 self .launchpad .LedCtrlXY (x , 8 - y , col [0 ], col [1 ], col [2 ])
204208
205209 def setup_lights (self ):
@@ -444,6 +448,10 @@ def init_board(self):
444448
445449 def midi_write (self , dev , msg , ts = 0 ):
446450 """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
447455 if dev :
448456 dev .send_raw (* msg )
449457
@@ -931,7 +939,7 @@ def cb_launchpad_in(self, event, timestamp=0):
931939 y = 8 - event [1 ]
932940 if 0 <= x < 8 and 0 <= y < 8 :
933941 note = y * 8 + x
934- self .set_launchpad_light (x , y , 0 ) # red
942+ self .set_launchpad_light (x , y , - 1 )
935943 if not self .is_macro_button (x , 8 - y - 1 ):
936944 self .note_on ([144 , note , event [2 ]], timestamp , width = 8 , force_channel = self .options .launchpad_channel )
937945 else :
@@ -1086,7 +1094,7 @@ def __init__(self):
10861094 self .options .colors = list (self .options .colors .split ("," ))
10871095 self .options .colors = list (map (lambda x : glm .ivec3 (get_color (x )), self .options .colors ))
10881096
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 )
10901098 self .options .split_colors = list (self .options .split_colors .split ("," ))
10911099 self .options .split_colors = list (map (lambda x : glm .ivec3 (get_color (x )), self .options .split_colors ))
10921100
@@ -1160,6 +1168,11 @@ def __init__(self):
11601168 self .options .show_lowest_note = get_option (
11611169 opts , "show_lowest_note" , DEFAULT_OPTIONS .show_lowest_note
11621170 )
1171+
1172+ self .options .y_bend = get_option (
1173+ opts , "y_bend" , DEFAULT_OPTIONS .y_bend
1174+ )
1175+
11631176 # self.options.mpe = get_option(
11641177 # opts, "mpe", DEFAULT_OPTIONS.mpe
11651178 # ) or get_option(
@@ -1177,9 +1190,9 @@ def __init__(self):
11771190 opts , "split" , DEFAULT_OPTIONS .split
11781191 )
11791192 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+ # )
11831196
11841197 # which split the sustain affects
11851198 self .options .sustain_split = get_option (
@@ -1529,14 +1542,22 @@ def __init__(self):
15291542 lp = launchpad .LaunchpadLPX ()
15301543 if lp .Open (1 ):
15311544 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 )
15361545 if self .launchpad_mode is not None :
15371546 self .launchpad = lp
15381547
15391548 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))
15401561
15411562 if not self .midi_out :
15421563 error (
0 commit comments