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
  • Programming (AMX)
  • Programming

Basic MUSE Program

Technical Support Guide

Written by Jose Liberio Cruz

Updated at February 19th, 2026

Table of Contents

Brand: Models: Overview:

Brand:

  • AMX

Models:

  • Muse Controllers

Overview:

The following MUSE code is written in Python.  This code is a very simple example of using Python.  It contains a single button that turns a relay on and off.  The comments within the code explain the uses of each section, and in many case, they include information on how each section of code ​​relates to a Netlinx program.

#This line is used in all Python projects
#Tells the MUSE controller to import the context class from Mojo (MUSE platform)
from mojo import context
#Sets the log base log level for the program
context.log.level = "INFO"
#This prints out a message to the standard out of VSCode as long as the log
#level is set to INFO or higher
context.log.info("Program starting")
#Context is the class that contains much of the information related to the MU
#including creating, querying, and identifying devices  
#this line queries the MU if it has a device named dvTP
if(context.devices.has("dvTP")):
   #If dvTP exists, the next line creates an object named dvTP that is loaded with
   #all of the data the controller has about dvTP    
   dvTP = context.devices.get("dvTP")
#This check will determine if idevice exists on the processor, the idevice is like the 5001
#device in Netlinx.  It handles all local devices including serial, I/O, relay, and IR ports.
if(context.devices.has("idevice")):
   #If the device exists, we will create an object to contain all of the information relating to idevice
   idevice = context.devices.get("idevice")    
#Prints out a message to the standard out of VSCode, these messages are good because
#it allows you to see what point your code is at and if it successfully made it to this point.
#This would be considered the end of the old DEFINE_DEVICE section of a Netlinx program  we just print this out to let us know the 
#program has made it this far.
context.log.info("DEFINE_DEVICE Complete")
#This creates a variable named relay1 that will be used to represent the first relay by referencing the idevice object's relay array using idevice.relay[0]
relay1 = idevice.relay[0]
#Creates a callback function named buttonEvent that is passed the event object from the watch 
#that calls the function.  This would be akin to the PUSH
def buttonEvent(event):
   #The following lines print out a dictionary of the event object, this will show you the kind of information you 
   #can receive from the event.
   dictionaryPrint = str(event.__dict__)
   context.log.info(dictionaryPrint)
   #Output example: {'source': , 'id': '1', 'path': 'port/1/button/1', 'value': True, 'newValue': True, 'oldValue':False}
   #This if statement evaluates the current state of value in the object.  If it is True, that is considered to be a PUSH,
   #if the value is False, that is a RELEASE of the button.
   if(event.value):
       #Prints out a simple string to the standard out
       context.log.info("PUSH on button 1")
       #This if statement evaluates the state of Relay 1 on the MU controller, if it is on we will turn it off as well as turn the button off and vice versa for when it is off
       if(relay1.value):
           #This sets the value for Relay 1 to false, thus disabling the Relay.
           relay1.value = False
           #When we turn off the Relay, we also want to show it on the touch panel.  Setting the channel on the button to False will change the button on the panel to the "OFF" state
           #This is similar to doing OFF[dvTP,1] in Netlinx
           dvTP.port[1].channel[1].value = False
       
       else:
           #This sets the value for relay1 to True, doing this will turn on Relay 1 on the MU controller, this is similar to doing ON[dvrelay,1] in Netlinx
           relay1.value = True
           #When we turn on the Relay, we also want to show it on the touch panel.  Setting the channel on the button to True will change the button on the panel to the "ON" state
           #This is similar to doing ON[dvTP,1] in Netlinx
           dvTP.port[1].channel[1].value = True
   
   #We are not going to trigger anything based on the RELEASE of the button, but this log statement will at least inform us the event has occurred
   else:
       context.log.info("RELEASE on button 1")
       

#This line creates a 'watch' for button 1 on port 1 of dvTP,
#this is very similar to creating a BUTTON_EVENT in Netlinx studio.
#When any 'event' is triggered by that button (push/release), the event object is passed on to a 
#callback function named buttonEvent that will process the event itself.
#The line is placed under the actual function definition, because without it the 
# program doesn't recognize buttonEvent.
dvTP.port[1].button[1].watch(buttonEvent)
#Lets you know that the program has loaded completely
context.log.info("Program loaded completely!!!")
#This last line must be included for the program to continue running.
context.run(globals())

Related Videos

framework blueprint

Was this article helpful?

Yes
No
Give feedback about this article

Table of Contents

Brand: Models: Overview:

Related Articles

  • AMX Subroutine Name Length
  • How To Send DGX Shell Commands From NetLinx Code
  • How to use #IF_DEFINED to set pre-compile conditions
  • Using a NetLinx Master to Monitoring a System
  • Using an Active Bargraph to Control Levels by Touching the Bargraph

Related Articles

  • AMX Subroutine Name Length
  • How To Send DGX Shell Commands From NetLinx Code
  • How to use #IF_DEFINED to set pre-compile conditions
  • Using a NetLinx Master to Monitoring a System
  • Using an Active Bargraph to Control Levels by Touching the Bargraph
Copyright © HARMAN Professional. All rights reserved. Privacy Policy | Terms of Use
Expand