@@ -564,22 +564,23 @@ def note_on(self, data, timestamp, width=None, curve=True, mpe=None, octave=0, t
564
564
within_hardware_split = False
565
565
if width is None :
566
566
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
575
574
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
583
584
else :
584
585
width = self .board_w
585
586
# else: # 128
@@ -604,6 +605,8 @@ def note_on(self, data, timestamp, width=None, curve=True, mpe=None, octave=0, t
604
605
midinote += 32
605
606
if self .flipped :
606
607
midinote += 7
608
+ if within_hardware_split :
609
+ midinote += self .options .column_offset * left_width
607
610
visual_midinote = midinote
608
611
midinote += 12 * (octave + self .octave )
609
612
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,
739
742
within_hardware_split = False
740
743
if width is None :
741
744
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
750
752
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
758
762
else :
759
763
width = self .board_w
760
764
@@ -795,6 +799,7 @@ def note_off(self, data, timestamp, width=None, mpe=None, octave=0, transpose=0,
795
799
796
800
row = data [1 ] // width
797
801
col = data [1 ] % width
802
+ # print('xy', col, row)
798
803
# col_full = col + (left_width if within_hardware_split else 0)
799
804
# midinote = self.xy_to_midi(col, row)
800
805
# y = self.board_h - row - 1
@@ -806,12 +811,14 @@ def note_off(self, data, timestamp, width=None, mpe=None, octave=0, transpose=0,
806
811
midinote += 32
807
812
if self .flipped :
808
813
midinote += 7
814
+ if within_hardware_split :
815
+ midinote += self .options .column_offset * left_width
809
816
visual_midinote = midinote
810
817
midinote += 12 * (octave + self .octave )
811
818
midinote += self .options .column_offset * self .position .x
812
819
midinote += transpose + self .tonic
813
820
# print('off', x, y, midinote)
814
-
821
+
815
822
col_full = x + (left_width if within_hardware_split else 0 )
816
823
side = self .channel_from_split (col_full , y , force = True )
817
824
@@ -1411,8 +1418,14 @@ def __init__(self):
1411
1418
self .options .size = get_option (opts , "size" , DEFAULT_OPTIONS .size )
1412
1419
if self .options .size == 128 :
1413
1420
self .options .width = 16
1421
+ self .split_point = None
1414
1422
elif self .options .size == 200 :
1415
1423
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
1416
1429
hardware_split = True
1417
1430
1418
1431
# Note: The default below is what is determined by size above.
@@ -1826,13 +1839,15 @@ def split_rpn(self, on=True):
1826
1839
"""Sets up RPN for hardware split (used on LinnStrument 200)"""
1827
1840
if self .options .hardware_split :
1828
1841
self .rpn (200 , 1 if on else 0 ) # split active
1842
+ self .rpn (202 , self .split_point + 1 )
1829
1843
1830
1844
# lights
1831
1845
self .send_ls_cc (0 , 20 , 0 )
1832
1846
self .send_ls_cc (0 , 21 , 1 )
1833
1847
self .send_ls_cc (0 , 22 , 7 if on else 0 )
1834
1848
else :
1835
1849
self .rpn (200 , 0 )
1850
+ self .rpn (202 , self .split_point if self .split_point else 8 )
1836
1851
1837
1852
def rpn (self , num , value ):
1838
1853
if not self .linn_out :
0 commit comments