@@ -564,22 +564,23 @@ def note_on(self, data, timestamp, width=None, curve=True, mpe=None, octave=0, t
564564 within_hardware_split = False
565565 if width is None :
566566 if self .options .hardware_split :
567- if self .board_w == 25 : # 200
568- left_width = 11
569- right_width = 14
570- if ch >= 8 :
571- width = right_width
572- within_hardware_split = True
573- else :
574- width = left_width
567+ # if self.board_w == 25: # 200
568+ left_width = self .split_point
569+ right_width = self .board_w - left_width
570+ # print('hardware splits', left_width, right_width)
571+ if ch >= 8 :
572+ width = right_width
573+ within_hardware_split = True
575574 else :
576- left_width = 8
577- right_width = 8
578- if ch >= 8 :
579- width = right_width
580- within_hardware_split = True
581- else :
582- width = left_width
575+ width = left_width
576+ # else:
577+ # left_width = 8
578+ # right_width = 8
579+ # if ch >= 8:
580+ # width = right_width
581+ # within_hardware_split = True
582+ # else:
583+ # width = left_width
583584 else :
584585 width = self .board_w
585586 # else: # 128
@@ -604,6 +605,8 @@ def note_on(self, data, timestamp, width=None, curve=True, mpe=None, octave=0, t
604605 midinote += 32
605606 if self .flipped :
606607 midinote += 7
608+ if within_hardware_split :
609+ midinote += self .options .column_offset * left_width
607610 visual_midinote = midinote
608611 midinote += 12 * (octave + self .octave )
609612 midinote += self .options .column_offset * self .position .x
@@ -739,22 +742,23 @@ def note_off(self, data, timestamp, width=None, mpe=None, octave=0, transpose=0,
739742 within_hardware_split = False
740743 if width is None :
741744 if self .options .hardware_split :
742- if self .board_w == 25 : # 200
743- left_width = 11
744- right_width = 14
745- if ch >= 8 :
746- width = right_width
747- within_hardware_split = True
748- else :
749- width = left_width
745+ # if self.board_w == 25: # 200
746+ left_width = self .split_point
747+ right_width = self .board_w - left_width
748+ # print('hardware splits', left_width, right_width)
749+ if ch >= 8 :
750+ width = right_width
751+ within_hardware_split = True
750752 else :
751- left_width = 8
752- right_width = 8
753- if ch >= 8 :
754- width = right_width
755- within_hardware_split = True
756- else :
757- width = left_width
753+ width = left_width
754+ # else:
755+ # left_width = 8
756+ # right_width = 8
757+ # if ch >= 8:
758+ # width = right_width
759+ # within_hardware_split = True
760+ # else:
761+ # width = left_width
758762 else :
759763 width = self .board_w
760764
@@ -795,6 +799,7 @@ def note_off(self, data, timestamp, width=None, mpe=None, octave=0, transpose=0,
795799
796800 row = data [1 ] // width
797801 col = data [1 ] % width
802+ # print('xy', col, row)
798803 # col_full = col + (left_width if within_hardware_split else 0)
799804 # midinote = self.xy_to_midi(col, row)
800805 # y = self.board_h - row - 1
@@ -806,12 +811,14 @@ def note_off(self, data, timestamp, width=None, mpe=None, octave=0, transpose=0,
806811 midinote += 32
807812 if self .flipped :
808813 midinote += 7
814+ if within_hardware_split :
815+ midinote += self .options .column_offset * left_width
809816 visual_midinote = midinote
810817 midinote += 12 * (octave + self .octave )
811818 midinote += self .options .column_offset * self .position .x
812819 midinote += transpose + self .tonic
813820 # print('off', x, y, midinote)
814-
821+
815822 col_full = x + (left_width if within_hardware_split else 0 )
816823 side = self .channel_from_split (col_full , y , force = True )
817824
@@ -1411,8 +1418,14 @@ def __init__(self):
14111418 self .options .size = get_option (opts , "size" , DEFAULT_OPTIONS .size )
14121419 if self .options .size == 128 :
14131420 self .options .width = 16
1421+ self .split_point = None
14141422 elif self .options .size == 200 :
14151423 self .options .width = 25
1424+ self .split_point = 11
1425+ hardware_split = True
1426+ elif self .options .size < 0 : # test hardware split
1427+ self .options .width = 16
1428+ self .split_point = - self .options .size
14161429 hardware_split = True
14171430
14181431 # Note: The default below is what is determined by size above.
@@ -1826,13 +1839,15 @@ def split_rpn(self, on=True):
18261839 """Sets up RPN for hardware split (used on LinnStrument 200)"""
18271840 if self .options .hardware_split :
18281841 self .rpn (200 , 1 if on else 0 ) # split active
1842+ self .rpn (202 , self .split_point + 1 )
18291843
18301844 # lights
18311845 self .send_ls_cc (0 , 20 , 0 )
18321846 self .send_ls_cc (0 , 21 , 1 )
18331847 self .send_ls_cc (0 , 22 , 7 if on else 0 )
18341848 else :
18351849 self .rpn (200 , 0 )
1850+ self .rpn (202 , self .split_point if self .split_point else 8 )
18361851
18371852 def rpn (self , num , value ):
18381853 if not self .linn_out :
0 commit comments