-
Notifications
You must be signed in to change notification settings - Fork 4
/
MasterController.py
57 lines (51 loc) · 1.93 KB
/
MasterController.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
# MasterController
# - control the master track
#
# Part of ElectraOne
#
# Ableton Live MIDI Remote Script for the Electra One
#
# Author: Jaap-henk Hoepman (info@xot.nl)
#
# Distributed under the MIT License, see LICENSE
#
# Local imports
from .config import *
from .GenericTrackController import GenericTrackController
class MasterController(GenericTrackController):
"""Manage the master track. Instantiates GenericTrackController
with the correct data for the master track.
"""
def __init__(self, c_instance):
"""Initialise the master track controller.
- c_instance: Live interface object (see __init.py__)
"""
GenericTrackController.__init__(self, c_instance)
self._track = self.song().master_track
# device selector index of this track
self._devsel_idx = NO_OF_TRACKS + MAX_NO_OF_SENDS
# EQ device
self.add_eq_device(MASTER_EQ_DEVICE_NAME,MASTER_EQ_CC_MAP)
# midi info
self._midichannel = MIDI_MASTER_CHANNEL
# sliders
self._base_pan_cc = MASTER_PAN_CC
self._base_volume_cc = MASTER_VOLUME_CC
self._base_cue_volume_cc = MASTER_CUE_VOLUME_CC
self._base_sends_cc = None # not present on a master track
# buttons
self._base_mute_cc = None # not present on a master track
self._base_arm_cc = None # not present on a master track
self._base_solo_cue_cc = None # present, but somehow not mappable
#
self._base_device_selection_cc = MASTER_DEVICE_SELECTION_CC
#
self.add_listeners()
self.debug(0,'MasterController initialised.')
def _my_cc(self,base_cc):
"""Return the actual MIDI CC number for this instance of a control,
given the base MIDI CC number for the control.
- base_cc: base MIDI CC number; int
- result: actual MIDI CC number; int
"""
return base_cc