Thursday 8 September 2016

New Luming

It's been a few weeks since my last post, but the reason for that is I have been delving into new a new code for my dims and perfecting a glow to go with it.

I have for some time been looking for a way to make the lume gradually brighten, and had experimented with a few codes I had found, but was never completely happy with the results.

Then the very talented +Ken Van Vliet , advised me check out the even more talented +Sean Grondin who had recently added a very good gradually brightening lume to his complex setup. He in turn told me the code came from +Klaus Koehler - I am eternally grateful to all three of you 

Sean has put an excellent tutorial together here


Here is my breakdown of the way I implement the code (just so you know I'm not a coder, but learn through trail and error, and the generosity of others)



1
copy and paste text between the lines into the main script 

________________________

--! VARIABLE DEFAULTS
var_face = 1
var_ambT = 2
var_ambL = 60
var_zoom = 1
var_theme = 2
--/ VARIABLE DEFAULTS


--! AMBIENT ACTIVATION TIME
function on_millisecond(dt)

tweens.ambM = 
not {abright} and var_ambT == 1  and ({dtp}>{wssp} or {dtp}<{wsrp}) and 100 or

var_ambT == 2 and 

({wsrp}>={dtp} and 100 or
({wssp}+0.0417)<={dtp} and 100 or
({wsrp}+0.0417)>{dtp} and (100-({dtp}-{wsrp})*2000) or
{wssp}<{dtp} and ({dtp}-{wssp})*2000 or 0) or

not {abright} and var_ambT == 3 and 100 or

var_ambT == 4 and 100

tweens.ambL = 
not {abright} and var_ambT == 1 and ({dtp}>{wssp} or {dtp}<{wsrp}) and var_ambL or

var_ambT == 2 and

({wsrp}>={dtp} and var_ambL or
({wssp}+0.0417)<={dtp} and var_ambL or
({wsrp}+0.0417)>{dtp} and (var_ambL-({dtp}-{wsrp})*(2000*(var_ambL*.01))) or
{wssp}<{dtp} and ({dtp}-{wssp})*(2000*(var_ambL*.01)) or 0) or

not {abright} and var_ambT == 3 and var_ambL or

var_ambT == 4 and var_ambL

end
--/ AMBIENT ACTIVATION TIME

--! TAP ACTIONS
function tap_ambT()
if var_ambT == 4 then
   var_ambT =  0 else
   var_ambT =  var_ambT + 1
end end


--! TEXT FADE
function tap_fade_text()
wm_schedule { 
action='tween', 
tween='fade_text', 
from=0, 
to=100, 
duration=2, 
easing=linear 
}
wm_schedule { 
action='tween', 
tween='fade_text',
start_offset=1, 
from=100, 
to=0, 
duration=2, 
easing=linear 
}
end
--/ TEXT FADE
________________________

2

the dim layer - that is to say the layer which is normally a 512x512 black circle set to an opacity level of 25 - 75 (you don't need this circle - but it does help your lume colours pop)
put this code into the opacity level
_________

tweens.ambL

_________

the level of opacity is controlled in the main script under VARIABLE DEFAULTS

3

the other dim layers that glow or lume, put this code into their opacity

_________

tweens.ambM

_________

4
now add a circle shape and add the following code to the run script in tap actions, once the code is added set the opacity of this circle to 0
________

tap_ambT()
tap_fade_text()
_______


5
and finally add text and paste in this text

__________

var_ambT == 0 and "no lume" or
var_ambT == 1 and "auto lume at sunset" or
var_ambT == 2 and "always lume after sunset" or
var_ambT == 3 and "normal ambient lume" or
var_ambT == 4 and "lume all day and all night"
__________

You can change the wording between the "quote marks" to your own preference


Test it, the only thing really to adjust will be the level of opacity on the dim layer (in Variable Defaults)

And make sure all the dim and lume layers are displayed Always

You will be able to cycle through 5 dim modes, Normal, Never Lume, Always Lumed Day & Night, Auto Normal Lume and Auto Always Lume

The Auto modes will take an hour to brighten at sunset and gradually unbrighten (is that a word ?)  at sunrise.


If you like this or think someone you know might like it, please share it





No comments:

Post a Comment