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.
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 forget what notes you played earlier so you can enter a new song.
This tutorial covers the following concepts:
Using a single
component to play different audio files.
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”, and also set the screen’s title to “Xylophone”. Open ...