Anytime Help Center

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Support
  • Guest
  • Log In
English (US)
US English (US)
DE German
CN Chinese
MX Spanish (Mexico)
Chinese (Simplified)
  • AKG
    Microphones Wireless Integrated Systems Automatic Mixers Headphones Discontinued Products (AKG) General AKG Inquiries Certifications (AKG)
  • AMX
    Networked A/V Distribution (AVoIP) Traditional A/V Distribution Video Signal Processing Architectural Connectivity User Interfaces Control Processing Power (AMX) Programming (AMX) Software (AMX) Discontinued Products (AMX) General AMX Inquiries Certifications (AMX)
  • BSS
    Soundweb™ Omni Soundweb™ London Soundweb™ Contrio™ Software (BSS) Discontinued Products (BSS) General BSS Inquiries Certifications (BSS)
  • Crown
    CDi DriveCore Series CDi Series Commercial Series ComTech Series DCi DriveCore Series I-Tech HD Series XLC series XLi Series XLS DriveCore 2 Series XTi 2 Series Discontinued Products (Crown) Software (Crown) General Crown Inquiries Certifications (Crown)
  • dbx
    CX Series 500 Series DriveRack Personal Monitor Control ZonePRO Zone Controllers FeedBack Suppression Microphone Preamps Dynamics Processors Crossovers Equalizers Software (dbx) Discontinued Products (dbx) General dbx Inquiries Certifications (dbx)
  • Flux::
    Immersive Processing Analysis Subscriptions General FLUX: Inquiries
  • JBL
    Cinema Sound Installed Live Portable Tour Sound Recording & Broadcast Software (JBL) Discontinued Products (JBL) Video Manual Series (JBL) General JBL Inquiries Certifications (JBL)
  • Lexicon
    Plugins Effects Processors Cinema Discontinued Products (Lexicon) Video Manual Series (Lexicon) General Lexicon Inquiries Certifications (Lexicon)
  • Martin
    Atomic ELP ERA Exterior MAC P3 VC VDO Tools Discontinued Products (Martin) General Martin Inquiries Certifications (Martin)
  • Soundcraft
    Digital Analog Connected Analog Only Discontinued Products (Soundcraft) Video Manual Series (Soundcraft) General Soundcraft Inquiries Certifications (Soundcraft)
  • General HARMAN Inquiries
    Dante
+ More
  • Home
  • AMX
  • Software (AMX)
  • MUSE Automator & Extension for VS Code

Touch Panel Array for MUSE

Technical Support Guide

Written by Will Fraser

Updated at February 19th, 2026

Table of Contents

Brand: Models: Overview: Code Example:  Note:

Brand:

  • AMX

Models:

  • MUSE 

Overview:

The code below utilizes a touch panel array to quickly create many button watch events.  The watch events can be processed by the same callback function by processing the event to determine where the button event came from and what panel was used.  That information is passed to another function to update all buttons in the array when an action occurs on another panel.


Code Example: 

Note: 

Because this process can create so many buttons quickly and easily, it is important to note that watches cannot be created for a button that does not exist.  This will cause an exception in the code that will stop the code running on the controller.

 

 


from mojo import context

context.log.info('Sample Python program')


#Gather the context for your devices
dvVaria = context.devices.get("AMX-11241")
dvVaria2 = context.devices.get("AMX-11242")

#Put the objects in an array
dvTPs = [dvVaria,dvVaria2]

#Group ports and buttons numbers that you would create watches for
ports = [1,2]
transportButtons = [1,3,4]
menuButtons = [5,18,22]

#This dictionary creates a reverse lookup for when a button event returns the name of the device and not the object reference
device_lookup = {
    "AMX-11241": dvVaria,
    "AMX-11242": dvVaria2
}


#This function updates all other panels with the same state as the panel that originated the press
def setOtherPanels(originatingDevice, port_number, id, value):
    for panel in dvTPs:
        if panel == originatingDevice:
            continue
        panel.port[port_number].channel[id].value = value


#This function parses/gathers information from the event including port numbers, originating device object, and id (button/channel number) pressed
#This function could be re-used for all button events
def processButtonEvent(event):
    path_parts = event.path.split('/')
    port_index = path_parts.index("port") + 1
    port_number = int(path_parts[port_index])

    originatingDevice = device_lookup.get(event.device,None)

    id = int(event.id)

    return{
        "port_number": port_number,
        "id": id,
        "originatingDevice": originatingDevice
    }


#Function takes in button presses from the transportButtons array of button numbers
def processTransportButtons(event):

#The button is sent to the processButtonEvent function to gather its information and save it to event_info
    event_info = processButtonEvent(event)

#Notice all of the values are referenced by the return dictionary reference i.e. event_info[" *dictionary entry* "]
    if(event.value):
        event_info["originatingDevice"].port[event_info["port_number"]].channel[event_info["id"]].value = True
        setOtherPanels(event_info["originatingDevice"],event_info["port_number"],event_info["id"],True)

    else:
        event_info["originatingDevice"].port[event_info["port_number"]].channel[event_info["id"]].value = False
        setOtherPanels(event_info["originatingDevice"],event_info["port_number"],event_info["id"],False)


#Function processes button events from the menuButtons array
#In this exaple the buttons do the same thing as in the processTransportButtons callback
def processMenuButtons(event):
    
    event_info = processButtonEvent(event)
   
    if(event.value):
        event_info["originatingDevice"].port[event_info["port_number"]].channel[event_info["id"]].value = True
        setOtherPanels(event_info["originatingDevice"],event_info["port_number"],event_info["id"],True)

    else:
        event_info["originatingDevice"].port[event_info["port_number"]].channel[event_info["id"]].value = False
        setOtherPanels(event_info["originatingDevice"],event_info["port_number"],event_info["id"],False)


#The next two for loops create a watch for each button in the transportButtons and menuButtons arrays
#The watches are created for each panel and each port, in total, each 4 line loop creates 12 watches
for panel in dvTPs:
    for portnumber in ports:
        for channel in transportButtons:
            panel.port[portnumber].button[channel].watch(processTransportButtons)

for panel in dvTPs:
    for portnumber in ports:
        for channel in menuButtons:
            panel.port[portnumber].button[channel].watch(processMenuButtons)            




# leave this as the last line in the Python script
context.run(globals())

Related Videos

framework model

Was this article helpful?

Yes
No
Give feedback about this article

Table of Contents

Brand: Models: Overview: Code Example:  Note:

Related Articles

  • Visual Studio Code Notifications
  • Enable Automator (Node-RED) in MUSE
  • Hex String to IP device in Muse Automator
  • Muse Automator Toggle Example
  • Muse Automator: send strings to TCP device example

Related Articles

  • Visual Studio Code Notifications
  • Enable Automator (Node-RED) in MUSE
  • Hex String to IP device in Muse Automator
  • Muse Automator Toggle Example
  • Muse Automator: send strings to TCP device example
Copyright © HARMAN Professional. All rights reserved. Privacy Policy | Terms of Use
Expand