Android Musical Updates
I recently released some updates for my Android music application (“Musical”) and decided to post some screenshots and semi-technical explanations.
The pitch pipe (pictured on the right) lets you play any starting pitch (from C4 to C5) either by holding your finger on the screen or by blowing into the bottom of the phone. Because Android does not support true live audio analysis the play-by-blowing feature is limited and the volume by breath control is at very low resolution and with a bit of delay (it is only using a periodic sampling of input amplitude). Android also does not allow live generation of audio (playing audio from a memory stream), so the pitch pipe works by stringing together and looping “prerecorded” sine waves of various frequencies.
The piano (pictured above) is multi-octave (although the bottom octave does not work–Android’s midi synthesizer will not play notes that low) and can be played with your fingers. It is not multitouch, as Android on the G1 does not currently support multitouch (although the hardware technically supports it, it is disabled and there is no public API). Switching octaves is accomplished by dragging the keyboard or the “current window” in the upper mini-keyboard. Notes vary based on how long they are held down (longer hold = longer note) and although multiple keys cannot be pressed at once, multiple notes can be playing at once (it is polyphonic). The piano “activity” (a screen in Android) plays the notes via SoundPool (an unsupported, unstable, and mostly undocument sound API–but the only one with a fast enough response time) and plays a series of premade midi files using Android’s built-in synthesizer (as there is no way to directly access the synthesizer in code to play a specific note). Because it uses SoundPool, it is currently rather unstable and sometimes locks up and crashes (the audio stack overloads). Hopefully when the next version of the SDK comes out, Google will provide a finalized SoundPool and better support for generating live sounds.
To download the latest version, just search for “Musical” in the Android Market on your G1.


I read all of that. I’m such a good friend.
Oh, and G1 Sux!!11
What do you mean by “Android does not support live audio analysis” and “Android does not support true live audio analysis”? Are these impossible considering Android’s current state? Is it architectural, to the point of being very hard to add in?
The current SDK/API provides no way to read audio signals into memory as they are being recorded. It is not an issue with Android’s core framework, which already supports live audio (ex: for phone calls) and runs the same sound subsystem as most Linux systems. There are just no ways to currently access this feature from Java. This can (and very likely will) be easily fixed by an update to the SDK, which at the moment is extremely lacking in terms of sound. The roadmap claims that the Cupcake update somewhat remedies the sound features, but I don’t know exactly what it will be adding.