Skip to content
This repository was archived by the owner on Jan 2, 2023. It is now read-only.

Miscellaneous Functionality

HDSQ edited this page Jan 24, 2021 · 3 revisions

Shift Menus

To access alternate functions in your event processors, you may want to check the state of shift menus. To do that, use the following function:

if internal.shifts["MAIN"].query():
    # The main shift menu is active.
    pass

Note that you can access the states of other shift menus by changing the key string to one of the available options:

  • "MAIN"
  • "RECORD"
  • "DEBUG"

Although it is suggested to link extended functions only to the main shift menu to aid in simplicity.

To use a shift button (ie prevent that shift button from having the default action when released), use the following function:

if internal.shifts["MAIN"].use():
    # The main shift menu is active, and we used the shift button.
    pass

Extended Modes

To set/query extended modes for the controller, use the object internal.extendedMode.

extendedMode.setVal()

Set the extended mode for an option.

Arguments:

  • new_mode (bool): On or Off
  • option (event ID): the extended mode setting to change. Can be:
    • eventconsts.INCONTROL_KNOBS
    • eventconsts.INCONTROL_FADERS
    • eventconsts.INCONTROL_PADS
  • force (bool): Whether the change should be forced (overrides error state). Don't change this.
  • from_internal (bool): Whether the change was triggered by the script, or by the controller. Don't change this.

Example usage:

# Set the extended mode for faders to True
extendedMode.setVal(True, eventconsts.INCONTROL_FADERS)

extendedMode.query()

Query the extended mode for an option.

Arguments:

  • option (event ID): the extended mode setting to change. Can be:
    • eventconsts.INCONTROL_KNOBS
    • eventconsts.INCONTROL_FADERS
    • eventconsts.INCONTROL_PADS

Example usage:

# Store the extended mode of the drum pads in a variable
variable = extendedMode.query(eventconsts.INCONTROL_PADS)

extendedMode.revert()

Revert the extended mode for an option to its previous values.

Arguments:

  • option (event ID): the extended mode setting to change. Can be:
    • eventconsts.INCONTROL_KNOBS
    • eventconsts.INCONTROL_FADERS
    • eventconsts.INCONTROL_PADS

Example usage:

# Revert the extended mode for knobs.
extendedMode.revert(eventconsts.INCONTROL_KNOBS)

Clone this wiki locally