Sunday, June 19, 2016

Auto Bracketing Update

Just a quick post to announce the release of version 2 of my Auto Bracketing script (access by panel on the right).

This version allows focus stacking from a point of focus to infinity, as before, and now to the macro end.

Before using the new macro feature you will need to 'register' your lens by simply putting the lens at the macro end and registering that position in the script. At the moment you will need to do this everytime the camera is switched on, assuming you wish to use that focus stacking option (FP2MAC).

Sunday, June 12, 2016

Toggler 2

First of all an apology for posting another Lua script, however, I do this so that others may benefit from my humble efforts. Either making use of my scripts or using my scripts to help them develop there own scripts.

This particular script is Version 2 of my Toggler script and you can find via the link from the scripts box on the right.

'All' the Toggler does is allow Canon EOS Magic Lantern users to quickly switch between different ML menu states. In this version I simply switch between the following:

  • Off = The Toggler is active but all the Menu state are set off
  • ETTR
  • Dual-ISO
  • Auto Bracketing
  • FRSP
  • ISO
In this version I decided to increase the toggling functionality; thus this version of the Toggler works in the following way:
  • You can switch the Toggler totally off in the ML Menu (by default Toggler will be on, but you can change that behavior in the script, ie to always be off).
  • You can switch the Toggler's state, enabled or not, by using any button of your choice, eg RATE or PLAY. Note, once you decide on that button choice, then that button ceases to be accessible in its normal Canon mode. Thus I chose RATE on my 5D3 and PLAY on my 50D, as I don't use these buttons when taking images. Pushing this button will flip-flop the enabled state of Toggler, which allows you to use the multi function switch normally.
  • If you have enabled Toggler the multi function switch can now be controlled by the Toggler. Toggle left of right to move to the Menu state you wish and in some menu states, eg ISO, you can toggle up and down to increase or decrease ISO.
One thing to note is that there appears to be a ML backend 'thing going on', that I can't work out, but have reported. That is my 5D3 returns a different key press code to my 50D. I have accounted for that in the code.

As for workflow, that is up to you. I personally ETTR most of the time and adjust exposure or decide on extended range options from there.

If I need to bracket I will meter for the shadows (using the ML Raw Ev meter) and then toggle to the Bracketing state, letting ML handle the highlight bracketing needs. Note that this is where you can use the enable button (RATE or PLAY for me). Thus I would toggle to auto bracketing, press the RATE button to disable Toggler so I can use the multi function controller to move the the metering position I wish to check.

If I want to capture a Full Resolution Silent Picture, I go to that menu state and the Toggler will tell me if I'm 'compliant' regarding shutter speed, ie Toggler will not let me take a FRSP outside the recognized range.

As for ISO, I simply toggle to that state and change the ISO with the multi functional controller (noting I can return to the Canon multi functional controller state by pressing RATE, say).

Bottom line: as usual I offer this post to help others as they learn about the power of ML Lua scripting; and, of course, I welcome feedback of any kind  :)

Final caveat: I am not a Lua power user, I'm still learning to program in Lua. Thus you use my scripts at your own risk and I've only been able to test the script on my 5D3 and 50D.

Sunday, June 5, 2016

Finally a blue sky!

For the past week in the South of the UK, the weather has been awful: flat, white, boring skies! Today, things changed and we finally saw blue skies.

So tonight it was my first opportunity to try out a tweak I've made to my Auto Bracketing script, which allows you to take either a Dual-ISO, giving you about a 3Ev boost to the base exposure, or an Auto Exposure bracket set, after you have taken a long exposure bracket set.

The base exposure for the image below, of St Peters just up the road from where we live, was 0.3s, at F/11: taken with my 5D3 and a 12-24mm Sigma at 12mm. But I wanted to explore a long exposure of about 10s, to get some blurring in the skies.

With the Auto Bracketing script all I needed to do was dial in 10s, which indicated about 30 images would be taken, and I requested a Dual-ISO, so that I could ensure shadow capture.

The LE post processing was in LR/Enfuse and the Dual-ISO was processed in LR as well.

The Enfused image and the processed Dual-ISO were exported to Photoshop-CC and I used a few luminosity masks to blend the two images togther.

I've incorporated the tweak in the script, so feel free to download it from this page and have some fun.


Saturday, June 4, 2016

New Script Link

As regular readers of my blog know, I have been putting a lot of effort into Magic Lantern Lua scripting, for example my auto bracketing script for focus, exposure and LE simulation, and my Toggler.

Until now, the only way the reader had to find the latest script version was to trawl through the pages of this blog and look for the final post that mentioned the script.

All that stops today :-)

All you need to do now is go the the link that is in the top right of the blog: "Latest versions of my Lua scripts". This will take you to my public GitHub Gist page where you will not only find the scripts for downloading, but you can look at all the edits I have made.

The Gist page is also a great way for the curious to look at the scripts, as there are various comments about the script embedded in the code.

As the ML team continue to develop the ML core, it is inevitable that the Lua module will change, thus potentially leading me to update my scripts. Also, as I think of new things I will announce this in the blog, but, from now, I will simply point the reader to my public Gist account via my blog.

For those that are new to using ML scripts, here is a short overview on their use:
  • Make sure you have the latest ML Nightly on your camera (Canon EOS only I'm afraid)
  • I recommend deleting or moving the Lua 'demo' scripts that come with ML. To do this simply delete those scripts, or move them out of the scripts folder, eg into the extras folder or another folder you create, or put a "_" in front of the script name (which tells ML not to load that script)
  • Go the ML Modules menu and enable the Lua module, and switch the camera on and off. Remember when using ML always wait a few seconds between switching on and off, ie until the status light has stopped flashing. If things do freeze up on you: don't panic, simply remove the battery, reinsert and retry.
  • Download my script(s) from my Gist page (Download ZIP) and place the script file into the ML scripts folder
  • Switch the camera on. If in LV you will see some ML status reporting, which you can ignore or use if there is an error being reported. You will not see this reporting unless you are in LV
  • Switch on LV and go to the ML SHOOT menu where you will see my Auto Bracketing and/or Toggler scripts
Finally, advanced 'warning' for you wide angle lens users, I've got some new gear coming that I'll be writing about as soon as I can :-)

Wednesday, June 1, 2016

Toggler Update

A simple post today, to let you know that my Toggler ML script has been refactored and tidied up.

All the Toggler does is allow you to switch on/off certain ML menus, in a cyclic way:
  • OFF -- All the following are switched off
  • ETTR = ETTR on
  • DUAL = Dual-ISO on
  • BRAC = Auto-Bracketing on
  • FRSP = Full Res Silent Picture on
In the case of the FRSP Toggler checks to ensure you are in the FRSP 'shutter' range, ie about 0.25 to 15 seconds.

Simply opening the Toggler menu resets all the above to off and puts Toggler in the OFF state if it is enabled or not, ie if Toggler is enabled all the above ML menus set are set to off when the Toggler menu is displayed.

As usual I welcome feedback.

--[[    
    Still photography toggler script
    Version 1.6 (should work on all ML enabled cameras with the Lua module)
    Garry George June 2016
    http://photography.grayheron.net/
    Toggler script for ML settings.
    Toggle through ML settings using the selected option, ie a button you rarely use.
    Must be in LV.
--]]

-- Declare some variables
toggler_play = 1
toggler = 0
frsp = false
frsp_ok = false

-- Change toggler value to your choice of button, eg KEY.RATE, KEY.UP, KEY.INFO or KEY.PLAY.
-- See http://davidmilligan.github.io/ml-lua/modules/constants.html for key constants
-- Default is KEY.RATE for non-EOSM cameras. EOSM self selects upper toggle on main dial as the EOSM doesn't have many buttons!
if camera.model_short == "EOSM" then toggler = KEY.UP else toggler = KEY.RATE end -- Change RATE to your choice                                                                                                           

function property.SHUTTER:handler(value) -- Check if shutter value changed between toggles
    if keymenu.submenu["Enabled?"].value == "Yes" and frsp then -- then need to recheck FRSP values in case user changes shutter speed
        if camera.shutter.value < 0.2 or camera.shutter.value > 14 then
            frsp_ok = false  -- outside FRSP range
            menu.set("Shoot","Silent Picture",0)
        else
            frsp_ok = true -- Good to go with FRSP
            menu.set("Shoot","Silent Picture",1)
        end
    end
end
toggler_presets =
{
    {
        name = "OFF ", -- Toggler active but all ML Toggler menus turned off
        menus=
        {
            { menu = "Shoot", item = "Advanced Bracket", value = 0},
            { menu = "Shoot", item = "Silent Picture", value = 0},
            { menu = "Expo", item = "Auto ETTR", value = 0},
            { menu = "Expo", item = "Dual ISO", value = 0},
        }
    },
    {
        name = "ETTR",
        menus=
        {
            { menu = "Expo", item = "Auto ETTR", value = 1},
        }
    },
    {
        name = "DUAL",
        menus=
        {
            { menu = "Expo", item = "Auto ETTR", value = 0},
            { menu = "Expo", item = "Dual ISO", value = 1},
        }
    },
    {
        name = "BRAC",
        menus=
        {
            { menu = "Shoot", item = "Advanced Bracket", value = 1},
            { menu = "Expo", item = "Dual ISO", value = 0},
        }
    },
    {
        name = "FRSP",
        menus=
        {
            { menu = "Shoot", item = "Silent Picture", value = 1},
            { menu = "Shoot", item = "Advanced Bracket", value = 0},

        }
    }
}
-- You can add other ML 'menu states' above

event.keypress = function(key)
    if keymenu.submenu["Enabled?"].value == "No" then
        return true  -- Toggler does nothing and shows no menu states
    elseif key == toggler  then -- act on a toggle
        toggler_play = toggler_play + 1
        frsp = false -- assume FRSP not selected
        if toggler_play > #toggler_presets then toggler_play = 1 end
        for i,v in ipairs(toggler_presets[toggler_play].menus) do
            menu.set(v.menu,v.item,v.value)
            if v.item == "Silent Picture" and v.value == 1 then frsp = true end -- check if FRSP set to ON in this toggle
        end
        if frsp then -- check shutter values following toggle and FRSP requested
            if camera.shutter.value < 0.2 or camera.shutter.value > 14 then
                frsp_ok = false  -- outside FRSP range
                menu.set("Shoot","Silent Picture",0)
            else
                frsp_ok = true -- Good to go with FRSP
                menu.set("Shoot","Silent Picture",1)
            end
        end
        return false
    end
end

lv.info
{
    name = "Info 1",
    priority = 100,
    value = "",
    update = function(this)
    this.background = COLOR.BLUE
    this.foreground = COLOR.YELLOW
    if keymenu.submenu["Enabled?"].value == "Yes" then
        if frsp then -- FRSP requested then need to feedback FRSP shutter speed is OK or not
            if not frsp_ok then this.foreground = COLOR.RED end
        end
        this.value = toggler_presets[toggler_play].name
    else
        this.value = ""
    end
    end
}

keymenu = menu.new
{
    parent = "Shoot",
    name = "Toggler",
    help = "Toggle through various ML options",
    depends_on = DEPENDS_ON.LIVEVIEW,
    submenu =
    {
        {
            name = "Enabled?",
            help = "Switches the script on/off",
            choices = {"Yes","No"},
            update = function(this) -- set all Toggler menus to their off state
                menu.set("Shoot","Silent Picture",0)
                menu.set("Shoot","Advanced Bracket",0)
                menu.set("Expo","Auto ETTR",0)
                menu.set("Expo","Dual ISO",0)   
                toggler_play = 1
                frsp = false   
--                menu.close()
            end
        }
    }
}