Get Stock Quote from Yahoo using Node-RED

Install Docker and Compose on Debian 9 Stretch

 

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:

 

Mount a Network Drive on a Raspberry Pi

This has been tested on Jessie with the PIXEL Desktop. I haven’t tested it in previous versions.  Substitute the IP address in fstab and the share name, as appropriate!