Design

Apart from the welcome screen, the MIDlet has only a single screen, which contains four pads. When triggered by a touch event, each pad plays a drum sample from the audio files included in the MIDlet. The user can also record the drumming and play the recorded sequence afterwards. When the sequence is replayed, the MIDlet supports additional drumming on top of it. The drum samples for each pad can be selected from a list of audio files included in the MIDlet. The MIDlet uses the Mobile Media API to implement the audio features.

The MIDlet consists of a main class and a GameCanvas view, on which the screen elements are drawn. Although the background image has four circular drum pads, the pads are handled as rectangle-shaped areas. The MIDlet UI provides three buttons: record, playback, and exit. All buttons and pads have different images for the pressed, unpressed, and disabled states.

The MIDlet contains 12 different drum samples that can be assigned to the drum pads by pressing and holding on a drum pad. The action launches a drum selection wheel on top of the selected drum pad. The drum sounds are generated with Player objects. All drum samples and images are included in the MIDlet within the res subdirectory.

Figure: The sample selection wheel

For information about implementing the MIDlet, see section Implementation.