-
Notifications
You must be signed in to change notification settings - Fork 0
/
mixerlowpads.py
82 lines (71 loc) · 4.55 KB
/
mixerlowpads.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
### Colors and UI messages for lower pads in Mixer mode
import variables as var
import pads
import mixer
import device
import colors
import ui
import colPalette as col
def LowerLights():
if var.SCENE_SEL == "Mixer":
for x in pads.ses_lowerpads.values():
if mixer.trackNumber()+x-112 < mixer.trackCount()-1:
if mixer.isTrackArmed(mixer.trackNumber()+x-112):
device.midiOutMsg(0x92, 0, x, colors.STOP)
elif mixer.isTrackSolo(mixer.trackNumber()+x-112):
device.midiOutMsg(0x92, 0, x, colors.SOLO)
elif mixer.isTrackMuted(mixer.trackNumber()+x-112):
device.midiOutMsg(0x92, 0, x, colors.MUTE)
elif var.MIXER_READYFOR == "Solo" and not mixer.isTrackSolo(mixer.trackNumber()+x-112):
device.midiOutMsg(0x90, 0, x, colors.GREEN1)
elif var.MIXER_READYFOR == "Mute" and not mixer.isTrackSolo(mixer.trackNumber()+x-112):
device.midiOutMsg(0x90, 0, x, colors.GREEN1)
else:
#device.midiOutMsg(0x90, 0, x, colors.GREEN1)
device.midiOutMsg(0x90, 0, x, col.mixerColorNumber(mixer.trackNumber()+x-112)) # Colored pads according to the mixer track color.
else: device.midiOutMsg(0x90, 0, x, 0)
class LowPads:
def __init__(self, DATA1, DATA2, MIXERMODE):
self.DATA1 = DATA1
self.DATA2 = DATA2
self.MIXERMODE = MIXERMODE
def LowerPadsControls(self):
for x,y in pads.ses_lowerpads.items():
if self.DATA1 == pads.ses_lowerpads[x]:
if self.DATA2:
if self.MIXERMODE == "Stop":
if mixer.trackNumber()+y-112 < mixer.trackCount()-1:
mixer.armTrack(mixer.trackNumber()+y-112)
if mixer.isTrackArmed(mixer.trackNumber()+y-112):
ui.setHintMsg("Insert " + str(mixer.trackNumber()+y-112) + " ARMED for recording! (" + mixer.getTrackName(mixer.trackNumber()+y-112)+ ")")
else:
ui.setHintMsg("Insert " + str(mixer.trackNumber()+y-112) + " UNARMED for recording! (" + mixer.getTrackName(mixer.trackNumber()+y-112)+ ")")
else:
if mixer.trackNumber()+y-112 == mixer.trackCount()-1:
ui.setHintMsg("Can't arm the Current insert!")
else:
ui.setHintMsg("Can't arm non-existing inserts!")
elif self.MIXERMODE == "Solo":
if mixer.trackNumber()+y-112 < mixer.trackCount()-1:
mixer.soloTrack(mixer.trackNumber()+y-112)
if mixer.isTrackSolo(mixer.trackNumber()+y-112):
ui.setHintMsg("Insert " + str(mixer.trackNumber()+y-112) + " SOLOED! (" + mixer.getTrackName(mixer.trackNumber()+y-112)+ ")")
else:
ui.setHintMsg("Insert " + str(mixer.trackNumber()+y-112) + " UN-SOLOED! (" + mixer.getTrackName(mixer.trackNumber()+y-112)+ ")")
else:
if mixer.trackNumber()+y-112 == mixer.trackCount()-1:
ui.setHintMsg("Can't solo the Current insert!")
else:
ui.setHintMsg("Can't solo non-existing inserts!")
elif self.MIXERMODE == "Mute":
if mixer.trackNumber()+y-112 < mixer.trackCount()-1:
if mixer.isTrackMuted(mixer.trackNumber()+y-112):
ui.setHintMsg("Insert " + str(mixer.trackNumber()+y-112) + " UNMUTED! (" + mixer.getTrackName(mixer.trackNumber()+y-112)+ ")")
else:
ui.setHintMsg("Insert " + str(mixer.trackNumber()+y-112) + " MUTED! (" + mixer.getTrackName(mixer.trackNumber()+y-112)+ ")")
mixer.muteTrack(mixer.trackNumber()+y-112)
else:
if mixer.trackNumber()+y-112 == mixer.trackCount()-1:
ui.setHintMsg("Can't mute the Current insert!")
else:
ui.setHintMsg("Can't mute non-existing inserts!")