def _create_controls(self): make_on_off_button = partial(make_button, skin=self._default_skin) make_color_button = partial(make_button, skin=self._color_skin) make_stop_button = partial(make_button, skin=self._stop_button_skin) self._shift_button = make_button(0, 98, resource_type=SharedResource, name='Shift_Button') self._parameter_knobs = [ make_knob(0, index + 48, name='Parameter_Knob_%d' % (index + 1)) for index in xrange(self.SESSION_WIDTH) ] self._select_buttons = [ make_stop_button(0, 64 + index, name='Track_Select_%d' % (index + 1)) for index in xrange(self.SESSION_WIDTH) ] self._up_button = self.make_shifted_button(self._select_buttons[0]) self._down_button = self.make_shifted_button(self._select_buttons[1]) self._left_button = self.make_shifted_button(self._select_buttons[2]) self._right_button = self.make_shifted_button(self._select_buttons[3]) self._volume_button = self.make_shifted_button(self._select_buttons[4]) self._pan_button = self.make_shifted_button(self._select_buttons[5]) self._send_button = self.make_shifted_button(self._select_buttons[6]) self._device_button = self.make_shifted_button(self._select_buttons[7]) if self.HAS_TRANSPORT: self._play_button = make_on_off_button(0, 91, name='Play_Button') self._record_button = make_on_off_button(0, 93, name='Record_Button') def matrix_note(x, y): return x + self.SESSION_WIDTH * (self.SESSION_HEIGHT - y - 1) self._matrix_buttons = [ [ make_color_button(0, matrix_note(track, scene), name='%d_Clip_%d_Button' % (track, scene)) for track in xrange(self.SESSION_WIDTH) ] for scene in xrange(self.SESSION_HEIGHT) ] self._session_matrix = ButtonMatrixElement(name='Button_Matrix', rows=self._matrix_buttons) self._scene_launch_buttons = [ make_color_button(0, index + 82, name='Scene_Launch_%d' % (index + 1)) for index in xrange(self.SESSION_HEIGHT) ] self._stop_button = self.make_shifted_button(self._scene_launch_buttons[0]) self._solo_button = self.make_shifted_button(self._scene_launch_buttons[1]) self._arm_button = self.make_shifted_button(self._scene_launch_buttons[2]) self._mute_button = self.make_shifted_button(self._scene_launch_buttons[3]) self._select_button = self.make_shifted_button(self._scene_launch_buttons[4]) self._stop_all_button = self._make_stop_all_button()
def _create_controls(self): make_on_off_button = partial(make_button, skin=self._default_skin) make_color_button = partial(make_button, skin=self._color_skin) make_stop_button = partial(make_button, skin=self._stop_button_skin) self._shift_button = make_button(0, 98, resource_type=SharedResource, name='Shift_Button') self._parameter_knobs = [ make_knob(0, index + 48, name='Parameter_Knob_%d' % (index + 1)) for index in xrange(self.SESSION_WIDTH) ] self._select_buttons = [ make_stop_button(0, 64 + index, name='Track_Select_%d' % (index + 1)) for index in xrange(self.SESSION_WIDTH) ] self._up_button = self.make_shifted_button(self._select_buttons[0]) self._down_button = self.make_shifted_button(self._select_buttons[1]) self._left_button = self.make_shifted_button(self._select_buttons[2]) self._right_button = self.make_shifted_button(self._select_buttons[3]) self._volume_button = self.make_shifted_button(self._select_buttons[4]) self._pan_button = self.make_shifted_button(self._select_buttons[5]) self._send_button = self.make_shifted_button(self._select_buttons[6]) self._device_button = self.make_shifted_button(self._select_buttons[7]) if self.HAS_TRANSPORT: self._play_button = make_on_off_button(0, 91, name='Play_Button') self._record_button = make_on_off_button(0, 93, name='Record_Button') def matrix_note(x, y): return x + self.SESSION_WIDTH * (self.SESSION_HEIGHT - y - 1) self._matrix_buttons = [[ make_color_button(0, matrix_note(track, scene), name='%d_Clip_%d_Button' % (track, scene)) for track in xrange(self.SESSION_WIDTH) ] for scene in xrange(self.SESSION_HEIGHT)] self._session_matrix = ButtonMatrixElement(name='Button_Matrix', rows=self._matrix_buttons) self._scene_launch_buttons = [ make_color_button(0, index + 82, name='Scene_Launch_%d' % (index + 1)) for index in xrange(self.SESSION_HEIGHT) ] self._stop_button = self.make_shifted_button( self._scene_launch_buttons[0]) self._solo_button = self.make_shifted_button( self._scene_launch_buttons[1]) self._arm_button = self.make_shifted_button( self._scene_launch_buttons[2]) self._mute_button = self.make_shifted_button( self._scene_launch_buttons[3]) self._select_button = self.make_shifted_button( self._scene_launch_buttons[4]) self._stop_all_button = self._make_stop_all_button()
def _create_controls(self): """ _create_controls will be called by parent class """ make_on_off_button = partial(make_button, skin=self._default_skin) make_color_button = partial(make_button, skin=self._color_skin) make_stop_button = partial(make_button, skin=self._stop_button_skin) # which button on the controller is the shift button: self._shift_button = make_button(0, 98, resource_type=SharedResource, name='Shift_Button') self._parameter_knobs = [ make_knob(0, index + 48, name='Parameter_Knob_%d' % (index + 1)) for index in xrange(self.SESSION_WIDTH) ] # BUTTONS BOTTOM: select & shift(function) # originally these are unshifted (stop,solo,rec,mute,select THIS TRACK), leave them self._select_buttons = [ make_stop_button(0, 64 + index, name='Track_Select_%d' % (index + 1)) for index in xrange(self.SESSION_WIDTH) ] # originally these are shifted (grid-move,vol,pan,send,dev), leave them self._up_button = self.make_shifted_button(self._select_buttons[0]) self._down_button = self.make_shifted_button(self._select_buttons[1]) self._left_button = self.make_shifted_button(self._select_buttons[2]) self._right_button = self.make_shifted_button(self._select_buttons[3]) self._volume_button = self.make_shifted_button(self._select_buttons[4]) self._pan_button = self.make_shifted_button(self._select_buttons[5]) self._send_button = self.make_shifted_button(self._select_buttons[6]) self._device_button = self.make_shifted_button(self._select_buttons[7]) if self.HAS_TRANSPORT: self._play_button = make_on_off_button(0, 91, name='Play_Button') self._record_button = make_on_off_button(0, 93, name='Record_Button') # BUTTONS 8x8 GRID START def matrix_note(x, y): return x + self.SESSION_WIDTH * (self.SESSION_HEIGHT - y - 1) self._matrix_buttons = [ [ make_color_button(0, matrix_note(track, scene), name='%d_Clip_%d_Button' % (track, scene)) for track in xrange(self.SESSION_WIDTH) ] for scene in xrange(self.SESSION_HEIGHT) ] self._session_matrix = ButtonMatrixElement(name='Button_Matrix', rows=self._matrix_buttons) # BUTTONS 8x8 GRID END # BUTTONS RIGHT ROW: scene launch & shift(function), switch them self._scene_buttons = [make_color_button(0, index + 82) for index in xrange(self.SESSION_HEIGHT)] self._scene_matrix = ButtonMatrixElement( rows=[[self.make_shifted_button(button) for button in self._scene_buttons]]) # originally these are shifted, make them unshifted self._stop_button = self._scene_buttons[0] self._solo_button = self._scene_buttons[1] self._arm_button = self._scene_buttons[2] self._mute_button = self._scene_buttons[3] self._select_button = self._scene_buttons[4] self._stop_all_button = self._make_stop_all_button() self._master_volume_control = make_slider(0, 56, name='Master_Volume') # midiscripts.net START 1 # update unused buttons list ## jojo: unused buttons now unshifted, only button 6 is unused self._unused_buttons = self._scene_buttons[self.UNUSED_BTNS_FIRST:self.UNUSED_BTNS_LAST] ## create a matrix, which contains grid of scenes (8x8) ## that's what user will see on controller upon enabling ## session overview self.overview_matrix = ButtonMatrixElement( rows=self._matrix_buttons) self.overview_layer = Layer( button_matrix=self.overview_matrix) ## making ButtonElement and connecting it to one of ## scene launch button on controller self.overview_toggle_btn = self._scene_buttons[self.OVERVIEW_TOGGLE_BTN_INDEX] self.overview_manager = OverviewManagerComponent( self, name='Zoom Toggle Manager', layer=Layer( toggle_button=self.overview_toggle_btn, priority=1), is_enabled=False) self.log_message('_create_controls finished')