-
Notifications
You must be signed in to change notification settings - Fork 2
Home
This is a simple piano-like instrument. Press keys on the keypad to play it. Be ready, though, that your device will not allow you to play more than two keys at one — it is a rather prevalent design constraint.
If your device has a touchscreen, you may press the buttons on the piano keyboard directly.
Use arrow keys to change octave of the keyboard.
You may change volume in the likewise named formular.
If your device allows to switch timbre, a special formular will be available.
Conversely, if your device does not have a tone generating capability at all, the program will show an error dialog and shut itself down.
The settings you change are saved upon quitting the program.
The program began it’s life as an exact copy of the Piano MIDlet from the book “Wireless Java Developing with J2ME, Second Edition” by Jonathan Knudsen, published by Apress, ISBN 1590590775 .
Seeing that twelve keys on an usual cell phone keypad are as many as there are keys in an octave, I modified the MIDlet to be controlled by keypad buttons only.
After using the resulting application and unnerving my choirmaster doing so, I approached some choir members from the mezzo-soprano voice and asked them about suggestions for improvements; the suggestions were:
- making sounds of arbitrarily length and loudness
- ability to switch timbres
These suggestions went to the issues #4 and #1 respectively. The rest was technical.
The source code is packaged into the package piano. The code was separated after the MVC pattern as much as possible, the class PianoCanvas
being both controller and view, the player classes (TonePlayer
and MIDIPlayer
) being views and the class Piano
being both the program launcher and the model.
The source code is well-commented and well-documented.