Incorporating Phillips Hue

Phillips Hue uses the CIE colour mode; it takes just two float inputs between 0 and 1 instead of the three inputs for RGB. Therefore, I need to be able to convert from RGB to CIE. Luckily, Tim on StackOverflow has uploaded a function to convert RGB to CIE specifically for Phillips Hue (https://stackoverflow.com/questions/22564187/rgb-to-philips-hue-hsb).

I have then incorporated this function in to my sketch to translate colours from my sketch to colours for the light. At the moment, the colour for the light is set to replicate what the background colour from the sketch is. I tried to update the light 60 times per second but this would slow down the visualisation so I have cut it down to six times per second. From what I can see there is no discernable disadvantage in terms of responsiveness from the light but it does still stick sometimes. I might try and drop it to three times per second.

On top of this, I have also altered the brightness; the brightness is by default at a value of 75 out of 255. When there is a beat detected, the brightness goes up to 255.

Something I need to think about, or possibly ask for help with, is that the range of colours my background can go to is limited really to blues and yellows. After adding in the keyboard functionality to change a random value I can then only really get pinks and greens but no other colours.

Leave a comment

Design a site like this with WordPress.com
Get started