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
  • AKG
    Microphones Wireless Integrated Systems Automatic Mixers Headphones Discontinued Products (AKG) General AKG Inquiries Certifications (AKG) Video Manual Series (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) Video Manual Series (AMX) General AMX Inquiries Certifications (AMX)
  • BSS
    Soundweb™ Omni Soundweb™ London Soundweb™ Contrio™ Software (BSS) Discontinued Products (BSS) Video Manual Series (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) Video Manual Series (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
  • BSS
  • Video Manual Series (BSS)

Python - Imports | MUSE

Video Manual Series


Written by Felipe Guerrero

Updated at August 20th, 2026

In this video, you’ll learn how to properly manage imports when writing Python code for an AMX MUSE controller.  We’ll cover why the mojo library and context import are essential for interacting with the system, along with how to work with built-in and external libraries.  You’ll also see how to resolve IDE warnings by pulling program type definitions directly from the controller.  By the end, you’ll understand how to structure your imports for clean, reliable, and scalable MUSE programming.

What You’ll Learn:
• Understanding the role of imports in MUSE Python programs
• Using the mojo library and context for system interaction
• Managing built-in vs.  external Python libraries
• Resolving IDE warnings with controller-provided type definitions
• Organizing imports for readability and scalability
• Best practices for maintaining clean and reliable code

Transcript
Hello, and welcome to this video on using imports in Python on your MUSE controller.   One of the benefits of using Python is the vast number of libraries that exist in the world to make your coding easier.   In this video we will discuss importing the mojo package and context class, rules to using libraries, and how to incorporate non-standard libraries into your code.
Let’s start this video by looking at the default Python script that is generated when you create a MUSE local program.   
The first line of any Python script that directly interfaces with the MUSE controller must begin with the line “from mojo import context”.   This import incorporates everything that “is” a MUSE controller.   Without this, your code couldn’t communicate with the MUSE controller or utilize the MUSE controller to communicate with Harman products or other 3rd party devices.
If you notice, you receive a warning when referencing mojo.   This is because the mojo package does not exist in the language server that is referenced in the IDE.   The only place mojo exists is on the MUSE controller itself.   Keep in mind, this is just a warning, and it will not keep your script from running once it is loaded to the controller.   

 
If you want to get rid of the warning, you can download the program type definitions from the MUSE controller so the IDE can better understand the mojo package and context.   
While connected to your controller, right-click on the empty space of the file explorer and select “Fetch program type definitions”.   At the top of the screen, it will ask you to select the controller you would like to fetch them from.   Click on the controller from the list, and the download will begin.   
Notice that a new folder named mojo has been created in your program folder, and the warning that was in your code has been removed.   The mojo folder contains a Python interface file named __init__.   This file is created at runtime and contains the definitions for all the devices, scripts, drivers, and extensions the muse controller is aware of at the time of the download, so the file can be very large.   This file will be used as a reference by the language server.   It is important to remember that this file should not be edited.
When it comes to importing other classes and libraries, you should know that the currently installed version of Python on the MUSE controller is version 3.1.   This means that any built-in functions of the language that exist in the Python Standard Library for that version can be imported into your script.   This includes things like urllib, json, math, and datetime.
Any libraries that exist outside of the Python Standard Library can still be used if they are supported at that version.   The Python file you are importing should be saved in your program folder and loaded to the controller along with your main Python script.   Keep in mind, your imported library can only contain Python files.   Libraries that require dependencies built using C, C++, or other languages cannot be imported in this way.
More complicated libraries can be added to your scripts using Python Virtualization.   We will discuss this process in another video.

Related Videos

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • Connecting - First Connection | MUSE
  • MUSE VMS Code

Related Articles

  • Connecting - First Connection | MUSE
  • MUSE VMS Code
Copyright © HARMAN Professional. All rights reserved. Privacy Policy | Terms of Use
Expand