Backyard Baseball Raspberry Pi

Simple Raspberry Pi Camera Trap Made From a Food Container. By ThirdEarthDesign in Raspberry Pi. Iridescent Art. Harley Quinn Baseball Bat Pepper Mill. By BrittLiv in Costumes & Cosplay. Deadpool Knife Block. By Midnight-Maker in Backyard. Sugru Key Head. By andrea biffi in Life Hacks. The Pi NoIR camera board also includes an additional blue filter so that you can experiment with near-infrared photography, a method for assessing how well plants are photosynthesizing. This DIY science project turns the Pi NoIR camera board and a Raspberry Pi into an inexpensive instrument to help you examine plant health in your own backyard.

Introduction: Piano Pi - Play a Duet With Your Pi!

In this tutorial you will learn a simple way to program your Pi using Sonic Pi to create a piano accompaniment.

Backyard Baseball Raspberry Pictures

Remember the piano scene in the move Big? You will be programming the bass part of the song they play 'Heart and Soul'.

You will need:

Monitor, keyboard and mouse.

Speakers

Piano

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Open Sonic Pi on Jessie Raspbian

Pi comes pre-installed with the NOOBS card.

Navigate to Menu >> Programming >> Sonic Pi

Step 2: Getting Familiar With Sonic Pi

If this is your first time using Sonic Pi, click the 'Help' button and walk through the first couple lessons to get familiar with the platform.

I went ahead and changed the editor to a dark screen by clicking on the 'Prefs' button. You may also adjust the volume there.

At the bottom of the editor you will see 'Buffer0' - 'Buffer9'. Here you can switch between code windows to create unique sounds and music for each Buffer. Find an empty Buffer to begin this project.

Step 3: Midi Numbers

Sonic Pi uses the Midi number system where each key on the piano has a number.

Middle C is 60. To begin the song, C is played twice. If you don't want notes to be played at the same time you must separate the notes with a rest or sleep. This is the duration of time in seconds before the next note is played. *Note a zero must precede the decimal if sleep is less than a second or you will get an error.

The next 3 notes will be played as a chord twice with a sleep in between each chord:

Go ahead and press the 'Run ►' with your speakers on to hear your song so far!

Backyard

Step 4: Second Verse, Same As the First!

The accompaniment on this piece repeats itself again and again. With Sonic Pi you can easily wrap the code you want repeated in a loop with the key words do and end:


Be careful though, using the word loop creates an infinite loop and the song will repeat until you press the 'Stop ■' button. To limit the number of times the loop runs, simply type the number followed by .times:

Backyard Baseball Raspberry Pit


Attachments

Backyard Baseball Raspberry Pi 7

Be the First to Share

Recommendations

Raspberry Pi Vehicle

How to Build a Giant Hidden Shelf Edge Clock in Arduino
46 10K
Automated Garden System Built on Raspberry Pi for Outdoors or Indoors - MudPi in Raspberry Pi
Backyard baseball raspberry picture
  • Tiny Speed Challenge

  • Clocks Contest

  • PCB Design Challenge