This Python script connects to a QLC+ WebSocket server, enabling automated DMX control and dynamic 3D visualization. It maps DMX pan and tilt values to visualize beam direction, movement paths, and a beam spread cone in real time.
Note: Interactive keyboard control via arrow keys (
pynput
) can also be integrated if desired.
- Dynamic IP Detection: Automatically finds your computer’s IP.
- WebSocket Connection: Connects seamlessly to QLC+ at
ws://<LOCAL_IP>:9999/qlcplusWS
. - DMX Mapping: Converts DMX pan/tilt values into 3D beam direction vectors.
- 3D Visualization:
- Scatter plot of beam directions.
- Great circle reference path visualization.
- Animated marker displaying live DMX positions.
- Real-time rendered beam spread cone.
- Automatic Movement: Oscillates pan from 0°–360° with fixed tilt to demonstrate scanning.
- Graceful Exit: Safely terminates simulation with
Ctrl+C
.
.
├── dmx_control.py # Main script for DMX control and visualization
├── keypad.html # Optional keypad HTML interface
├── qlight_workspace.qxw # QLC+ workspace configuration
├── README.md # Project documentation
└── requirements.txt # Dependencies list
Requires Python 3.x
Install dependencies:
pip install -r requirements.txt
- Install QLC+ software.
- Enable web interface with:
qlcplus -w
(Default WebSocket port: 9999)
- Clone/download the project.
- Install dependencies:
pip install -r requirements.txt
- Run the script:
python dmx_control.py
- Visualization appears automatically. Press
Ctrl+C
to exit.
Connected to QLC+ WebSocket at ws://192.168.1.50:9999/qlcplusWS.
Sent: CH|1|178
Sent: CH|3|0
...
Movement interrupted by user.
WebSocket closed.
- certifi
- charset-normalizer
- idna
- requests
- urllib3
- websocket-client
- pynput
Install with:
pip install -r requirements.txt
- Dynamic IP Detection:
get_host_ip()
retrieves the local IP via UDP. - DMX-to-XYZ Mapping: Converts DMX values to 3D vectors.
- Visualization:
- DMX grid converted to a 3D scatter field.
- Plots reference great circle.
- Animates beam marker and cone visualization.
- Automatic DMX Movement: Continuously updates pan for simulation.
- Graceful Termination:
KeyboardInterrupt
closes WebSocket safely.
Distributed under the MIT License. Modify and distribute freely.