Skip to main content

A Python Lib to create a DMX compatible OSC server with handlers

Project description

DMX OSC Server

DMX OSC Server is a python lib to make it easier to create OSC Servers for the DMX Protocol.

It allows you to register fixtures are the wanted universe, starting address and channels. You will also be able to add an handler which will be called when a message is received for that fixture.

Installation

pip install DmxOscServer

Get Started

To create a simple DMX OSC Server that will listen on 0.0.0.0:9000 you can use this code:

from DmxOscServer import DmxOscServer, Fixture

def my_rgb_handler(fixture, address, *args):
    fixture.values[address] = args[0]
    print (fixture.values)

server = DmxOscServer()
server.add_fixture(Fixture(0, 0, 3, my_rgb_handler)) # Register a 3 channel Fixture at address 0 of universe 0
server.run()

To change the IP and/or port, you can add them to the DmxOscServer initializer

server = DmxOscServer("10.10.123.5", 1234) # Will listen on 10.10.123.5:1234

You can add multiple fixtures at once using:

server = DmxOscServer()
server.add_fixtures(
    Fixture(0, 0, 3, my_rgb_handler), # Register a 3 channel Fixture at address 0 of universe 0
    Fixture(0, 3, 3, my_rgb_handler), # Register a 3 channel Fixture at address 3 of universe 0
)

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

DmxOscServer-1.0.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

DmxOscServer-1.0.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file DmxOscServer-1.0.0.tar.gz.

File metadata

  • Download URL: DmxOscServer-1.0.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.3

File hashes

Hashes for DmxOscServer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c71603c4bf4b1352b696bd1f0ab9445692b9b29f5a6f9c85e50c679dca279822
MD5 ce32c159db3cd3559aba64161d8a6ef0
BLAKE2b-256 031bfe00f6f7e0523956f2741e1e9a12814b3b580935a32df61f66b809e47c3a

See more details on using hashes here.

File details

Details for the file DmxOscServer-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for DmxOscServer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7ed8a64d21279c3731eddb3d0fe981b4665cca6d4e5c04528eb2f0d9865606f4
MD5 93225a27ad1fb9878e3e6b101aaae0b1
BLAKE2b-256 6d3681e47af783dbc2f6612b2a379cb9184b176f250917aa648900fda3e6b4b5

See more details on using hashes here.

Supported by

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