def process(command):

    # Process master fader changing selected channel volume.
    if command.id == eventconsts.BASIC_FADER_9:
        current_channel = channels.selectedChannel()
        volume = processorhelpers.snap(processorhelpers.toFloat(command.value),
                                       internal.consts.CHANNEL_VOLUME_SNAP_TO)
        channels.setChannelVolume(current_channel, volume)
        action = "Set " + channels.getChannelName(
            current_channel) + " volume to " + str(round(volume * 100)) + "%"
        if processorhelpers.didSnap(processorhelpers.toFloat(command.value),
                                    internal.consts.CHANNEL_VOLUME_SNAP_TO):
            action += " [Snapped]"
        command.handle(action)

    # Process master fader button to mute/unmute.
    if command.id == eventconsts.BASIC_FADER_BUTTON_9:
        global mute_toggle_channel, previous_channel_volume
        if command.is_lift:
            if type(mute_toggle_channel) is int and type(
                    previous_channel_volume) is float:
                if 0 == channels.getChannelVolume(mute_toggle_channel):
                    channels.setChannelVolume(mute_toggle_channel,
                                              previous_channel_volume)
                    command.handle(
                        "Unmuted " +
                        channels.getChannelName(mute_toggle_channel))
                mute_toggle_channel = None
                previous_channel_volume = None
        else:
            mute_toggle_channel = channels.selectedChannel()
            previous_channel_volume = channels.getChannelVolume(
                mute_toggle_channel)
            channels.setChannelVolume(mute_toggle_channel, 0)
            command.handle("Muted " +
                           channels.getChannelName(mute_toggle_channel))

    for x in imports:
        object_to_call = getattr(pluginprocessors, x)
        if canHandle(object_to_call):
            object_to_call.process(command)

        if command.ignored: return

    # Only process mod-wheel and pitch-bend if they weren't already handled by plugin processors

    # Mod-wheel
    if command.id == eventconsts.MOD_WHEEL:
        pluginswrapper.setCCParam(command.note, command.value)
        command.handle("Mod-wheel", 1)

    # Pitch-bend wheel
    if command.id == eventconsts.PITCH_BEND:
        #pluginswrapper.setCCParam(command.note, command.value)
        current_channel = channels.selectedChannel()
        channels.setChannelPitch(
            current_channel,
            processorhelpers.snap(
                processorhelpers.toFloat(command.value, -1, 1), 0.0))
        command.handle("Pitch Bend", 1)
Beispiel #2
0
def process(command):

    # REQUIRES SCRIPTING VERSION 8
    #if general.getVersion() >= 8:
    # Process pitch bend wheel
    if command.id == eventconsts.PITCH_BEND:
        current_channel = channels.selectedChannel()
        channels.setChannelPitch(
            current_channel, processorhelpers.toFloat(command.value, -1, 1))

    # Process master fader changing selected channel volume.
    if command.id == eventconsts.BASIC_FADER_9:
        current_channel = channels.selectedChannel()
        volume = processorhelpers.snap(processorhelpers.toFloat(command.value),
                                       internal.consts.CHANNEL_VOLUME_SNAP_TO)
        channels.setChannelVolume(current_channel, volume)
        action = "Set " + channels.getChannelName(
            current_channel) + " volume to " + str(round(volume * 100)) + "%"
        if processorhelpers.didSnap(processorhelpers.toFloat(command.value),
                                    internal.consts.CHANNEL_VOLUME_SNAP_TO):
            action += " [Snapped]"
        command.handle(action)

    # Process master fader button to mute/unmute.
    if command.id == eventconsts.BASIC_FADER_BUTTON_9:
        global mute_toggle_channel, previous_channel_volume
        if command.is_lift:
            if type(mute_toggle_channel) is int and type(
                    previous_channel_volume) is float:
                if 0 == channels.getChannelVolume(mute_toggle_channel):
                    channels.setChannelVolume(mute_toggle_channel,
                                              previous_channel_volume)
                    command.handle(
                        "Unmuted " +
                        channels.getChannelName(mute_toggle_channel))
                mute_toggle_channel = None
                previous_channel_volume = None
        else:
            mute_toggle_channel = channels.selectedChannel()
            previous_channel_volume = channels.getChannelVolume(
                mute_toggle_channel)
            channels.setChannelVolume(mute_toggle_channel, 0)
            command.handle("Muted " +
                           channels.getChannelName(mute_toggle_channel))

    for x in imports:
        object_to_call = getattr(pluginprocessors, x)
        if canHandle(object_to_call):
            object_to_call.process(command)

        if command.ignored: return
Beispiel #3
0
 def OnEncoderDecreased(self, control, event):
     control_type, control_name, control_id, control_note_or_color = control.split(
         ".")
     control_number = int(control_name)
     if ui.getFocused(midi.widMixer):
         index = mixer.trackNumber() + control_number - 1
         if self.mixer.encodersTarget == ENCODERS_NUM_TARGETS.MIXER.TRACK_VOL:
             mixer.setTrackVolume(index,
                                  mixer.getTrackVolume(index) - VOL_INC)
         elif self.mixer.encodersTarget == ENCODERS_NUM_TARGETS.MIXER.TRACK_PAN:
             mixer.setTrackPan(index, mixer.getTrackPan(index) - PAN_INC)
     elif ui.getFocused(midi.widChannelRack
                        ) and control_number <= channels.channelCount():
         index = channels.channelNumber() + control_number - 1
         if self.channels.encodersTarget == ENCODERS_NUM_TARGETS.CHANNELS.CHANNEL_VOL:
             channels.setChannelVolume(
                 index,
                 channels.getChannelVolume(index) - VOL_INC)
         elif self.channels.encodersTarget == ENCODERS_NUM_TARGETS.CHANNELS.CHANNEL_PAN:
             channels.setChannelPan(index,
                                    channels.getChannelPan(index) - PAN_INC)
     elif ui.getFocused(midi.widPlaylist):
         index = playlist.trackNumber() + control_number - 1
         if self.playlist.encodersTarget == ENCODERS_NUM_TARGETS.TRACK_VOL:
             pass
Beispiel #4
0
 def OnUpdateVolume(self, delta):
     channel = channels.selectedChannel()
     volume = self.clip(
         0., 1.,
         channels.getChannelVolume(channels.selectedChannel()) +
         (delta / 100.0))
     channels.setChannelVolume(channel, volume)
Beispiel #5
0
    def OnMidiIn(self, event):

        #tbuttons
        if (event.data1 == playb):
            transport.start()  #play
            self.UpdateLEDs()

        if (event.data1 == recb):
            transport.record()  #record
            self.UpdateLEDs()

        if (event.data1 == stopb):
            transport.stop()  #stop
            self.UpdateLEDs()

        if (event.data1 == loopb):
            transport.setLoopMode()  #loop/pattern mode
            self.UpdateLEDs()

        if (event.data1 == metrob):  # metronome/button
            transport.globalTransport(midi.FPT_Metronome, 110)
            self.UpdateLEDs()

        if (event.data1 == tempob):
            transport.stop()  #tap tempo

        if (event.data1 == quantizeb):
            transport.globalTransport(midi.FPT_Snap, 48)  #snap toggle

        if (event.data1 == squantizeb):
            ui.snapMode(1)  #snap toggle

        if (event.data1 == srecb):
            transport.globalTransport(midi.FPT_CountDown,
                                      115)  #countdown before recordin

        #if (event.data1 == sstopb):
        #   transport.globalTransport(midi.FPT_F12, 71) #clear all windows

        if (event.data1 == undob):
            general.undoUp()  #undo

        if (event.data1 == sundob):
            general.undo()  #redo

        if (event.data1 == squantizeb):
            transport.globalTransport(midi.FPT_SnapMode, 49,
                                      event.pmeFlags)  #snap toggle
            self.UpdateLEDs()

        if (event.data1 == tempob):
            transport.globalTransport(midi.FPT_TapTempo, 106)  #tap tempo

        #4D controller
        if (event.data1 == knobe):
            transport.globalTransport(midi.FPT_Enter, 80)  #enter

        if (event.data1 == knobsp) & (event.data2
                                      == right):  #4d encoder spin right
            ui.jog(1)

        elif (event.data1 == knobsp) & (event.data2
                                        == left):  #4d encoder spin left
            ui.jog(-1)

        if (event.data1 == knoblr) & (event.data2
                                      == right):  #4d encoder push right
            transport.globalTransport(midi.FPT_Right, 1)

        elif (event.data1 == knoblr) & (event.data2
                                        == left):  #4d encoder push left
            transport.globalTransport(midi.FPT_Left, 1)

        if (event.data1 == knobud) & (event.data2 == up):  #4d encoder push up
            transport.globalTransport(midi.FPT_Up, 1)
        elif (event.data1 == knobud) & (event.data2
                                        == down):  #4d encoder push down
            transport.globalTransport(midi.FPT_Down, 1)

        #8 volume knobs for mixer & channel rack, 8 tracks at a time

        volinc = .005  #volume increments
        paninc = .01  # pan increments

        if ui.getFocused(0) == 1:  #mixer volume control

            if (event.data1 == muteb):
                mixer.enableTrack(mixer.trackNumber())  #mute

            if (event.data1 == solob):
                mixer.soloTrack(mixer.trackNumber())  #solo

            # VOLUME CONTROL

            #knob 1
            if (event.data1 == knob1):
                if event.data2 == 127:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 0,
                        mixer.getTrackVolume(mixer.trackNumber()) + 0 -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 0,
                        mixer.getTrackVolume(mixer.trackNumber()) + 0 +
                        volinc)  # volume values go up

            #knob 2
            if (event.data1 == knob2):
                if event.data2 == 127:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 1,
                        mixer.getTrackVolume(mixer.trackNumber() + 1) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 1,
                        mixer.getTrackVolume(mixer.trackNumber() + 1) +
                        volinc)  # volume values go up

            #knob 3
            if (event.data1 == knob3):
                if event.data2 == 127:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 2,
                        mixer.getTrackVolume(mixer.trackNumber() + 2) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 2,
                        mixer.getTrackVolume(mixer.trackNumber() + 2) +
                        volinc)  # volume values go up

            #knob 4
            if (event.data1 == knob4):
                if event.data2 == 127:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 3,
                        mixer.getTrackVolume(mixer.trackNumber() + 3) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 3,
                        mixer.getTrackVolume(mixer.trackNumber() + 3) +
                        volinc)  # volume values go up

            #knob5
            if (event.data1 == knob5):
                if event.data2 == 127:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 4,
                        mixer.getTrackVolume(mixer.trackNumber() + 4) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 4,
                        mixer.getTrackVolume(mixer.trackNumber() + 4) +
                        volinc)  # volume values go up

            #knob 6
            if (event.data1 == knob6):
                if event.data2 == 127:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 5,
                        mixer.getTrackVolume(mixer.trackNumber() + 5) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 5,
                        mixer.getTrackVolume(mixer.trackNumber() + 5) +
                        volinc)  # volume values go up

            #knob 7
            if (event.data1 == knob7):
                if event.data2 == 127:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 6,
                        mixer.getTrackVolume(mixer.trackNumber() + 6) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 6,
                        mixer.getTrackVolume(mixer.trackNumber() + 6) +
                        volinc)  # volume values go up

            #knob 8
            if (event.data1 == knob8):
                if event.data2 == 127:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 7,
                        mixer.getTrackVolume(mixer.trackNumber() + 7) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackVolume(
                        mixer.trackNumber() + 7,
                        mixer.getTrackVolume(mixer.trackNumber() + 7) +
                        volinc)  # volume values go up

            # PAN CONTROL

            #sknob 1
            if (event.data1 == sknob1):
                if event.data2 == 127:
                    mixer.setTrackPan(mixer.trackNumber() + 0,
                                      mixer.getTrackPan(mixer.trackNumber()) +
                                      0 - paninc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackPan(mixer.trackNumber() + 0,
                                      mixer.getTrackPan(mixer.trackNumber()) +
                                      0 + paninc)  # volume values go up

            #sknob 2
            if (event.data1 == sknob2):
                if event.data2 == 127:
                    mixer.setTrackPan(
                        mixer.trackNumber() + 1,
                        mixer.getTrackPan(mixer.trackNumber() + 1) -
                        paninc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackPan(
                        mixer.trackNumber() + 1,
                        mixer.getTrackPan(mixer.trackNumber() + 1) +
                        paninc)  # volume values go up

            #sknob 3
            if (event.data1 == sknob3):
                if event.data2 == 127:
                    mixer.setTrackPan(
                        mixer.trackNumber() + 2,
                        mixer.getTrackPan(mixer.trackNumber() + 2) -
                        paninc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackPan(
                        mixer.trackNumber() + 2,
                        mixer.getTrackPan(mixer.trackNumber() + 2) +
                        paninc)  # volume values go up

            #sknob 4
            if (event.data1 == sknob4):
                if event.data2 == 127:
                    mixer.setTrackPan(
                        mixer.trackNumber() + 3,
                        mixer.getTrackPan(mixer.trackNumber() + 3) -
                        paninc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackPan(
                        mixer.trackNumber() + 3,
                        mixer.getTrackPan(mixer.trackNumber() + 3) +
                        paninc)  # volume values go up

            #sknob5
            if (event.data1 == sknob5):
                if event.data2 == 127:
                    mixer.setTrackPan(
                        mixer.trackNumber() + 4,
                        mixer.getTrackPan(mixer.trackNumber() + 4) -
                        paninc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackPan(
                        mixer.trackNumber() + 4,
                        mixer.getTrackPan(mixer.trackNumber() + 4) +
                        paninc)  # volume values go up

            #sknob 6
            if (event.data1 == sknob6):
                if event.data2 == 127:
                    mixer.setTrackPan(
                        mixer.trackNumber() + 5,
                        mixer.getTrackPan(mixer.trackNumber() + 5) -
                        paninc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackPan(
                        mixer.trackNumber() + 5,
                        mixer.getTrackPan(mixer.trackNumber() + 5) +
                        paninc)  # volume values go up

            #sknob 7
            if (event.data1 == sknob7):
                if event.data2 == 127:
                    mixer.setTrackPan(
                        mixer.trackNumber() + 6,
                        mixer.getTrackPan(mixer.trackNumber() + 6) -
                        paninc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackPan(
                        mixer.trackNumber() + 6,
                        mixer.getTrackPan(mixer.trackNumber() + 6) +
                        paninc)  # volume values go up

            #sknob 8
            if (event.data1 == sknob8):
                if event.data2 == 127:
                    mixer.setTrackPan(
                        mixer.trackNumber() + 7,
                        mixer.getTrackPan(mixer.trackNumber() + 7) -
                        paninc)  # volume values go down

                elif event.data2 == 1:
                    mixer.setTrackPan(
                        mixer.trackNumber() + 7,
                        mixer.getTrackPan(mixer.trackNumber() + 7) +
                        paninc)  # volume values go up

        elif ui.getFocused(0) == 0:  # channel rack

            if (event.data1 == muteb):
                channels.muteChannel(channels.channelNumber())  #mute

            if (event.data1 == solob):
                channels.soloChannel(channels.channelNumber())  #solo

            # VOLUME CONTROL

            #knob 1
            if (event.data1 == knob1):
                if event.data2 == 127:
                    channels.setChannelVolume(
                        channels.channelNumber() + 0,
                        channels.getChannelVolume(channels.channelNumber() + 0)
                        - volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelVolume(
                        channels.channelNumber() + 0,
                        channels.getChannelVolume(channels.channelNumber() + 0)
                        + volinc)  # volume values go up

            #knob 2
            if (event.data1 == knob2):
                if event.data2 == 127:

                    channels.setChannelVolume(
                        channels.channelNumber() + 1,
                        channels.getChannelVolume(channels.channelNumber() + 1)
                        - volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelVolume(
                        channels.channelNumber() + 1,
                        channels.getChannelVolume(channels.channelNumber() + 1)
                        + volinc)  # volume values go up

            #knob 3
            if (event.data1 == knob3):
                if event.data2 == 127:
                    channels.setChannelVolume(
                        channels.channelNumber() + 2,
                        channels.getChannelVolume(channels.channelNumber() + 2)
                        - volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelVolume(
                        channels.channelNumber() + 2,
                        channels.getChannelVolume(channels.channelNumber() + 2)
                        + volinc)  # volume values go up

            #knob 4
            if (event.data1 == knob4):
                if event.data2 == 127:
                    channels.setChannelVolume(
                        channels.channelNumber() + 3,
                        channels.getChannelVolume(channels.channelNumber() + 3)
                        - volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelVolume(
                        channels.channelNumber() + 3,
                        channels.getChannelVolume(channels.channelNumber() + 3)
                        + volinc)  # volume values go up

            #knob 5
            if (event.data1 == knob5):
                if event.data2 == 127:
                    channels.setChannelVolume(
                        channels.channelNumber() + 4,
                        channels.getChannelVolume(channels.channelNumber() + 4)
                        - volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelVolume(
                        channels.channelNumber() + 4,
                        channels.getChannelVolume(channels.channelNumber() + 4)
                        + volinc)  # volume values go up

            #knob 6
            if (event.data1 == knob6):
                if event.data2 == 127:
                    channels.setChannelVolume(
                        channels.channelNumber() + 5,
                        channels.getChannelVolume(channels.channelNumber() + 5)
                        - volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelVolume(
                        channels.channelNumber() + 5,
                        channels.getChannelVolume(channels.channelNumber() + 5)
                        + volinc)  # volume values go up

            #knob 7
            if (event.data1 == knob7):
                if event.data2 == 127:
                    channels.setChannelVolume(
                        channels.channelNumber() + 6,
                        channels.getChannelVolume(channels.channelNumber() + 6)
                        - volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelVolume(
                        channels.channelNumber() + 6,
                        channels.getChannelVolume(channels.channelNumber() + 6)
                        + volinc)  # volume values go up

            #knob 8
            if (event.data1 == knob8):
                if event.data2 == 127:
                    channels.setChannelVolume(
                        channels.channelNumber() + 7,
                        channels.getChannelVolume(channels.channelNumber() + 7)
                        - volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelVolume(
                        channels.channelNumber() + 7,
                        channels.getChannelVolume(channels.channelNumber() + 7)
                        + volinc)  # volume values go up

            # PAN CONTROL

            #sknob 1
            if (event.data1 == sknob1):
                if event.data2 == 127:
                    channels.setChannelPan(
                        channels.channelNumber() + 0,
                        channels.getChannelPan(channels.channelNumber() + 0) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelPan(
                        channels.channelNumber() + 0,
                        channels.getChannelPan(channels.channelNumber() + 0) +
                        volinc)  # volume values go up

            #sknob 2
            if (event.data1 == sknob2):
                if event.data2 == 127:

                    channels.setChannelPan(
                        channels.channelNumber() + 1,
                        channels.getChannelPan(channels.channelNumber() + 1) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelPan(
                        channels.channelNumber() + 1,
                        channels.getChannelPan(channels.channelNumber() + 1) +
                        volinc)  # volume values go up

            #sknob 3
            if (event.data1 == sknob3):
                if event.data2 == 127:
                    channels.setChannelPan(
                        channels.channelNumber() + 2,
                        channels.getChannelPan(channels.channelNumber() + 2) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelPan(
                        channels.channelNumber() + 2,
                        channels.getChannelPan(channels.channelNumber() + 2) +
                        volinc)  # volume values go up

            #sknob 4
            if (event.data1 == sknob4):
                if event.data2 == 127:
                    channels.setChannelPan(
                        channels.channelNumber() + 3,
                        channels.getChannelPan(channels.channelNumber() + 3) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelPan(
                        channels.channelNumber() + 3,
                        channels.getChannelPan(channels.channelNumber() + 3) +
                        volinc)  # volume values go up

            #sknob 5
            if (event.data1 == sknob5):
                if event.data2 == 127:
                    channels.setChannelPan(
                        channels.channelNumber() + 4,
                        channels.getChannelPan(channels.channelNumber() + 4) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelPan(
                        channels.channelNumber() + 4,
                        channels.getChannelPan(channels.channelNumber() + 4) +
                        volinc)  # volume values go up

            #sknob 6
            if (event.data1 == sknob6):
                if event.data2 == 127:
                    channels.setChannelPan(
                        channels.channelNumber() + 5,
                        channels.getChannelPan(channels.channelNumber() + 5) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelPan(
                        channels.channelNumber() + 5,
                        channels.getChannelPan(channels.channelNumber() + 5) +
                        volinc)  # volume values go up

            #sknob 7
            if (event.data1 == sknob7):
                if event.data2 == 127:
                    channels.setChannelPan(
                        channels.channelNumber() + 6,
                        channels.getChannelPan(channels.channelNumber() + 6) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelPan(
                        channels.channelNumber() + 6,
                        channels.getChannelPan(channels.channelNumber() + 6) +
                        volinc)  # volume values go up

            #sknob 8
            if (event.data1 == sknob8):
                if event.data2 == 127:
                    channels.setChannelPan(
                        channels.channelNumber() + 7,
                        channels.getChannelPan(channels.channelNumber() + 7) -
                        volinc)  # volume values go down

                elif event.data2 == 1:
                    channels.setChannelPan(
                        channels.channelNumber() + 7,
                        channels.getChannelPan(channels.channelNumber() + 7) +
                        volinc)  # volume values go up
Beispiel #6
0
 def get_volume_line():
     return '    [%d%%]' % int(
         channels.getChannelVolume(channels.selectedChannel()) * 100)
Beispiel #7
0
	def __init__(self, event):
		global proceed
		self.event = event
		global temp_chan
		proceed = False
		self.mode_toggle = Switch.mode_toggle
		# self.mixer_num = mixer.trackNumber()
		self.channel = channels.channelNumber()
		self.round_offset = 0.16
		self.get_track_value = 0
		self.data_one = event.data1 + offset[switch.Switch.offset_iter]
		self.data_two = event.data2
		self.two_rounded = round(self.data_two/127, 2)
		self.plugin = 0
		self.event_one = event.data1
		print('knob class')

		if ui.getFocused(1) and Switch.shift_status == True:
			print('enter step param edit in turning')
			if event.data1 == knob['knob_one']:
				Switch.root_note = int(mapvalues(self.data_two, 0, 11, 0, 127))
				ui.setHintMsg(data.notes_list [int(mapvalues(self.data_two, 0, 11, 0, 127)) ] )
				print(Switch.root_note)
				event.handled = True

			if event.data1 == knob['knob_two']:
				Switch.scale_choice = int(mapvalues(self.data_two, 0, len(data.scale_names)-1, 0, 127))
				ui.setHintMsg(data.scale_names[int(mapvalues(self.data_two, 0, len(data.scale_names)-1, 0, 127))])
				print(Switch.scale_choice)
				event.handled = True

			if event.data1 == knob['knob_three']:
				Switch.lower_limit = int(mapvalues(self.data_two, 0, 25, 0, 127))
				ui.setHintMsg("Setting Lower Limit")
				print(Switch.lower_limit)
				event.handled = True

			if event.data1 == knob['knob_four']:
				Switch.upper_limit = int(mapvalues(self.data_two, 50, 0, 0, 127))
				ui.setHintMsg("Setting Upper Limit")
				print(Switch.upper_limit)
				event.handled = True

		elif ui.getFocused(5) and plugins.isValid(self.channel):
			print('plugin control')
			self.plugin_control()

		elif ui.getFocused(0) and proceed == False:						# This stores the current value at the destination of the knob
			# print('proceed false mixer focused')
			if Switch.mixer_num == 0:
				if mixer.trackNumber() == 0:								# Check if master is selected
					self.get_track_value = mixer.getTrackVolume(0)
				else:		
					self.get_track_value = mixer.getTrackVolume(self.data_one - 19) 

			elif Switch.mixer_num == 1:
				# print('store panning info')
				self.get_track_value = mixer.getTrackPan(self.data_one-19)
				print(self.get_track_value)
				self.two_rounded = mapvalues(self.data_two, -1.0, 1.0, 0, 127)
				print(self.two_rounded)

		elif ui.getFocused(1) and Switch.shift_status == False:
			# print('stored channel')
			if self.mode_toggle != 1 and self.mode_toggle != 3:
				if self.data_one-20 < channels.channelCount():
					self.get_track_value = channels.getChannelVolume(self.data_one-20) 
			else:
				# print('go to step parameter function')
				self.step_param()


	
																					# Knob must match current value before it engages.
		if self.two_rounded <= (self.get_track_value + self.round_offset) and self.two_rounded >= (self.get_track_value - self.round_offset):
			print("matched") 
			proceed = True
			temp_chan = self.data_one
			# print(f'temp chan:  {temp_chan}')
			if switch.Switch.mode_toggle != 1 and Switch.mode_toggle != 3 or ui.getFocused(1)==False:
				# print('enter knob turn function')
				self.knob_turn()