-
Notifications
You must be signed in to change notification settings - Fork 0
/
crlowpads.py
49 lines (46 loc) · 2.54 KB
/
crlowpads.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Channel rack lower pads functions
import colors
import pads
import variables as var
import channels
import device
import ui
import colPalette as col
def LowerLights():
chan = channels.selectedChannel()
if var.SCENE_SEL == "Channel rack" and not var.scmodes.get("CHANRACK_READYFOR") == "Stop":
for x in pads.ses_lowerpads.values():
if chan+x-112 < channels.channelCount():
if channels.isChannelSolo(chan+x-112):
device.midiOutMsg(0x92, 0, x, colors.CRSOLO)
elif channels.isChannelMuted(chan+x-112):
device.midiOutMsg(0x92, 0, x, colors.CRMUTE)
elif var.scmodes.get("CHANRACK_READYFOR") == "Solo" and not channels.isChannelSolo(chan+x-112):
device.midiOutMsg(0x90, 0, x, colors.GREEN1)
elif var.scmodes.get("CHANRACK_READYFOR") == "Mute" and not channels.isChannelSolo(chan+x-112):
device.midiOutMsg(0x90, 0, x, colors.GREEN1)
elif var.scmodes.get("CHANRACK_READYFOR") == "":
device.midiOutMsg(0x90, 0, x, col.channelColorNumber(chan+x-112)) # Colored pads according to the channel color.
else: device.midiOutMsg(0x90, 0, x, 0)
def LowerPadsControls(data1, data2, CRMODE):
chan = channels.selectedChannel()
for x,y in pads.ses_lowerpads.items():
if data1 == pads.ses_lowerpads[x] and data2:
if CRMODE == "Solo":
if chan+y-112 < channels.channelCount():
channels.soloChannel(chan+y-112)
if channels.isChannelSolo(chan+y-112):
ui.setHintMsg("Channel " + str(chan+y-112) + " SOLOED! (" + channels.getChannelName(chan+y-112)+ ")")
else:
ui.setHintMsg("Channel " + str(chan+y-112) + " UN-SOLOED! (" + channels.getChannelName(chan+y-112)+ ")")
else:
ui.setHintMsg("Can't solo non-existing channels!")
elif CRMODE == "Mute":
if chan+y-112 < channels.channelCount():
channels.muteChannel(chan+y-112)
if channels.isChannelMuted(chan+y-112):
ui.setHintMsg("Channel " + str(chan+y-112) + " MUTED! (" + channels.getChannelName(chan+y-112)+ ")")
else:
ui.setHintMsg("Channel " + str(chan+y-112) + " UNMUTED! (" + channels.getChannelName(chan+y-112)+ ")")
else:
ui.setHintMsg("Can't mute non-existing channels!")