Skip to main content

A package to control Allen & Heath SQ mixers via MIDI

Project description

SQ MIDI

Library to control Allen & Heath SQ Mixers via MIDI

Installation & Setup

pip install sq-midi

On the mixer, go to Utility -> General -> MIDI and set 'NRPN Fader Law' to Audio Taper. This is currently the only supported option, however the linear taper may be added in the future.

Usage

To connect to the mixer's MIDI interface, the Allen & Heath MIDI Control application can be used. When in MIDI Thru mode, two virtual MIDI ports will be created, one input and one output, both named MIDI Control 1. This allows a connection to the mixer either via a physical USB cable, or over a network connection using TCP.

Basic Example

from sq_midi import Mixer

# Initialise mixer
mixer = Mixer()

# Get Input 1 (Ip1)
ip1 = mixer.inputs.ip1 # or mixer.inputs[1]

# Mute
ip1.mute()

# Set level to 100% (0dB)
ip1.level = 100

Detailed Usage

The Mixer class is the starting point, and handles the connection to the mixer, as well as providing interfaces for the various channels and mixes.

Each channel or mix has various attributes, including assignments, levels, and panning, which can be used to set the appropriate parameters on the mixer. Please note that not all mixes have all parameters.

To get/set specific parameter, the appropriate interface should be used e.g. mixer.inputs[1].assignments.aux[1]. All indexes refer to the channel/mix numbers, so aux[1] refers to Aux 1.

Mixer setup

from sq_midi import Mixer

mixer = Mixer(
    input_name = "MIDI Control 1", # Input MIDI port name
    output_name = "MIDI Control 1", # Output MIDI port name
    channel = 0, # MIDI channel to use
    debug = False # Enable debug logging
)

Input channels

Each input channel can be accessed using the mixer.inputs interface. They can be accessed either by name e.g. mixer.inputs.ip14 or by number e.g. mixer.inputs[14].

  • Number of channels: 48

  • Channel prefix: ip, e.g ip34

  • Available options:

    • level - master level
    • pan - master panning
    • assignments - assignments
      • aux - auxes
      • groups - groups
      • fx- FX Sends
      • lr - LR (default for level and pan)
    • panning - panning
      • aux
      • groups
      • fx
      • lr

Example:

ip1 = mixer.inputs.ip1 # or ...inputs[1]

print(ip1.name) # Ip1
print(ip1.number) # 1

# Mute
ip1.mute()
ip1.unmute()
print(ip1.muted) # True or False
ip1.muted = True # Same as ip1.mute()

# Master Level
ip1.level = 100 # range [0 to 200] % equivalent to [-inf to +10] dB

# Master Panning
print(ip1.pan) # -100 to 100
ip1.pan = 0 # Center
ip1.center() # Same as ip1.pan = 0
ip1.pan = 100 # Full right
ip1.pan = -100 # Full left

# Routing Assignments - available: aux, groups, fx, lr 
print(ip1.assignments.aux[3]) # True / False
ip1.assignments.aux[1] = True # Assign to Aux1
ip1.assignments.groups[3] = True # Assign to Grp3
ip1.assignments.fx[1] = True # Assign to FX1Send
ip1.assignments.lr = False # Unassign from LR

Main LR Output

The main LR channel can be accessed using mixer.lr.

Available options:

  • level - master level
  • mute
  • pan
  • assignments - assignments
    • mtx - matrices
  • panning
    • lr - (default)

Example:

lr = mixer.lr

# Assignments - available: mtx (Matrices)
lr.assignments.mtx[1] = True # Assign to Matrix 1

Groups

Example:

grp1 = mixer.groups[1]

# Assignments - available: lr, mtx, fx, aux
grp1.assignments.aux[1] = True # Assign to aux1

Auxes

Example:

"""Aux"""
aux1 = mixer.aux[1]

# Levels
aux1.levels.lr = 100 # Same as aux1.level = 100

# Assignments - available: mtx (Matrices)
aux1.assignments.mtx[3] = True # Assign to Matrix 3

DCAs

DCA channels use the mixer.dca interface, and allow the 'remote' control of multiple channels. The MIDI protocol allows the level and mute of a DCA to be controlled.

Available options:

  • level - DCA level
  • mute - DCA mute

Example:

dca1 = mixer.dca.[1]

dca1.level = 100

FX Sends

FX Sends can be accessed using mixer.fxsends.

Available options:

  • level - level
  • mute - mute

Example:

fx1send = mixer.fxsends[1]

# Level
fx1send.level = 50 # 50%

*FX Returns

FX Returns can be accessed using mixer.fxreturns.

Available options:

  • level
  • mute
  • pan
  • assignments
    • lr
    • aux
    • groups
  • panning
    • lr (default)
    • aux
  • levels
    • lr - (default)
    • aux

Example:

fx1return = mixer.fxreturns[1]

# Levels
fx1return.level = 200 # 200% (+10dB)
fx1return.levels.aux[4] = 100 # 100% (0dB)

# Assignments
fx1return.assignments.aux[4] = True

# Panning
fx1return.panning.aux[4] = 100

Matrices

Available options:

  • mute
  • level
  • pan

Example:

mtx1 = mixer.matrices[1]

# Level
mtx1.level = 100

# Panning
mtx1.panning = -100 # Full left

Mute Groups

Mute groups are accessed using mixer.mutegroups. The assignment of channels to a mute group must be defined within the mixer, using 'Routing' -> 'Mute Assign' for the desired channels.

Available options:

  • mute

Example:

"""Mute group"""
mgrp1 = mixer.mutegroups[1]

mgrp1.mute()
mgrp1.unmute()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sq_midi-0.0.6.tar.gz (403.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sq_midi-0.0.6-py3-none-any.whl (409.1 kB view details)

Uploaded Python 3

File details

Details for the file sq_midi-0.0.6.tar.gz.

File metadata

  • Download URL: sq_midi-0.0.6.tar.gz
  • Upload date:
  • Size: 403.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for sq_midi-0.0.6.tar.gz
Algorithm Hash digest
SHA256 fce558f51fa6419e85f7c44306470825ae31f561ee4ef403b48a7349105e477e
MD5 e1e6d600f030002836c5f66561bff433
BLAKE2b-256 a4308ff5b3b0acb7c41e4e4e31cae19b57331c49bbd0a61c34ef2a93c277e53a

See more details on using hashes here.

File details

Details for the file sq_midi-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: sq_midi-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 409.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for sq_midi-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 740622f8ad3901a7f43454c346dbf56950daafcf28c30b8d4f78f818e0dfd179
MD5 8891e40a4264c5da5cb3edfd9093aa3f
BLAKE2b-256 10ac7d51bdbf1ad0677e551a306ec32caeea1b9b1674f5814302ece1edbaf407

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page