Why "beep" could magically increase the shot rate?

Started by spto, March 10, 2019, 09:39:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

spto

As discussed here: https://www.magiclantern.fm/forum/index.php?topic=23613.0

I was trying to write a lua script to force the mirror up before shot. I tried several solutions, the silent.mo, the Mirror Lockup (MLU), and I also tried to insert a lv.start() before each shot.

The MLU solution works -- but very slow to be stable. I need to give it 1.4 extra seconds for each shot to make it work for a series of shots. At last it takes 3.8 seconds on average for each shot (based on my 550D).


-- MLUtest13

menu.set("Shoot", "Mirror Lockup", "ON")
menu.set("Mirror Lockup", "MLU mode", "Handheld")
menu.set("Mirror Lockup", "Handheld Shutter", "1/2...1/125")
menu.set("Mirror Lockup", "Handheld Delay", "1s")

Aperture = 7.1
PrefISO = 400
ShutterSpeed = 0.125

countdown=10

function pressshutter ()
key.press(KEY.HALFSHUTTER)
key.press(KEY.FULLSHUTTER)
msleep(100)
key.press(KEY.UNPRESS_FULLSHUTTER)
key.press(KEY.UNPRESS_HALFSHUTTER)
end

function main()
menu.close()
console.show()

beep(5,50)
task.yield(500)

camera.iso.value = PrefISO
camera.shutter.value = ShutterSpeed
camera.aperture.value = Aperture

repeat

beep(3,200)
pressshutter()
task.yield(2400 + camera.shutter.ms)
beep(2,100)

countdown = countdown - 1

until (countdown == 0)

task.yield(500)
beep(5,50)

end

main()


Inserting a lv.start() before the shots is a much more stable solution. No human estimation of extra sleep or task.yield is needed. The average time is 2.7 seconds for each shots.

However, I surprisingly found that, by inserting a beep(3,200) before each shot, the shot rate increased dramatically to one shot per 1.8 seconds on average, and one shot per 1.5 seconds at peak.

Here's a code comparing the without/with beep situations:


-- LVtest2

Aperture = 7.1
PrefISO = 400
ShutterSpeed = 0.125

countdown0=10
countdown1=10

function main()
menu.close()
console.show()

beep(5,50)
task.yield(500)

camera.iso.value = PrefISO
camera.shutter.value = ShutterSpeed
camera.aperture.value = Aperture

repeat

lv.start()
camera.shoot()

countdown0 = countdown0 - 1

until (countdown0 == 0)

repeat

beep(3,200)
lv.start()
camera.shoot()

countdown1 = countdown1 - 1

until (countdown1 == 0)


task.yield(500)
beep(5,50)

end

main()


This video shows how this code works:

https://www.youtube.com/watch?v=uMed4Das_hY

So why is beeping not delaying but on the contrary, accelerating things?

spto

This trick does not work for 6D. No beep is better for 6D.