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.
Jan 18, 2020 If you run the virtualhere server on the raspberry pi, you can connect all your usb devices and access them on your laptop. If you combine that with N.I.N.A. You have a nice remote control station. If you want to connect more than one usb device, you need a license for virtualhere, though.
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!
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:
Attachments
Be the First to Share
Recommendations
Tiny Speed Challenge
Clocks Contest
PCB Design Challenge
$300 | $300 | $350 | $350 | $375 | $375 | $400 | $400 |
7U AA | 8U AA | 9U AA | 10U AA | 11U AA | 12U AA | 13U AA | 14U AA |
NTX Wolfpack | Mansfield Venom | NTX Wolfpack | GP Red Sox | ||||
Diablos | Ft.Worth Aces | Crowley Venom | |||||
Lightening Elite | BC Baseball | ||||||
7U OPEN | 8U OPEN | 9U OPEN | 10U OPEN | 11U OPEN | 12U OPEN | 13U OPEN | 14U OPEN |
Lightening Elite | |||||||
Ft.Worth Aces |
$300 | $300 | $350 | $350 | $375 | $375 | $400 | $400 |
7U AA | 8U AA | 9U AA | 10U AA | 11U AA | 12U AA | 13U AA | 14U AA |
7U OPEN | 8U OPEN | 9U OPEN | 10U OPEN | 11U OPEN | 12U OPEN | 13U OPEN | 14U OPEN |
$300 | $300 | $350 | $350 | $375 | $375 | $400 | $400 |
7U AA | 8U AA | 9U AA | 10U AA | 11U AA | 12U AA | 13U AA | 14U AA |
NTX Wolfpack | |||||||
Renegade | |||||||
7U OPEN | 8U OPEN | 9U OPEN | 10U OPEN | 11U OPEN | 12U OPEN | 13U OPEN | 14U OPEN |
$300 | $300 | $350 | $350 | $375 | $375 | $400 | $400 |
7U AA | 8U AA | 9U AA | 10U AA | 11U AA | 12U AA | 13U AA | 14U AA |
7U OPEN | 8U OPEN | 9U OPEN | 10U OPEN | 11U OPEN | 12U OPEN | 13U OPEN | 14U OPEN |
$300 | $300 | $350 | $350 | $375 | $375 | $400 | $400 |
7U AA | 8U AA | 9U AA | 10U AA | 11U AA | 12U AA | 13U AA | 14U AA |
7U OPEN | 8U OPEN | 9U OPEN | 10U OPEN | 11U OPEN | 12U OPEN | 13U OPEN | 14U OPEN |
$300 | $300 | $350 | $350 | $375 | $375 | $400 | $400 |
7U AA | 8U AA | 9U AA | 10U AA | 11U AA | 12U AA | 13U AA | 14U AA |
7U OPEN | 8U OPEN | 9U OPEN | 10U OPEN | 11U OPEN | 12U OPEN | 13U OPEN | 14U OPEN |
$300 | $300 | $350 | $350 | $375 | $375 | $400 | $400 |
7U AA | 8U AA | 9U AA | 10U AA | 11U AA | 12U AA | 13U AA | 14U AA |
7U OPEN | 8U OPEN | 9U OPEN | 10U OPEN | 11U OPEN | 12U OPEN | 13U OPEN | 14U OPEN |