Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr/38 #39

Merged
merged 18 commits into from
Sep 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 38 additions & 2 deletions ColorsMK1.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,57 @@
class Rgb:
BLACK = Color(4)

#RED
RED = Color(7)
RED_FULL = Color(7)
RED_HALF = Color(6)
RED_THIRD = Color(5)

RED_BLINK = Color(11)
RED_BLINK_HALF = Color(10)
RED_BLINK_THIRD = Color(9)

#GREEN
GREEN = Color(52)
GREEN_FULL = Color(52)
GREEN_HALF = Color(36)
GREEN_THIRD = Color(20)

GREEN_BLINK = Color(56)
GREEN_BLINK_HALF = Color(40)
GREEN_BLINK_THIRD = Color(24)

#AMBER
AMBER = Color(55)
AMBER_FULL = Color(55)
AMBER_HALF = Color(38)
AMBER_THIRD = Color(21)
AMBER_BLINK = Color(21)


AMBER_BLINK = Color(59)
AMBER_BLINK_HALF = Color(42)
AMBER_BLINK_THIRD = Color(25)

#YELLOW
YELLOW = Color(54)
YELLOW_FULL = Color(54)
YELLOW_HALF = Color(37)

YELLOW_BLINK = Color(58)
YELLOW_BLINK_HALF = Color(41)

#ORANGE
ORANGE = Color(39)
ORANGE_FULL = Color(39)
ORANGE_HALF = Color(22)

ORANGE_BLINK = Color(43)
ORANGE_BLINK_HALF = Color(26)

#MISC
MANDARIN = Color(23)
MANDARIN_FULL = Color(23)
ORANGE_BLINK = Color(27)

LIME = Color(43)
LIME_FULL = Color(43)
LIME_BLINK = Color(47)
1 change: 0 additions & 1 deletion ColorsMK2.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ class Rgb:
PURPLE_HALF_PULSE = Pulse(49)
PURPLE_THIRD_PULSE = Pulse(50)


CLIP_COLOR_TABLE = {
15549221: 60,
12411136: 61,
Expand Down
2 changes: 1 addition & 1 deletion ConfigurableButtonElement.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def send_value(self, value, **k):
super(ConfigurableButtonElement, self).send_value(value, **k)
else:
self._draw_skin(value)

def force_next_send(self):
"""
Enforces sending the next value regardless of wether the
Expand Down
9 changes: 4 additions & 5 deletions DeviceComponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from _Framework.ButtonElement import ButtonElement
from DeviceControllerStrip import DeviceControllerStrip
import time
import Live


class DeviceComponent(LiveDeviceComponent):
Expand Down Expand Up @@ -39,10 +38,10 @@ def __init__(self, control_surface = None, name = "device_component", is_enabled

self._selected_track = None

self._lock_buttons = [None for index in range(4)]
self._locked_device_bank = [0 for index in range(4)]
self._lock_button_press = [0 for index in range(4)]
self._locked_devices = [None for index in range(4)]
self._lock_buttons = [None,None,None,None]
self._locked_device_bank = [0,0,0,0]
self._lock_button_press = [0,0,0,0]
self._locked_devices = [None,None,None,None]

if top_buttons != None:
# device selection buttons
Expand Down
11 changes: 5 additions & 6 deletions InstrumentControllerComponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from _Framework.Util import find_if
from itertools import imap
from TrackControllerComponent import TrackControllerComponent
from ScaleComponent import *
from ScaleComponent import ScaleComponent,CIRCLE_OF_FIFTHS,MUSICAL_MODES,KEY_NAMES
import Settings

class InstrumentControllerComponent(CompoundComponent):
Expand Down Expand Up @@ -522,7 +522,6 @@ def _update_matrix(self):
else:
button.turn_off()

interval = self._scales._interval
pattern = self._scales.get_pattern()
max_j = self._matrix.width() - 1
a = 0
Expand Down Expand Up @@ -563,12 +562,12 @@ def _update_matrix(self):
button.set_enabled(True)
button.force_next_send()

#self._control_surface._config_button.send_value(32)
#self._control_surface._config_button.send_value(32)#Send enable flashing led config message to LP


def tuple_idx(self, tuple, obj):
for i in xrange(0, len(tuple)):
if (tuple[i] == obj):
def tuple_idx(self, target_tuple, obj):
for i in xrange(0, len(target_tuple)):
if (target_tuple[i] == obj):
return i
return(False)

10 changes: 5 additions & 5 deletions Launchpad.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import with_statement
import Live
from _Framework.ControlSurface import ControlSurface
from _Framework.InputControlElement import *
from _Framework.InputControlElement import MIDI_CC_TYPE, MIDI_NOTE_TYPE
from _Framework.ButtonElement import ButtonElement
from _Framework.ButtonMatrixElement import ButtonMatrixElement
from ConfigurableButtonElement import ConfigurableButtonElement
Expand Down Expand Up @@ -51,7 +51,7 @@ def init(self):
#self._drum_notes = (20, 30, 31, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126)
self._drum_notes = (20, 30, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126)
else:
from SkinMK1 import make_skin
from SkinMK1 import make_skin # @Reimport
self._skin = make_skin()
self._side_notes = (8, 24, 40, 56, 72, 88, 104, 120)
self._drum_notes = (41, 42, 43, 44, 45, 46, 47, 57, 58, 59, 60, 61, 62, 63, 73, 74, 75, 76, 77, 78, 79, 89, 90, 91, 92, 93, 94, 95, 105, 106, 107)
Expand Down Expand Up @@ -132,7 +132,7 @@ def disconnect(self):
# launchpad mk2 needs disconnect string sent
self._send_midi((240, 0, 32, 41, 2, 24, 64, 247))
if self._config_button != None:
self._config_button.send_value(32)
self._config_button.send_value(32)#Send enable flashing led config message to LP
self._config_button.send_value(0)
self._config_button = None
self._user_byte_write_button.send_value(0)
Expand Down Expand Up @@ -203,9 +203,9 @@ def build_midi_map(self, midi_map_handle):
ControlSurface.build_midi_map(self, midi_map_handle)
if self._selector!=None:
if self._selector._main_mode_index==2 or self._selector._main_mode_index==1:
mode = Settings.USER_MODES[ (self._selector._main_mode_index-1) * 3 + self._selector._sub_mode_index[self._selector._main_mode_index] ]
mode = Settings.USER_MODES[ (self._selector._main_mode_index-1) * 3 + self._selector._sub_mode_list[self._selector._main_mode_index] ]
#self._selector.mode_index == 1:
#if self._selector._sub_mode_index[self._selector._mode_index] > 0: # disable midi map rebuild for instrument mode to prevent light feedback errors
#if self._selector._sub_mode_list[self._selector._mode_index] > 0: # disable midi map rebuild for instrument mode to prevent light feedback errors
if mode != "instrument":
new_channel = self._selector.channel_for_current_mode()
for note in self._drum_notes:
Expand Down
Loading