# OSC2Hue

**URL:** <https://uzu.lurk.org/t/osc2hue/5802>\
**Category:** TidalCycles\
**Tags:** resources\
**Created:** [27 July 2025 12:00 UTC](https://uzu.lurk.org/t/osc2hue/5802 "2025-07-27T12:00:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ilesinge](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ilesinge/32/785_2.png) [@ilesinge](https://uzu.lurk.org/u/ilesinge)\
**Post date:** [27 July 2025 12:00 UTC](https://uzu.lurk.org/t/osc2hue/5802/1 "2025-07-27T12:00:28Z")

</div>

Hello people,

I wondered what it would be like to livecode a single pixel sitting outside of my screen (e.g. a lamp) with the same tools I use for music (maybe for a unified performance).

As I have a few Philips Hue lamps I created this OSC bridge so I could livecode them with Tidal Cycles: [GitHub - ilesinge/osc2hue: An OSC bridge to Philips Hue lights](https://github.com/ilesinge/osc2hue)

If you want to test it, here is an integration guide for Tidal Cycles specifically:

> <https://github.com/ilesinge/osc2hue/blob/main/examples/TIDAL_INTEGRATION.md>

For whoever tests it if any, I'd be curious to have your feedback about how it feels like.

---

<div class="post-metadata">

**Author:** ![hellocatfood](https://uzu.lurk.org/user_avatar/uzu.lurk.org/hellocatfood/32/42_2.png) [@hellocatfood](https://uzu.lurk.org/u/hellocatfood)\
**Post date:** [29 July 2025 09:36 UTC](https://uzu.lurk.org/t/osc2hue/5802/2 "2025-07-29T09:36:29Z")

</div>

> [@ilesinge](#):
>
> Philips Hue lights

I don't have the Philips Hue light but I really like this idea. Do you have any videos showing this code in action? I'm wondering what the response time is. For example, would the equivalent of `bd*32` produce flashing lights?

---

<div class="post-metadata">

**Author:** ![ilesinge](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ilesinge/32/785_2.png) [@ilesinge](https://uzu.lurk.org/u/ilesinge)\
**Post date:** [29 July 2025 10:18 UTC](https://uzu.lurk.org/t/osc2hue/5802/3 "2025-07-29T10:18:19Z")

</div>

![GIF_20250720_222734_067](https://club.tidalcycles.org/uploads/default/original/2X/f/fbca3b2f2ad80e0ae59c7ea55d6d38006c44bfca.gif)

I'm currently on the move so I can't create a proper video with sound & light sync but here you can see a small example.

You can actually adjust the negative latency of the events that are sent in the boot file, so they are pretty much in sync.

To flash lights you'd have to adjust the brightness down and up repeatedly such as (you can also set a fade duration):

d1 $ fast 8 $ light "1\*2" # brightness "0 1"

Note that sending events too fast can currently create additional latency issues but I'll look into that, if not due to the Hue bridge itself.

---

<div class="post-metadata">

**Author:** ![ilesinge](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ilesinge/32/785_2.png) [@ilesinge](https://uzu.lurk.org/u/ilesinge)\
**Post date:** [24 August 2025 15:44 UTC](https://uzu.lurk.org/t/osc2hue/5802/4 "2025-08-24T15:44:57Z")

</div>

Hey, you don’t have to own real Philips Hue lights anymore to play with OSC2Hue.

You can now livecode on-screen “lights” with [Huemulator](https://github.com/ilesinge/huemulator).

Note that OSC2Hue is also compatible with [diyHue](https://diyhue.org/) if you own other brands of LED lights system (or if you want to build your own!).

---

<div class="post-metadata">

**Author:** ![paulwasthere](https://uzu.lurk.org/user_avatar/uzu.lurk.org/paulwasthere/32/3403_2.png) [@paulwasthere](https://uzu.lurk.org/u/paulwasthere)\
**Post date:** [1 December 2025 19:23 UTC](https://uzu.lurk.org/t/osc2hue/5802/5 "2025-12-01T19:23:28Z")

</div>

Hi there, I am trying to get to the controlling the lights with Tidal Cycles but am having trouble.

Currently I have the WIZ protocol Hue Lights, these generate an IP address that can be connected to via python with the following code to test it out.

[https://youtube.com/shorts/OmqMyeirQ5M?feature=share](https://youtube.com/shorts/OmqMyeirQ5M?feature=share)

An example of what this script can do is in the youtube short.

```python
from pywizlight import wizlight, PilotBuilder
import asyncio
import time
async def control_bulb():
#the bulb ip address was found in the App under the Lightbulb Device Info
#the bulbs work off the ESP WROOM chip, good to know for hardware replication
    bulb = wizlight("192.168.68.61")
    print("Turning bulb ON...")
    await bulb.turn_on()
    print("Setting to blue...")
    await bulb.turn_on(PilotBuilder(rgb=(0, 0, 255)))
    time.sleep(2)
    print("Setting to 30% brightness...")
    await bulb.turn_on(PilotBuilder(brightness=30))
    time.sleep(2)
    print("Setting to warm white...")
    await bulb.turn_on(PilotBuilder(brightness=100, colortemp=2700))
    time.sleep(2)
    print("Turning bulb OFF...")
    await bulb.turn_off()
    # Properly close the connection
    await bulb.async_close()
    print("Test complete!")
# Run with proper cleanup
try:
    asyncio.run(control_bulb())
except KeyboardInterrupt:
    print("\nScript interrupted")

```

My current problem is getting SuperCollider IDE to forward the OSC Messages it receives so that Python can receive the messages for parsing.

How did you setup SuperCollider IDE to not consume the messages? it appears that whenever I try to forward the OSC Messages to a new port, there is nothing to send because the OSC Message is consumed before it can be forwarded.

---

<div class="post-metadata">

**Author:** ![paulwasthere](https://uzu.lurk.org/user_avatar/uzu.lurk.org/paulwasthere/32/3403_2.png) [@paulwasthere](https://uzu.lurk.org/u/paulwasthere)\
**Post date:** [1 December 2025 22:16 UTC](https://uzu.lurk.org/t/osc2hue/5802/6 "2025-12-01T22:16:45Z")

</div>

Ok. So I got this to work but the delay is bugging me.

[https://youtube.com/shorts/3kRUKAftxP8?si=tajSdCI\_zQvgCy-9](https://youtube.com/shorts/3kRUKAftxP8?si=tajSdCI_zQvgCy-9)

> <https://github.com/ZBZFirst/PureData/blob/master/testbulb.py>

I still have to write up how I got the osc message to forward but under the OSC documentation was a how to for port forwarding.

---

<div class="post-metadata">

**Author:** ![ilesinge](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ilesinge/32/785_2.png) [@ilesinge](https://uzu.lurk.org/u/ilesinge)\
**Post date:** [2 December 2025 08:06 UTC](https://uzu.lurk.org/t/osc2hue/5802/7 "2025-12-02T08:06:20Z")

</div>

Hi Paul.

In my case I want the OSC message to both consumed by Supercollider and OSC2Hue.

The BootTidal.hs modification listed here was sufficient:

> <https://github.com/ilesinge/osc2hue/blob/main/examples%2FTIDAL_INTEGRATION.md>

Notice that you can adjust the oLatency property to take into account your specific network conditions. Events will be sent in advance.

I'm not sure to understand where your Python script sits? It's purpose replicates OSC2Hue but in a different language?

---

<div class="post-metadata">

**Author:** ![paulwasthere](https://uzu.lurk.org/user_avatar/uzu.lurk.org/paulwasthere/32/3403_2.png) [@paulwasthere](https://uzu.lurk.org/u/paulwasthere)\
**Post date:** [2 December 2025 18:15 UTC](https://uzu.lurk.org/t/osc2hue/5802/8 "2025-12-02T18:15:32Z")

</div>

I saw your OP and got excited however I am still very much a newb with GO or the language of the scripts you wrote.

I could read and understand it but the workflow was completely alien to me. So yea, I just wanted to try and make it function in python for familiarities sake.

Theres a lot of possibilities in python to hack more functionality into the bulbs using more libraries.

I was thinking of using an MPU6050 to control max brightness of one bulb while tidal controls the pulse of other bulbs.

---

<div class="post-metadata">

**Author:** ![ilesinge](https://uzu.lurk.org/user_avatar/uzu.lurk.org/ilesinge/32/785_2.png) [@ilesinge](https://uzu.lurk.org/u/ilesinge)\
**Post date:** [3 December 2025 20:17 UTC](https://uzu.lurk.org/t/osc2hue/5802/9 "2025-12-03T20:17:38Z")

</div>

I completely understand, and hacking it yourself is even more fulfilling.  
As I said in my previous message, the trick is to manage the delay on Supercollider's side, not on your script side, so that the events are sent in advance with a specific timing you decide.

```haskell
Target {oName = "hue", -- Or anything you want
        oAddress = "localhost", -- The host on which your script is listening
        oPort = 8080, -- The port your script is listening
        oLatency = 0.2, -- Tweak the delay here
        oSchedule = Live, 
        oWindow = Nothing,
        oHandshake = False,
        oBusPort = Nothing
}

```

---

<div class="post-metadata">

**Author:** ![paulwasthere](https://uzu.lurk.org/user_avatar/uzu.lurk.org/paulwasthere/32/3403_2.png) [@paulwasthere](https://uzu.lurk.org/u/paulwasthere)\
**Post date:** [3 July 2026 16:13 UTC](https://uzu.lurk.org/t/osc2hue/5802/10 "2026-07-03T16:13:52Z")

</div>

Im going to revisit this this week hopefully.
