Wednesday 30 December 2015

playing with Sonic Pi

If you haven't played with it SonicPi (http://sonic-pi.net/) is well worth a go, it combines programming, computational thinking and  music (or trying to create music in my case). Raspbian on the Raspberry Pi has it as standard, but  is great that SonicPi is available on the Mac and PC as well. 






Here is an simple (if I am honest, because of a lack of musical ability) piece I have been play with. You can end up playing for hours trying out different sounds, synths, effects etc.

in_thread do
  loop do
    sample  :ambi_choir, rate: 0.1, attack: 4, release: 4
    sleep 10
  end
end
2. times do
  sample :bass_trance_c, amp: 0.75, release: 3
  sleep 2
  sample :bass_trance_c, rate: 0.5, amp: 0.5, release: 5
  sleep 4
  sample :bass_trance_c, rate: 0.3, amp: 0.25, release: 9
  sleep 10
end

Here is the sneaky bit, even in the code above there a mixture of threads, loops, sequences as well designing of the 'shape' of the sounds. 

There is also a community producing material/examples. For example at https://gist.github.com/rbnpi/7713ac59ed553d3f336e you can find code for the Star Wars theme. It is very hard to resist playing with the theme and adding drums, etc.

There are some great tutorials available on The MagPi magazine site https://www.raspberrypi.org/magpi/issues/

All views are those of the author and should not be seen as the views of any organisation the author is associated with.

Sunday 27 December 2015

Have a Sphero BB-8 - now what?


Previously I have shown the Sphero BB-8 rolling around the room under its own control, under the control of Sphero's own software - which has some fantastic features, I especially like the Augmented Reality message replicating the holographic projection in the film. At the time of writing (27th December 2015) this was number one best selling robot toy and 14th best toy overall in Amazon.co.uk toy list that day. The video below is the Sphero BB-8 Droid on patrol one of the options in the App.



But what is you want to take it a little further? What if you bought it and now want to program it?

One of the features of this device is it is programmable; and there is more than one option, two are presented in this post. 

First option, by one of my favourite apps - TickleApp which has been discussed in previous posts. This app allows control of a quite an impressive range of devices using the same interface. Examples, some of which have been discussed previously (e.g Parrot Minidrone or Dash and Dot), are shown below - including Sphero BB-8. 























































The App uses an graphical programming interface similar to Scratch or Blockly to produce code. The example here it a very simple one of:

  • Spin twice for one second;
  • Move roughly in a square;
  • If the BB-8 collides (or is bumped) it is set to spin twice for a second.  

Ok, not the most sophisticated bit of coding; but it does demonstrates the simplicity of controlling this robot with the app. 

BB-8 is great fun, and with the head appearing to float over the body and facing in the direction of movement it is hard resist. The video below shows it action.







The Tickleapp is not the only alternative software, the Tynker App can also control it.


This is also a graphical drag and drop programming tool, that you can connect certain 'toys' to. Though the App, like Tickle, is mainly concerned with developing programming skills, the ability to add physical device is an enhancement.










The BB-8 can be connected to Tynker (or how I did it anyway) by:

  • Clicking on the Create button on the opening screen;
  • Clicking on Blank Template;
  • Deleting the 'Actor' that has there and clicking on the + button in the top right hand corner of the screen;
  • Clicking on connected toys and selecting the grey ball;
  • On the main screen it should say spherobot with a code button at the side, click on the button;
  • You should get a screen with some code for changing the colour shown and then moving in a square- you can change this for your own code.
Not all the commands, listed down the side, will work with the BB-8 - I restricted myself to the ones under common (star in the list). The Tynker app is a nice tool anyway with lots of games related activities to try. Having the ability to connect and program certain devices is a benefit.


Personal note, if you have one of these toys I would say give programming them a go.


If you have comments or experiences with Tynker, Sphero BB-8 or Tickle app please add them to the comments below.





All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with.

Thursday 24 December 2015

This the droid I've been playing with...



I have been fortunate to be able to get  Aldebaran NAO robots (https://plus.google.com/100795863694331917596/about or https://www.aldebaran.com/en) and have a play. 


Funding for these came through matched STEM investment from HEFCE (http://www.hefce.ac.uk/). Bought for teaching, especially around the growing area of Social Robotics but also for outreach and in-reach activities.

These are very cute but very well featured robots and also out of the box they are engaging. For reason, before they were fully set-up,  I had my first opportunity today to try an Aldebaran NAO robot as a teaching tool in an Artificial Intelligence (AI) class on Thursday 17th December 2015. The session was an end of term activity around summarising what we did in the AI class so far and questions.  A question came up around AI and it's impact on society. Perfect opportunity to bring in a social robot - especially as a precursor for when we include a session on social robotics next term.
Currently I am playing with them a little more. Two have being partially set-up now name "Red" and "Smurf". 
 The video link below shows "Red" in action (Walking holding the hand of my son; sitting down and standing up on command - some of the time.)

 https://www.youtube.com/watch?v=3BhHJhGmXJc


I would love to hear from others what they have being doing with these robots or other robots for that matter. Please comment below.


All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with.

Answers not on the Screen

  2.  The answers not on the screen Hill, G. ,  Turner, S. J.  and  Childs, K.  (2017)  Abstract:  Reflection from two areas on the issues...