Skip to content

Commit 314f033

Browse files
committed
test 2
1 parent a0af416 commit 314f033

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

src/core.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,25 +1750,31 @@ def __init__(self):
17501750
self.foot_in.callback = self.cb_foot
17511751

17521752
self.launchpads = []
1753+
num_launchpads = 0
17531754
if self.options.launchpad:
17541755
launchpads = []
17551756
lp = launchpad.LaunchpadPro()
17561757
if lp.Check(0):
17571758
if lp.Open(0):
1758-
self.launchpads += [Launchpad(self, lp, "pro", 0)]
1759-
if launchpad.LaunchpadProMk3().Check(0):
1760-
lp = launchpad.LaunchpadProMk3()
1759+
self.launchpads += [Launchpad(self, lp, "pro", num_launchpads)]
1760+
num_launchpads += 1
1761+
lp = launchpad.LaunchpadProMk3()
1762+
if lp.Check(0):
17611763
if lp.Open(0):
1762-
self.launchpads += [Launchpad(self, lp, "promk3", 0)]
1763-
if launchpad.LaunchpadLPX().Check(1):
1764+
self.launchpads += [Launchpad(self, lp, "promk3", num_launchpads)]
1765+
num_launchpads += 1
1766+
lp = launchpad.LaunchpadLPX()
1767+
if lp.Check(1):
17641768
lp = launchpad.LaunchpadLPX()
17651769
if lp.Open(1):
1766-
self.launchpads += [Launchpad(self, lp, "lpx", 0)]
1770+
self.launchpads += [Launchpad(self, lp, "lpx", num_launchpads)]
1771+
num_launchpads += 1
17671772
if launchpad.LaunchpadLPX().Check(3):
17681773
lp = launchpad.LaunchpadLPX()
17691774
if lp.Open(3): # second
1770-
self.launchpads += [Launchpad(self, lp, "lpx", 1, self.options.octave_separation)]
1771-
1775+
self.launchpads += [Launchpad(self, lp, "lpx", num_launchpads, self.options.octave_separation)]
1776+
num_launchpads += 1
1777+
17721778
if self.launchpads:
17731779
print('Launchpads:', len(self.launchpads))
17741780

src/launchpad.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,71 +9,73 @@ def __init__(self, core, out, mode, index=0, octave_separation=0):
99
self.index = index
1010
self.octave_separation = octave_separation
1111

12+
print("Launchpad", mode, 'Connected! (#' + str(index) + ")")
13+
1214
# self.pos = glm.ivec2(0, 0)
1315

1416
def button(self, x, y):
1517
# if self.mode == 'lpx':
1618
if y == -1:
1719
if x == 0:
18-
if self.core.options.debug:
20+
if True:#self.core.options.debug:
1921
print("OCT+")
2022
self.octave += 1
2123
self.core.clear_marks(use_lights=False)
2224
self.core.send_all_notes_off()
2325
elif x == 1:
24-
if self.core.options.debug:
26+
if True:#self.core.options.debug:
2527
print("OCT-")
2628
self.octave -= 1
2729
self.core.clear_marks(use_lights=False)
2830
self.core.send_all_notes_off()
2931
elif x == 2:
30-
if self.core.options.debug:
32+
if True:#self.core.options.debug:
3133
print("MOV-")
3234
self.core.move_board(-1)
3335
# self.pos.x -= 1
3436
elif x == 3:
35-
if self.core.options.debug:
37+
if True:#self.core.options.debug:
3638
print("MOV+")
3739
self.core.move_board(1)
3840
elif x == 4:
39-
if self.core.options.debug:
41+
if True:#self.core.options.debug:
4042
print("TRA-")
4143
self.core.set_tonic(self.core.tonic - 1)
4244
elif x == 5:
43-
if self.core.options.debug:
45+
if True:#self.core.options.debug:
4446
print("TRA+")
4547
self.core.set_tonic(self.core.tonic + 1)
4648
if x == 8:
4749
if y == 0:
48-
if self.core.options.debug:
50+
if True:#self.core.options.debug:
4951
print("SCL+")
5052
self.core.next_scale()
5153
elif y == 1:
52-
if self.core.options.debug:
54+
if True:#self.core.options.debug:
5355
print("SCL-")
5456
self.core.prev_scale()
5557
elif y == 2:
56-
if self.core.options.debug:
58+
if True:#self.core.options.debug:
5759
print("MOD+")
5860
self.core.next_mode()
5961
elif y == 3:
60-
if self.core.options.debug:
62+
if True:#self.core.options.debug:
6163
print("MOD-")
6264
self.core.prev_mode()
6365
elif y == 4:
64-
if self.core.options.debug:
66+
if True:#self.core.options.debug:
6567
print("BANK+")
6668
self.core.next_bank()
6769
elif y == 5:
68-
if self.core.options.debug:
70+
if True:#self.core.options.debug:
6971
print("BANK-")
7072
self.core.prev_bank()
7173
elif y == 6:
72-
if self.core.options.debug:
74+
if True:#self.core.options.debug:
7375
print("PROG+")
7476
self.core.next_program()
7577
elif y == 7:
76-
if self.core.options.debug:
78+
if True:#self.core.options.debug:
7779
print("PROG-")
7880
self.core.prev_program()
7981

0 commit comments

Comments
 (0)