1.2 KiB
1.2 KiB
MIDI-to-Hue Controller
A modular Python application for controlling Philips Hue lights with MIDI controllers.
Features
- Map MIDI notes and control changes to Hue light parameters
- Throttled updates to prevent overwhelming the Hue Bridge
- Configurable mappings via JSON
- LED feedback support for controller visualization
- Customizable value transformations
Structure
This application has been refactored to follow modular design principles:
config.py- Configuration management modulehue_controller.py- Philips Hue bridge and light controlmidi_controller.py- MIDI device managementmapper.py- Mapping logic between MIDI and Huemain.py- Application entry point
Usage
- Connect your MIDI device
- Edit
midi_hue_config.jsonto configure your mappings - Run
python main.py
Configuration
The default configuration file (midi_hue_config.json) contains:
{
"midi_device": 1,
"update_interval_ms": 50,
"bridge_ip": "192.168.178.35",
"mappings": [
{
"midi_channel": 5,
"midi_control": 1,
"light_name": "Zimmer Decke",
"parameter": "bri",
"value_transform": "value * 2"
},
...
]
}
Dependencies
- mido
- phue