Skip to content

Commit 1a8d74c

Browse files
authored
Merge pull request #2 from rjsmith/linn-200
MPE MIDI CC bug fix and new QUIT button
2 parents b4f9e14 + f8da9dc commit 1a8d74c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/core.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,11 +1056,8 @@ def cb_midi_in(self, data, timestamp, force_channel=None):
10561056
# self.midi_write(self.split_out, data, timestamp)
10571057
# else:
10581058
# self.midi_write(self.midi_out, data, timestamp)
1059-
elif note and note.location is not None:
1060-
col = note.location.x
1061-
row = note.location.y
1062-
split_chan = self.channel_from_split(col, row)
1063-
if split_chan:
1059+
elif note and note.split is not None:
1060+
if note.split:
10641061
self.midi_write(self.split_out, data, timestamp)
10651062
else:
10661063
self.midi_write(self.midi_out, data, timestamp)
@@ -1641,6 +1638,11 @@ def __init__(self):
16411638
self.btn_sharps_flats = pygame_gui.elements.UIButton(
16421639
relative_rect=pygame.Rect((bs.x * 16 + 2, y), (bs.x, bs.y)),
16431640
text='#/b',
1641+
manager=self.gui
1642+
)
1643+
self.btn_quit = pygame_gui.elements.UIButton(
1644+
relative_rect=pygame.Rect((bs.x * 17 + 2, y), (bs.x, bs.y)),
1645+
text='QUIT',
16441646
manager=self.gui
16451647
)
16461648
# self.next_scale = pygame_gui.elements.UIButton(
@@ -2242,6 +2244,8 @@ def logic(self, dt):
22422244
self.prev_mode()
22432245
elif ev.ui_element == self.btn_sharps_flats:
22442246
self.toggle_sharps_flats()
2247+
elif ev.ui_element == self.btn_quit:
2248+
self.quit()
22452249
# elif ev.type == pygame_gui.UI_HORIZONTAL_SLIDER_MOVED:
22462250
# if ev.ui_element == self.slider_velocity:
22472251
# global self.options.velocity_curve

0 commit comments

Comments
 (0)