O'Reilly logo

Introduction to Programming with Greenfoot: Object–Oriented Programming in Java™ with Games and Simulations, First Edition by Michael Kölling

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Making music: An on-screen piano

topics:

sound

concepts:

abstraction, loops, arrays, OO structure

In this chapter we shall start on a new scenario: a piano that we can play with our computer keyboard. Figure 5.1 shows what it could look like once we’re finished.

The goal for this chapter: an on-screen piano

Figure 5.1. The goal for this chapter: an on-screen piano

We start again with opening a scenario from the book scenarios: piano-1. This is a version of our scenario that has the resources in it that we will need (the images and the sound files), but not much else. We shall use this as the base scenario to start writing the code to build the piano.???

Example . 

Exercise 5.1Open the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required