This Java ME application demonstrates the usage of multiple audio players on a Series 40 device. It is a virtual drumkit that lets you play percussion sounds by tapping the screen. You can record your beats and play them back later. It is also possible to play on top of your latest recording. The updated version has a new acoustic kit and pad kit views and multitouch support for Series 40 full touch devices, optimised graphics drawing, and audio playback.
This example demonstrates:
- How to use the Mobile Media API
- Managing multiple simultanous audio players
The application is hosted in GitHub: https://github.com/nokia-developer/drumkit-jme
For more information on the implementation, visit Java Developer's Library: http://developer.nokia.com/Resources/Library/Java/#!code-examples/multimedia-drumkit.html
Java™ Platform, Micro Edition (Java™ ME) basics
SoundManager.java- The class that handles all audio playback and recording.
FullTouchDrumkit.java- GUI optimised for 400x240 resolution with multitouch.
TouchAndTypeDrumkit.java- GUI optimised for smaller resolutions.
DrumKit.java- Abstract base class for both GUI types.
WheelMenu.java- The drum selection menu used in TouchAndTypeDrumkit.
Audio latency was the main concern when designing the application. Luckily, on Series 40 it is fairly easy to get low latency, at least on the majority of devices. The main concern was managing multiple concurrent audio players and dealing with memory limitations.
From UI point of view, the application has been optimised for 240x320 and 240x400 screen resolutions using two sets of graphics.
Series 40 full touch and touch and type devices.
- Nokia Asha 303 (Java Runtime 1.1.0 for Series 40)
- Nokia Asha 305 (Java Runtime 2.0.0 for Series 40)
- Nokia Asha 306 (Java Runtime 2.0.0 for Series 40)
- Nokia Asha 309 (Java Runtime 2.0.0 for Series 40)
- Nokia Asha 311 (Java Runtime 2.0.0 for Series 40)
- Nokia X3-02 (Series 40 6th Edition FP1)
- Nokia C2-03 (Java Runtime 1.0.0 for Series 40)
- NetBeans 7.2
- Nokia SDK 2.0 for Java
The application graphics have not been optimised for Symbian devices.
There is notable audio latency on Symbian devices. Also, the MIDlet does not perform well on lower-end Nokia Asha devices, such as the Nokia Asha 305 and Nokia Asha 306.
This example was created with NetBeans 6.9.1 and the Nokia SDK 2.0 for Java. The project can be easily opened in NetBeans by selecting 'Open Project' from the File menu and selecting the application.
Before opening the project, make sure the Nokia SDK 2.0 for Java is installed and added to NetBeans. Building is done by selecting 'Build main project'.
To install the application on a mobile device, transfer the JAR file via Nokia Suite or Bluetooth.
On devices with 400x240 display resolution the application starts in landscape mode. The GUI has two modes: acoustic drum kit and pad drum kit. On touch and type devices the application starts in portrait mode, and only pad drum kit is available.
You can record sequences of your drumming and then play the sequences afterwards. It is also possible to play pads on top of your last recording. A long tap on a pad opens a wheel menu, which can be used to change samples on the pads.
- 1.3 Reference to projects.developer.nokia.com has been removed
- 1.2.0 New UI for 400x240 resolution with multitouch support. Optimised graphics drawing and audio playback. Refactored source code.
- 1.1.0 Refactored UI framework and updated graphics and icons. Optimised to run on Nokia Asha 311.
- 1.0.0 First release.