Introduction: Mii Music

This Instructable was written to help those who are learning how to code for the first time using Sonic Pi. The Mii Channel theme is a great beginner piece because the user can practice coding using scientific pitch notation and become comfortable with the sleep/play functions of Sonic Pi with a simple musical piece.

Step 1: Familiarize Yourself With Sonic Pi

I highly recommend completing the various tutorials provided by Sonic Pi in order to practice basic code and have a clear idea of what the code in Sonic Pi looks like. These tutorials are a good foundation for a beginner before completing the code for the Mii Channel theme.

Step 2: Find the Notes!

Sonic Pi coding can be written in two ways:

1. Notes can be coded by using the number of the key on the piano. For example, you could denote a key by saying "play 63," or key #63 on the piano. Lower numbers are considered lower pitches.

2. Notes can also be coded by using the musical letter name and the octave number, which is called scientific pitch notation.

The first step to writing any song in coding is writing out the notes from the sheet music. For the Mii Channel theme, I went through and wrote out all the note letter names from the sheet music in scientific pitch notation, including sharps and flats.

Step 3: Code Away!

Once you have the letter name for each note, you can code each note by writing "play :letter name" with the piano note letter name where you see "letter name." In between each note, there will need to be some silence, so in between each note you will write "sleep 0.5." The number after sleep may not always be "0.5" as the value can vary depending on the time between notes in the music. The code for the Mii Channel theme is down below to copy and paste into Sonic Pi.

play :Fs4 sleep 0.30 play :A4 sleep 0.30 play :Cs5 sleep 0.30 play :A4 sleep 0.30 play :D4 sleep 0.30 play :D4 sleep 0.30 play :D4 sleep 0.5 play :Cs4 sleep 0.35 play :D4 sleep 0.30 play :Fs4 sleep 0.30 play :A4 sleep 0.30 play :Cs5 sleep 0.35 play :A4 sleep 0.35 play :Fs4 sleep 0.35 play :E5 sleep 0.35 play :Eb5 sleep 0.35 play :D5 sleep 1 play :Gs4 sleep 0.30 play :Cs5 sleep 0.30 play :Fs4 sleep 0.30 play :Cs5 sleep 0.30 play :Gs4 sleep 0.30 play :Cs5 sleep 0.30 play :G4 sleep 0.30 play :Fs4 sleep 0.30 play :E4 sleep 0.30 play :E4 sleep 0.25 play :E4 sleep 0.25 play :E4 sleep 0.45 play :E4 sleep 0.25 play :E4 sleep 0.25 play :E4 sleep 0.30 play :Eb4 sleep 0.30 play :D4 sleep 0.30 play :Cs4 sleep 0.30 play :A4 sleep 0.25 play :Cs5 sleep 0.30 play :A4 sleep 0.30 play :Fs4 sleep 0.30 play :D4 sleep 0.25 play :D4 sleep 0.25 play :D4 sleep 0.30 play :E5 sleep 0.25 play :E5 sleep 0.30 play :E5 sleep 0.40 play :Fs4 sleep 0.25 play :A4 sleep 0.25 play :Cs5 sleep 0.30 play :A4 sleep 0.30 play :Fs4 sleep 0.30 play :E5 sleep 0.30 play :D5 sleep 0.45 play :B4 sleep 0.30 play :G4 sleep 0.30 play :D4 sleep 0.30 play :Cs4 play :Cs4 sleep 0.30 play :B4 sleep 0.30 play :G4 sleep 0.30 play :Cs4 sleep 0.30 play :A4 sleep 0.30 play :Fs4 sleep 0.30 play :Cs4 sleep 0.30 play :B3 play :B3 sleep 0.30 play :F4 sleep 0.30 play :D4 sleep 0.30 play :B3 sleep 0.25 play :E4 sleep 0.25 play :E4 sleep 0.25 play :E4 sleep 0.50 play :Bb4 sleep 0.25 play :Bb4 sleep 0.25 play :Cs5 sleep 0.25 play :D5 sleep 0.25 play :Fs5 sleep 0.25 play :A5 sleep 1.25 play :A4 sleep 0.40 play :Bb4 sleep 0.40 play :B4 sleep 0.40 play :Bb4 sleep 0.40 play :B4 sleep 0.50 play :A4 sleep 0.30 play :Bb4 sleep 0.30 play :B4 sleep 0.40 play :Fs5 sleep 0.30 play :Cs5 sleep 0.30 play :B4 sleep 0.25 play :Bb4 sleep 0.40 play :B4 sleep 0.40 play :B4 sleep 0.40 play :C5 sleep 0.40 play :Cs5 sleep 0.30 play :C5 sleep 0.40 play :Cs5 sleep 0.50 play :Cs5 sleep 0.30 play :C5 sleep 0.30 play :Cs5 sleep 0.40 play :G5 sleep 0.30 play :Eb5 sleep 0.40 play :Cs5 sleep 0.30 play :Eb5 sleep 0.60 play :B4

Step 4: Play Your New Song!

Once you have the code in Sonic Pi, you can hit the play button at the top of the program and hear your new song -- the Mii Channel theme.