Small Basic 1.2 Released with Kinect Support and Bug Fixes


Michael Scherotter is a Media Experience Evangelist at Microsoft who works with media companies to help them build apps, works with 3D printer manufacturers to help them write drivers, and is part of the Small Basic development team who brought Kinect objects to Small Basic 1.2. 

We are excited to announce that a new version of Small Basic is now available with some cool new Kinect objects, language improvements, and bug fixes.  If you don’t know, Small Basic is Microsoft’s free BASIC programming environment for kids and is part of a family of easy-to-use free coding tools for kids that includes Kodu Game Lab and Touch Develop

Kinect for Windows

If you are running Windows 8, Windows 8.1, or Windows 10, and have a Kinect 2 Sensor or Kinect for Xbox One Sensor attached to your PC, you will see three new objects available to you in Small Basic: KinectWindow, KinectBodyList and KinectFaceList.  You can use these objects separately, with each other, or with any of the other Small Basic objects.  Think of them as three new objects to program with that enable your body to become an input device for Small Basic.  Each of the new objects are fully documented with code samples in the Intellisense window that you can copy/paste to the code window:

image

KinectWindow Object

KinectWindow is like GraphicsWindow or TextWindow in that it represents a window on the screen.  It’s main use is to let you see what the visual sensors in the Kinect are detecting.  

KinectWindow.Show(“Color”)

image

KinectWindow.Show(“Depth”)

image

KinectWindow.Show(“Infrared”)image

KinectWindow.Show(“BodyIndex”)
image
KinectWindow.Show(“Body”)
image

KinectWindow.Show(“Color”)
KinectWindow.IsBodySensor = “True”image

In addition to visualizing what the sensors “see”, the KinectWindow object also has the ability to remove the background and place people in front of other images in real time.

KinectWindow.IsBackgroundVisible = “False”
KinectWindow.BackgroundImage = “c:\temp\bridge.jpg”
KinectWindow.Show(“Color”)

image

There are even functions to capture an image from the Kinect window (KinectWindow.CaptureImage()) and a cropped image KinectWindow.CaptureCroppedImage()

KinectBodyList Object

Use the KinectBodyList to track the position and orientation of the bodies of up to 6 people (not dogs, I’ve tried).  You can track the position of “joints” throughout the bodies being tracked, from the hands, to ankles, to heads.  You get the position in 3D space using KinectBodyList.GetJointOrientation() and in 2D space on the screen using KinectBodyList.GetJointScreenPosition().  In addition to the joint positions, you can hand open/closed state with KinectBodyList.GetHandState() and the lean of the body using KinectBodyList.GetLean().

KinectFaceList Object

Use the KinectFaceList to track the orientation, expression, and position of up to 6 human faces.  You use KinectFaceList.GetFaceProperty() to get aspects of faces like Happy, Engaged, WearingGlasses, LeftEyeClosed, RightEyeClosed, MouthOpen, MouthMoved, or LookingAway.  Using the KinectFaceList.GetBoundingBoxInColorSpace() in conjunction with KinectWindow.CaptureCroppedImage(), you can detect where faces are in the scene and grab their images to use in your Small Basic program.

Give It a Try!

We are sure that you will think of something cool to do with Kinect and Small Basic as we’ve tried to make it as easy as possible to start programming with a Kinect sensor.  If you have used the Kinect sensor already, you will probably realize that only a portion of its capabilities are exposed today in Small Basic 1.2.  You can do even more with the Kinect for Windows SDK 2.0, like define visual gestures and use the microphones built into the Kinect sensor.  We would love your input if you have any suggestions for enhancing the new Kinect objects or any other part of Small Basic.

KinectWindow.Show(“Color”)
TextWindow.WriteLine(“What does a coder look like?”)
TextWindow.Pause()
width = KinectWindow.SensorSize[“Width”] / 4
height = KinectWindow.SensorSize[“Height”] / 4
image = KinectWindow.CaptureImage(width, height)
GraphicsWindow.DrawImage(image, 0, 0)

Download Small Basic 1.2 today!

If you want to be a hero and start teaching Small Basic to kids, you can find tutorials, curriculum, community, and samples here.

Comments (31)

  1. OzJerry says:

    I tried it….the installation went smoothly and Small Basic itself worked OK and I could see the new Dictionary options etc, but extensions didn't work.  

    The kinect object wasn't available, which looks to be implemented via an extension, nor could I see my own extension or LitDev's extension, both of which were built against 1.1.

    I rebuilt my extension against the 1.2 SmallBasic DLL and then it showed up and worked OK.

    So it looks as if extensions will need to be recompiled, contradicting the info on the download page.  This also means the included kinect extension will need recompiling.

    And what's all this 'smallbasic is for kids' propaganda 🙂 I love smallbasic and am a long way past being a kid.

  2. OzJerry says:

    Forgot to mention…I tried it on two different machines.  One running Windows 7 Enterprise and the other Win10 Home.  Both of which had functioning SmallBasic 1.1 installs prior, with the LitDev extension running fine.

    Have rolled back the Win10 device to 1.1 and the litdev extension is working fine again.

  3. OzJerry, you are right.  Extensions should be rebuild for SB 1.2.

  4. OzJerry says:

    Thought so as that is the way it's always been with smallbasic.  However the download page states the following:

    Extensions built on 1.1 will work fine on 1.2.

    So that will need to be changed and it looks like the Kinect extension that is distributed with it will need to be recompiled.

  5. OzJerry, "Extensions build on 1.1 will work fine on 1.2." means that extensions depend on .NET framework I guess.  But I confirmed that Litdev Extension 1.1 doesn't work with SB 1.2…  So I can't understand what's happen.

  6. anonymouscommenter says:

    teaching with small basic at the moment, havent shown the students this working, just testing principle, will the extensions be re-compiled anytime soon?

  7. @OzJerry, @Nonki: when we compile an extension (which is a .Net dll) we reference the SmallBasic.dll. But a reference is a name AND a version (and more but it's out of our subject). The LitDev extension was compiled with the SmallBasic.dll 1.1, now the SmallBasic.dll is the 1.2 so when the LitDev extension is loaded the "SmallBasic.DLL 1.1" is not found and then the loading fail.

    @JPatrick we need to wait the extension owner recompile there DLL. Just be patient 🙂

  8. anonymouscommenter says:

    @Yan Grenier, i think it may be that i am running windows 7 64bit? have been able to get KINECT SDK 1.8 installed and sample viewer runs succesfully, do you thnk that it might be the windows 7 that is preventing SB 1.2 from not showing Kinect functions, in fact SB1.1 with extension also doesnt show kinect functions…

    oh well

    J

  9. @JPatrick, normally the OS have no impact in this context, if your SDK runs. I think it's more a problem between the SDK and the Small basic extension.

    But as I don't have a Kinect, I don't know the requirements and the behavior of the SDK and the extension. Perhaps @Nonki have more ideas because he test it.

  10. Synergist says:

    Here are some technical details about the requirements of the new Kinect objects in Small Basic 1.2:

    The Small Basic 1.2 Kinect objects use the Kinect 2/Xbox One sensor, not the original Kinect sensor.  The Kinect 2/Xbox One sensor uses USB 3 to communicate with the PC.  USB 3 was introduced in the Windows 8 timeframe so system that were built originally for Windows 7 or earlier cannot communicate with it unless they have a USB 3 port (USB with a blue interior).

  11. Thank you all. Looks like we'll need to update the details to show that extensions need to be recompiled. Thanks for helping us iron it out.

  12. JPatrick, can you join our special network for teachers?

    Learn more here: blogs.msdn.com/…/small-basic-teachers-and-educators-join-our-network.aspx

    Thanks!

  13. OzJerry: "And what's all this 'smallbasic is for kids' propaganda 🙂 I love smallbasic and am a long way past being a kid."

    Ha! Good call. We usually say "for kids and adults" or "for age 8 to 108" or something like that.

    The goal being that anybody can use it learn language-based programming as easily as possible!

  14. anonymouscommenter says:

    It seems to me that as of October 6 2015 the downloads page (as accessed by the Download button) makes no mention of Small Basic 1.2. Is this possible?

  15. anonymouscommenter says:

    Please note that the EV3 extension that allows Small Basic to control or program the Lego Mindstorms EV3 robot has been updated for compatibility with Small Basic v1.2. See EV3Basic.com for details.

  16. Thanks Nigel. Nonki fixed that for us!

  17. Zock77 says:

    Gosh! That Kinect function will defiantly out date the stuff I wrote for tracking movement!

    It would make auto turret Down-right simple!

  18. Zock, that would be pretty cool!

  19. anonymouscommenter says:

    I was wondering if you guys could implement the Ctrl-D function in the new version of SB. What it does is duplicate the line your cursor is on and place it one below. I use this a lot in programmers notepad. Also in Notepad++

  20. Zock, that's a good idea. I'll add it to the list. Thanks!

  21. anonymouscommenter says:

    DOESN'T look like this is available anymore.

  22. anonymouscommenter says:

    sorry I think I found it

  23. anonymouscommenter says:

    thank you. ill be sure to help others if I ever get to learn it.

  24. Jacinta, glad you found it! What was the issue? Anything we can do to make it easier?

    The Download page: social.technet.microsoft.com/…/30513.download-microsoft-small-basic.aspx

  25. Jessica says:

    Hi! Is there any method or function in the kinect object that returns or give acess to the exact time of when a joint position is measured? I couldn’t find any example on the documentation reference. I was using the clock object to get the time of the computer but as it’s not the exact time, I can’t use it for scientific documentation

    1. Hello Jessica, how about using Clock.ElapsedMillisecond to measure exact time like below.
      ems = Clock.ElapsedMilliseconds
      sec = Math.Floor(ems / 1000)
      ms = ems – sec * 1000

      1. Jessica says:

        Hi Nonki! Thank you for the reply, but I ment the time where I capture the data. If I use another object to get the time, I will be using the time where I called the object clock, and not the time where the joints were actually captured.

        1. Jessica, Kinect operations don’t return the time information. I think we can get approximate time by using Clock.ElapsedMillisecond at Kinect events. My sample program is shown in
          https://blogs.msdn.microsoft.com/smallbasic/2017/01/09/small-basic-kinect-motion-recorder/

Skip to main content