Exemplo n.º 1
0
 def OnPadPressed(self, control, event):
     idx = CONTROLS.PADS_64.index(control)
     if ui.getFocused(midi.widMixer):
         idx += 1  # do not include the master track (0)
         if self.controls.isButtonMutePressed:
             mixer.enableTrack(idx)
         elif self.controls.isButtonSelectPressed:
             mixer.selectTrack(idx)
         else:
             mixer.deselectAll()
             mixer.selectTrack(idx)
     elif ui.getFocused(midi.widChannelRack):
         if self.controls.isButtonMutePressed:
             channels.muteChannel(idx)
         elif self.controls.isButtonSelectPressed:
             channels.selectChannel(idx)
         else:
             channels.deselectAll()
             channels.selectChannel(idx)
     elif ui.getFocused(midi.widPlaylist):
         idx += 1  # TODO figure out why patternNumber starts at one instead of zero!
         if self.controls.isButtonMutePressed:
             pass
         else:
             patterns.jumpToPattern(idx)
     else:
         pass
     self.updateLEDs()
def _select_channel_from_name(name):
    base = name.split(' [')[0]
    for i in range(channels.channelCount()):
        if base == channels.getChannelName(i):
            channels.deselectAll()
            channels.selectChannel(i, 1)
            return True
    return False
Exemplo n.º 3
0
 def _select_one_channel(self, index):
     if SCRIPT_VERSION >= 8:
         channels.selectOneChannel(index)
     else:
         channels.deselectAll()
         channels.selectChannel(index, 1)
     if config.ENABLE_CONTROLS_FL_HINTS:
         ui.setHintMsg(
             '[%d:%d] %s' %
             (channels.selectedChannel() + 1, patterns.patternNumber(),
              channels.getChannelName(channels.selectedChannel())))
Exemplo n.º 4
0
 def OnEncoderTempoDecreased(self, control, event):
     if self.controls.isButtonShiftPressed:
         transport.globalTransport(midi.FPT_TempoJog, -10)
     elif ui.getFocused(midi.widChannelRack):
         idx = channels.channelNumber(1)
         print(idx)
         if idx == -1:
             channels.selectChannel(channels.channelCount() - 1, 1)
         elif idx > 0:
             channels.deselectAll()
             channels.selectChannel(idx - 1, 1)
     elif ui.getFocused(midi.widPlaylist):
         idx = patterns.patternNumber()
         if idx > 1:  # TODO figure out why patternNumber starts at one instead of zero!
             patterns.jumpToPattern(idx - 1)
     elif ui.getFocused(midi.widMixer):
         idx = mixer.trackNumber()
         if idx > 1:  # do not include the master track (0)
             mixer.setTrackNumber(idx - 1)
    def handleJog(self, encoder, event):
        display_message = ''
        display_value = None

        i = encoder.index
        jogmap = self.encoderJogs[controls.shift.value]
        if i in jogmap:
            target, display_message = jogmap[i]
            fpt.callFPT(target, encoder.value, event)

            direction = '>' if encoder.value > 0 else '<'
            display_message += ' ' + direction
        elif i == 4:
            selected_track = self.moveSelectedMixerTrack(encoder.value)
            display_message = mixer.getTrackName(selected_track)
            display_value = selected_track
        elif i == 5:
            selected_pattern = (patterns.patternNumber() +
                                encoder.value) % patterns.patternMax()
            patterns.jumpToPattern(selected_pattern)
            display_message = patterns.getPatternName(selected_pattern)
            display_value = selected_pattern
        elif i == 6:
            group_channel_count = channels.channelCount(0)
            current_channel = channels.channelNumber(0)
            selected_group_index = self.cycleChannels(
                current=0,
                count=group_channel_count,
                condition_func=lambda c: channels.getChannelIndex(
                    c) == current_channel) or 0
            selected_index = (selected_group_index +
                              encoder.value) % group_channel_count
            channels.deselectAll()
            channels.selectChannel(selected_index)
            display_message = channels.getChannelName(selected_index)
            display_value = selected_index

        self.lcdText(display_message)
        if display_value:
            self.lcdValueText(display_value)
Exemplo n.º 6
0
 def channel_rack_down(unused_param_value):
     """Channelrack down"""
     select = (channels.channelNumber() + 1) % channels.channelCount()
     channels.deselectAll()
     channels.selectChannel(select, 1)
Exemplo n.º 7
0
 def channel_rack_up(unused_param_value):
     """Channelrack up"""
     select = (channels.channelNumber() - 1) % channels.channelCount()
     channels.deselectAll()
     channels.selectChannel(select, 1)
Exemplo n.º 8
0
def deselect_all_channels(_):
    channels.deselectAll()