Sonic Pi Coding Class 004

It was agreed to give a small prize to the student who worked the hardest during the class and who also worked the hardest in producing their final piece/s of music based on a brief.  I’ve created links here to the more obscure parts of the prize so that the recipient has a starting point to work out what they can be used for!

Arduino code for the Ultrasonic Ruler that was worked on in class can be found in my GitHub repository, here.

Install pip on OS X via Terminal


Wordpress is loading infos from ahmadawais

Please wait for API server to collect data from

Get Stock Quote from Yahoo using Node-RED

Install Docker and Compose on Debian 9 Stretch

If you plan on using the –memory flag when creating containers, you may need to enable memory and swap accounting in the Kernel.

  1. Log into the Debian host as a user with sudo privileges.
  2. Edit the /etc/default/grub file. Add or edit the GRUB_CMDLINE_LINUX line to add the following two key-value pairs:
  3. Save and close the file.
  4. Update GRUB.

    If your GRUB configuration file has incorrect syntax, an error occurs. In this case, repeat steps 3 and 4.

    The changes take effect when the system is rebooted.

More detailed information can be found in the Docker Post-Installation Steps for Linux.

Sonic Pi Coding Class 003

Last week we wrote a function to set the volume based on musical dynamics like ‘ppp’ or ‘fff’

Functions can also be used to return information to us.

An example of a function that returns a value is below. Type it in and see how it works.

What I would like you to do is to modify last weeks function so that when you pass it a musical notation for volume, like ‘ppp’, it returns a number between 0 and 1.0 for Sonic Pi to use as part of an :amp property.

Once you have that function working, make your own piece of music up that uses this function as many times as you can!

Below is one way of achieving the task. If you are stuck, type this in yourself and then make your own piece of music up that uses this function as many times as you can!


Choosing a Random Synth in Sonic Pi

Towards the end of our coding class at school today, one of the children asked me how they would choose a random synth in their code.  I couldn’t give them the answer off of the top of my head so I came home and have placed two different solutions below:


Check or change the Timezone in Debian

To see or change what timezone your Debian system is configured for:

More detailed information is available in the Debian Wiki

More specifically, I used this in a setup of HypriotOS, a minimal Debian-based operating systems that is optimised to run Docker on ARM devices. In this instance it was an old Raspberry Pi Model B running NodeRed in a Docker Container.

I needed to get the time in the Docker Container to match the time on the host.  Achieved, as below, where /etc/localtime on the host is mapped to /etc/localtime in the container when it is created.

I have used NodeRed to subscribe to messages from an MQTT service I have running that publishes various messages from various nodes around our house.  The NodeRed code listens for some of these messages and uses the AWS Polly Service to convert them to speech and read them out to us.

There’s a sample of the speech, below, as well as screen shots of the NodeRed flows.

Sonic Pi Coding Class – 002

My little boy, James, has been taking piano lessons for two terms now. Last week, his teacher asked him to do an assignment on a minuet.

James knows I’ve been running a coding group at school with Sonic Pi so he asked his teacher if he could write his minuet in Sonic Pi as part of his work.  It was his first coding in a non block type language like Scratch.  I think he did a super job!  James’ version is on his own web page, here.

I thought it would be a good opportunity for me to have a go too so that I could become more familiar with what I am talking to the children about in the class.  Here’s my version which includes the student and the teachers parts played as a duet.  It took me a couple of hours to figure it all out so it was a good challenge!

Press the play button, below, to see how it turned out.

Get Spell Checking Working in Libre Office on a Raspberry Pi

Spell checking never seems to work, by default, in Libre Office on a Raspberry Pi.

To get it working: