Skip to main content

A program that allows controlling Philips Hue lights using a midi keyboard.

Project description

philips-hue-midi

Overview

Control your Philips Hue lights with your piano. This project is inspired by the perceptual phenomenon of Synesthesia. See it in action below:

Getting Started

What You'll Need

  • Philips Hue Lights & Bridge
  • A MIDI Keyboard

Installation & Setup

  1. Connect your MIDI Keyboard: Attach your MIDI keyboard to your computer and ensure it's powered on.

  2. Configuration: Copy the config.example.toml as config.toml. Set lights under channels.0 (master channel) to the list of Philips Hue Lights you want to control. See full-config.example.toml for a full list of configuration options.

  3. Run Program: Navigate to project root and install the necessary dependencies using uv:

    uvx philips-hue-midi [config.toml]
    

Technical Details

The program samples incoming MIDI events sixty times per second (defined by SAMPLE_RATE). Controllers are responsible for taking this list of midi events (of variable size, M) and converting them to a list of midi events of size N, where N is the number of channels. These channels are defined in the config.toml file and are collections of lights and their configurations.

Currently, the default controller is the note_controller which takes in M notes and maps to 12 channels, based on pitch class. For example, the first channel will be activated if the note C is played, the second channel for C#, and so forth. Therefore, your configuration should have 12 channels.

Note that channel 0 is the master channel and is used for turning lights on or off and is the default fallback channel if the controller outputs a channel not configured. All lights you wish to control should be included in this channel.

Notes

You may have to set the MIDO_DEFAULT_INPUT environment variable to the name of your MIDI device if the correct midi device is not automatically detected. You can find the name of your MIDI device by running: bash uv run mido-ports.

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

philips_hue_midi-2.1.4.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

philips_hue_midi-2.1.4-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file philips_hue_midi-2.1.4.tar.gz.

File metadata

  • Download URL: philips_hue_midi-2.1.4.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for philips_hue_midi-2.1.4.tar.gz
Algorithm Hash digest
SHA256 bff0b9fd33b4b7cdd060e80663db5e969c5bb55ce57a3533d3f9038c2a9e16c1
MD5 536d7951309c85fade674084fca23753
BLAKE2b-256 7d5579b85ca3b86ff2e495611b93e7917f680cddbd58bfced5cd90a6fdb2d6c0

See more details on using hashes here.

File details

Details for the file philips_hue_midi-2.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for philips_hue_midi-2.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b834a9f2b20383a631bcb147e438cd974c39cd0df039b738a7278a5f9214eae4
MD5 2e958487fb45c8579a46c6e725ba8451
BLAKE2b-256 60514d0497ba343e252fa4daa1913d6fda9b4c5fe7cb324ca3d0488fbf198d49

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