Skip to main content

A Python implementation of a StagelinQ protocol

Project description

Build Status PyPI - Python Version PyPi version PyPI - License Read the Docs Codecov CodeFactor Code style: black

Overview

This Python module decodes part of the StageLinQ protocol used by Denon DJ equipment. In its current state it is possible to read out information like track information, fader position (Crossfader, channel volume, pitchfader), BPM etc. The project also includes a description of how StageLinQ works taking from my findings as well as other code available.

This module can be used to receive this information from a device via a callback when data is available.

There is also a Wireshark Dissector that I made during my trials.

Status

An initial implementation of parts of the protocol has been done, but there is still much left to do. As the code should be at least somewhat functional I've decided to release this as is and add functionality along the way. Since I'm unsure where this is heading there is a possibility that there will be a future (major) version that will reimagine the functions completely.

The next few versions will probably be patched to bring the documentation up to date.

Documentation

Documentation is available on readthedocs.io

Installation

pip install PyStageLinQ

Issue tracking

If you find an issue, please report check known issues, and if the issue is not mentioned please report it here

Example usage

Here follow an example of how PyStageLinQ can be used:

from PyStageLinQ import EngineServices, PyStageLinQ
PrimeGo = None

# Callback for when PyStageLinQ as found a StageLinQ device. This will print out information about the found device
# and if lets the user decide if they want to subscribe to a service or not.

def new_device_found_callback(ip, discovery_frame, service_list):
    # Print device info and supplied services
    print(
        f"Found new Device on ip {ip}: Device name: {discovery_frame.device_name}, ConnectionType: {discovery_frame.connection_type}, SwName: {discovery_frame.sw_name}, "
        f"SwVersion: {discovery_frame.sw_version}, port: {discovery_frame.Port}")

    if len(service_list) > 0:
        print("Services found in device:")
    else:
        print("No services found")

    for service in service_list:
         print(f"\t{service.service} on port {service.port}")


    # Request StateMap service
    for service in service_list:
        if service.service == "StateMap":
            PrimeGo.subscribe_to_statemap(service, EngineServices.prime_go, state_map_data_print)

            
# Callback for when data has arrived from a StageLinQ device. It is up to the user what to do with this information.
            
def state_map_data_print(data):
    for message in data:
        print(message)

# Example main function, starting PyStageLinQ.
if __name__ == "__main__":
    global PrimeGo
    
    # Run PyStageLinQ on all available network interfaces
    PrimeGo = PyStageLinQ.PyStageLinQ(new_device_found_callback, name="Jaxcie StagelinQ")
    PrimeGo.start()

Wireshark dissector

When I developed this code I made a WireShark Dissector, it is included in this repo. Do note that this dissector isn't properly tested and may cause unexpected issues. As this file is not part of the Pythoncode in PyStageLinQ it can be found on GitHub

Compatability

PyStageLinQ has been tested with a Denon DJ Prime Go on Windows 11 and Linux (Mint 22.2) with Python 3.10.

Acknowledgements

Big thanks to icedream for his implementation of StageLinQ in go: https://github.com/icedream/go-stagelinq

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

pystagelinq-0.2.2.dev5.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

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

pystagelinq-0.2.2.dev5-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file pystagelinq-0.2.2.dev5.tar.gz.

File metadata

  • Download URL: pystagelinq-0.2.2.dev5.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for pystagelinq-0.2.2.dev5.tar.gz
Algorithm Hash digest
SHA256 05367162a5edb2cca664a58f8a136c3e256fd1dfc05a38d30ac0b0cdbd88c45b
MD5 3be4605605d11ee656fb16f2713fabaa
BLAKE2b-256 5efce4fb91f6aad560f56f10cb7ba648cbaea92ed7451ae2b94b5c18c44a0e4e

See more details on using hashes here.

File details

Details for the file pystagelinq-0.2.2.dev5-py3-none-any.whl.

File metadata

File hashes

Hashes for pystagelinq-0.2.2.dev5-py3-none-any.whl
Algorithm Hash digest
SHA256 a85d76194d3772dc9ccb10b3d3400e1f767748919f7237c23118508e3fbe86f2
MD5 094815b5d4099cdd28cfc8f4be815267
BLAKE2b-256 f53d290a8528976aecded03e9ce00bd90c808034a63b1ba9f4bc9ec63a5c6ab3

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