In the latest version of Myo Connect we exposed the pointer and zoom controls found in Presentation Mode to Myo Script. This means you can build your own custom presentation controls!

To get you started, I implemented the default control scheme in Myo Script. Feel free to tweak and experiment with it to come up with something that feels right just for you. I wrote it using our function binding technique to make it easy to pick choose which parts you want for easy modification. Download the default scheme ("vanilla mode") here.

One thing to note is that I extended the function binding scheme to include onPeriodic() as well as gestures:



VanillaBindings = {  
        fist            = holdPointerOrZoom,
        doubleTap       = nextSlideOrCancel,
        waveIn          = holdSlidePrevious,
        onPeriodic      = vanillaPeriodic
    }

    bindings = VanillaBindings

    function onPeriodic()  
        fn = bindings["onPeriodic"]
        if fn then
            fn()
        end
    end

    function onPoseEdge(pose, edge)  
        fn = bindings[pose]
        if fn then
            keyEdge = edge == "off" and "up" or "down"
            fn(keyEdge)
        end
    end  

This makes it easy to have different onPeriodic() implementations for different scripts. For example, here's something I like to call Pocket Presenter. It's exactly the same as the default scheme, but it keeps the Myo armband locked unless your arm is down by your side (Where your pocket is. See?). It's basically the same technique used in the 10ft Media Experience, except down at your side instead of up in the air. All I did was supply a different function to call in onPeriodic():



function pocketPeriodic()  
       if (inPocketZone() or myo.presentationPointerZoomActive() or myo.presentationPointerEnabled()) then
          if (myo.isUnlocked()) then
              vanillaPeriodic()
          else
             myo.unlock("hold")
          end
       elseif (myo.isUnlocked()) then
          myo.lock()
       end
    end

    function inPocketZone()  
         local pitch = getMyoPitchDegrees()
         return (math.abs(degreeDiff(pitch, -90)) < POCKET_ZONE_RADIUS)
    end

     PocketBindings = {
         fist            = holdPointerOrZoom,
         doubleTap       = nextSlideOrCancel,
         waveIn          = holdSlidePrevious,
         onPeriodic      = pocketPeriodic
    }

    bindings = PocketBindings 

Grab the version described in this post here.

With this scheme you can wave your arms around or do whatever you want with no chance of a false positive. You just have to remember to drop your arm to your side when you want to control the presentation. It's a little less magical than just casually holding your arm out and double tapping, but it's still pretty sweet.

But, if you are really worried about false positives, or, well, do weird stuff with your hands when presenting, it might be worth the trade. The point is, now you can experiment.

We'll have more experimental presentation control schemes (Some more robust than others) in the future. If you've got an idea for a scheme you want to try, or have put something cool together you want to show off, drop me a line at MyoCraft@thalmic.com or hit me up on Twitter at @thalmicdev.

Otherwise, see you next week!

Newsletter

Enter your email address and get all latest content delivered to your inbox every now and then.