Reader small image

You're reading from  Raspberry Pi Projects for Kids (Second Edition)

Product typeBook
Published inApr 2015
Reading LevelBeginner
Publisher
ISBN-139781785281525
Edition1st Edition
Languages
Right arrow
Author (1)
Daniel Leonard Bates
Daniel Leonard Bates
author image
Daniel Leonard Bates

Daniel Bates is a computer science researcher at the University of Cambridge. His day job involves inventing designs for future mobile phone processors and when he gets home, he likes playing games or working on one of his coding projects (or both!). Daniel has been a volunteer for the Raspberry Pi Foundation since 2011 and is enthusiastic about introducing new people to computing. He has previously written Instant Minecraft: Pi Edition Coding How-to and Raspberry Pi Projects for Kids (First Edition), both published by Packt Publishing.
Read more about Daniel Leonard Bates

Right arrow

New sounds


Up until now, we've been using the default sound in Sonic Pi, called beep, but there are many other sounds available.

Open up a couple of empty lines before the loop, type in use_synth, and then press the spacebar. Synth is short for synthesizer, which is a program or machine that generates sound. You will see a long list of sound names appear, with beep at the top. Choose one of the sounds by double-clicking on it or typing enough of its name so that it is the only option. Then press Enter. If you run your code now, you will hear the same notes, but the sounds will be different. Try a few different sounds to see which ones you like.

The use_synth function routine changes the sound of all notes until the next use_synth routine is used. It is possible to change the sound of notes as many times as you like within a song. We can even play a trick similar to the trick that we used when playing a random note. Try adding this line of code inside your loop:

  use_synth choose([:pretty_bell...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Raspberry Pi Projects for Kids (Second Edition)
Published in: Apr 2015Publisher: ISBN-13: 9781785281525

Author (1)

author image
Daniel Leonard Bates

Daniel Bates is a computer science researcher at the University of Cambridge. His day job involves inventing designs for future mobile phone processors and when he gets home, he likes playing games or working on one of his coding projects (or both!). Daniel has been a volunteer for the Raspberry Pi Foundation since 2011 and is enthusiastic about introducing new people to computing. He has previously written Instant Minecraft: Pi Edition Coding How-to and Raspberry Pi Projects for Kids (First Edition), both published by Packt Publishing.
Read more about Daniel Leonard Bates