VisualizerSurface
Draws visualization every display frame, in layers: the ground, the echo layer, the front, and then the finishing pass.
The echo layer is the one with a memory. A drawing with a trail draws it into a transparent bitmap that also holds the last frame, faded and usually moved, so every mark leaves an echo. The ground and the front are drawn straight on the canvas, so in a window they cost the graphics card rather than the processor. Two bitmaps are kept and swapped, because a frame cannot safely be read and written at once.
frame is a function, read once per step of the surface's own clock, so a change of analysis does not redraw the surface by itself. future is optional and lets a drawing see the audio that has been analysed but not yet played.