@@ -60,6 +60,31 @@ def rotate_mode(self, notes: str, mode: int):
60
60
mode -= 1
61
61
return notes
62
62
63
+ def prev_bank (self ):
64
+ return self .next_bank (- 1 )
65
+
66
+ def next_bank (self , ofs = 1 ):
67
+ if not self .midi_out :
68
+ return False
69
+ self .bank = max (0 , min (127 , self .bank + ofs ))
70
+ msb = (self .bank >> 7 ) & 0x7f
71
+ lsb = self .bank & 0x7f
72
+ self .midi_out .send_cc (0 , 0 , msb )
73
+ self .midi_out .send_cc (0 , 32 , lsb )
74
+ print ('Bank Select: ' , self .bank )
75
+ return True
76
+
77
+ def prev_program (self ):
78
+ return self .next_program (- 1 )
79
+
80
+ def next_program (self , ofs = 1 ):
81
+ if not self .midi_out :
82
+ return False
83
+ self .program = max (0 , min (127 , self .program + ofs ))
84
+ self .midi_write (self .midi_out , [0xc0 , self .program ], 0 )
85
+ print ('Program Change:' , self .program )
86
+ return True
87
+
63
88
def prev_mode (self , ofs = 1 ):
64
89
self .next_mode (- ofs )
65
90
@@ -1110,6 +1135,9 @@ def cb_launchpad_in(self, lp, event, timestamp=0):
1110
1135
self .note_off ([128 , note , event [2 ]], timestamp , width = 8 , transpose = lp .transpose , octave = lp .get_octave (), force_channel = self .options .launchpad_channel )
1111
1136
else :
1112
1137
self .macro (x , 8 - y - 1 , False )
1138
+ else :
1139
+ # Launchpad X buttons
1140
+ lp .button (x , 8 - y - 1 )
1113
1141
else : # note on
1114
1142
x = event [0 ]
1115
1143
y = 8 - event [1 ]
@@ -1120,9 +1148,6 @@ def cb_launchpad_in(self, lp, event, timestamp=0):
1120
1148
self .note_on ([144 , note , event [2 ]], timestamp , width = 8 , transpose = lp .transpose , octave = lp .get_octave (), force_channel = self .options .launchpad_channel )
1121
1149
else :
1122
1150
self .macro (x , 8 - y - 1 , True )
1123
- else :
1124
- # Launchpad X buttons
1125
- lp .button (x , 8 - y - 1 )
1126
1151
1127
1152
# uses raw events (Launchpad X)
1128
1153
# def cb_launchpad_in(self, event, timestamp=0):
@@ -1470,6 +1495,9 @@ def __init__(self):
1470
1495
self .scale_notes = self .scale_db [self .scale_index ]['notes' ]
1471
1496
self .scale_root = 0
1472
1497
self .tonic = 0
1498
+
1499
+ self .program = 0
1500
+ self .bank = 0
1473
1501
1474
1502
self .articulation = Articulation (self )
1475
1503
0 commit comments