Disco Lights: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 8: | Line 8: | ||
tell application "LIFXStyle" | tell application "LIFXStyle" | ||
set hueScaleFactor to 3 # larger number: cycle faster, smaller number: cylce slower | set hueScaleFactor to 3 # larger number: cycle faster, smaller number: cylce slower | ||
set | set intraLampHueOffset to 45 # number of hue steps to take per bulb (so they're offset from each other) | ||
set kMaxValue to 255 # constant: don't change this number | |||
set barnList to {"Barn Desk Right", "Barn Desk Left", "Barn Wall", "Barn Stairs", "Barn Beam Uplight"} | set barnList to {"Barn Desk Right", "Barn Desk Left", "Barn Wall", "Barn Stairs", "Barn Beam Uplight"} | ||
| Line 23: | Line 24: | ||
repeat with curLamp in lampList | repeat with curLamp in lampList | ||
set (whiteness of curLamp) to 25 | set (whiteness of curLamp) to 25 | ||
set (brightness of curLamp) to | set (brightness of curLamp) to kMaxValue | ||
end repeat | end repeat | ||
set hueStart to hue of item 1 of lampList | set hueStart to hue of item 1 of lampList | ||
set hueStartScaled to (hueStart / hueScaleFactor) as integer | set hueStartScaled to (hueStart / hueScaleFactor) as integer | ||
set hueEndScaled to ( | set hueEndScaled to (kMaxValue / hueScaleFactor) as integer | ||
repeat | repeat | ||
| Line 36: | Line 37: | ||
repeat with itemNo from 1 to count of lampList | repeat with itemNo from 1 to count of lampList | ||
set curLamp to item itemNo of lampList | set curLamp to item itemNo of lampList | ||
set curLampHue to ((curScaledHue + (itemNo * | set curLampHue to ((curScaledHue + (itemNo * intraLampHueOffset)) mod kMaxValue) as integer | ||
set (hue of curLamp) to curLampHue | set (hue of curLamp) to curLampHue | ||
end repeat | end repeat | ||
Revision as of 06:23, 12 December 2014
I set up a few lights around the room, with LIFX bulbs, but you could as easily use Phillips Hue bulbs.
Then i run LIFXstyle or Hue-topia.
Then i run my color-changing-lights script:
tell application "LIFXStyle"
set hueScaleFactor to 3 # larger number: cycle faster, smaller number: cylce slower
set intraLampHueOffset to 45 # number of hue steps to take per bulb (so they're offset from each other)
set kMaxValue to 255 # constant: don't change this number
set barnList to {"Barn Desk Right", "Barn Desk Left", "Barn Wall", "Barn Stairs", "Barn Beam Uplight"}
set poolList to {"Pool Left", "Pool Middle", "Pool Right "}
set musicRoomList to {"Tall Lamp"}
set lampNameList to barnList & poolList & musicRoomList
set lampList to {}
repeat with curLamp in lampNameList
set lampList to lampList & {a reference to (first lamp whose title is curLamp)}
end repeat
repeat with curLamp in lampList
set (whiteness of curLamp) to 25
set (brightness of curLamp) to kMaxValue
end repeat
set hueStart to hue of item 1 of lampList
set hueStartScaled to (hueStart / hueScaleFactor) as integer
set hueEndScaled to (kMaxValue / hueScaleFactor) as integer
repeat
repeat with hueValue from hueStartScaled to hueEndScaled
set curScaledHue to (hueValue * hueScaleFactor)
repeat with itemNo from 1 to count of lampList
set curLamp to item itemNo of lampList
set curLampHue to ((curScaledHue + (itemNo * intraLampHueOffset)) mod kMaxValue) as integer
set (hue of curLamp) to curLampHue
end repeat
delay 0.25
end repeat
set hueStartScaled to 0
end repeat
end tell