Chapter 9. Xylophone
It’s hard to believe that using technology to record and play back music only dates back to 1878, when Edison patented the phonograph. We’ve come so far since then—with music synthesizers, CDs, sampling and remixing, phones that play music, and even long-distance jamming over the Internet. In this chapter, you’ll take part in this tradition by building a Xylophone app that records and plays music.
What You’ll Build
With the app shown in Figure 9-1 (originally created by Liz Looney of the App Inventor team), you can:
- Play eight different notes by touching colored buttons on the screen.
- Press a Play button to replay the notes you played earlier.
- Press a Reset button to make the app clear any notes you played earlier so that you can enter a new song.
What You’ll Learn
This tutorial covers the following concepts:
- Using a single
Soundcomponent to play different audio files.
- Using the
Clockcomponent to measure and enforce delays between actions.
- Deciding when to create a procedure.
- Creating a procedure that calls itself.
- Advanced use of lists, including adding items, accessing them, and clearing the list.
Connect to the App Inventor website and start a new project. Name it “Xylophone”, ...