Package-level declarations

Types

Link copied to clipboard
class Anchor(x: Float = 0.5f, y: Float = 0.5f)

A place on screen, as shares of the width and the height.

Link copied to clipboard
class Camera2D(wander: Float = 0.1f, punch: Float = 0.1f, roll: Float = 0.1f, shake: Float = 0.004f, cuts: Boolean = true, minZoom: Float = 0.94f, maxZoom: Float = 1.3f, seed: Int = 1)

Moves a whole flat drawing, the way CameraRig moves a flight.

Link copied to clipboard
class CameraRig(topSpeed: Float, restSpeed: Float = topSpeed * 0.04f, shove: Float = topSpeed * 0.5f, sway: Float = 0.4f, swayUp: Float = sway * 0.9f, lean: Float = 0.25f, baseFov: Float = 70.0f, cuts: Boolean = false, seed: Int = 1)

One camera for every drawing that flies, so they all answer the music the same way.

Link copied to clipboard

How the echo layer is laid over the ground: covering it, or adding its light to it.

Link copied to clipboard
class EchoCopy(val zoom: Float = 1.0f, val angle: Float = 0.0f, val mirrorX: Boolean = false, val mirrorY: Boolean = false, val share: Float = 0.3f)

A second copy of the last frame, scaled by zoom, turned by angle radians and mirrored. share is taken out of the trail, so what comes back still totals less than one.

Link copied to clipboard
class EchoFrame(val zoomX: Float = 1.0f, val zoomY: Float = zoomX, val spin: Float = 0.0f, val driftX: Float = 0.0f, val driftY: Float = 0.0f, val centreX: Float = 0.5f, val centreY: Float = 0.5f, val copy: EchoCopy? = null)

How the last frame comes back this frame: zoomed (zoomX, zoomY per sixtieth of a second), turned (spin, radians a second) about a centre that can move, and drifted (shares of the screen a second). copy adds a second, fainter, turned or mirrored copy.

Link copied to clipboard
class FlashGuard(mostPerSecond: Int = 3)

Holds the light of a picture to a flash limit, whatever asked for the light.

Link copied to clipboard
class FormReadout(val form: String, val morphs: Int, val births: Int)

What form a drawing is in and how often it has changed, for a test or a readout.

Link copied to clipboard
class MoodSpec(val calmTrail: Float, val livelyTrail: Float, val calmZoom: Float = 1.0f, val livelyZoom: Float = 1.0f, val calmSpin: Float = 0.0f, val livelySpin: Float = 0.0f, val calmBloomShare: Float = 0.4f, val livelyBloomShare: Float = 0.4f, val calmWarp: Float = 0.0f, val livelyWarp: Float = 0.0f, val calmDriftX: Float = 0.0f, val livelyDriftX: Float = 0.0f, val calmDriftY: Float = 0.0f, val livelyDriftY: Float = 0.0f)

Feedback settings for calm music and for lively music, blended between as the mood moves.

Link copied to clipboard
data class PostSpec(val bloom: Float = 0.8f, val bloomRadius: Float = 0.04f, val threshold: Float = 0.4f, val vignette: Float = 0.28f, val grain: Float = 0.012f, val glitch: Boolean = true, val aberration: Float = 0.0025f, val scanlines: Float = 0.0f)

The finishing pass laid over a drawing: light spilling out of the bright parts, colour fringes towards the edges, darker corners, a little grain, and for a few drawings the lines of an old screen.

Link copied to clipboard
data class PostSwitches(val bloom: Boolean = true, val aberration: Boolean = true, val vignette: Boolean = true, val grain: Boolean = true, val glitch: Boolean = true, val scanlines: Boolean = true)

Parts of the finishing pass a person can switch off for every drawing at once, whatever each drawing asks for.

Link copied to clipboard
class RenderQuality(scale: Float = 1.0f, var dynamic: Boolean = true)

How much of the canvas the feedback buffers cover, and whether that may drop while frames run slow.

Link copied to clipboard

How long the processor spent preparing each part of a frame, in milliseconds, smoothed.

Link copied to clipboard
class Scene3D

Turns points in space into points on the canvas.

Link copied to clipboard
interface Visualization

One drawing.

Link copied to clipboard
object VizCatalog

Every independent preset this library ships, in one flat catalogue.

Link copied to clipboard
sealed class VizCurve

The fixed transform from a driver to a property. Nothing here rescales itself as a song plays.

Link copied to clipboard
class VizDirector(catalogue: List<Visualization>, seed: Long = Random.nextLong(), minimumHoldSeconds: Float = 8.0f)

Changes scenes only at a supported musical boundary. Tempo, elapsed time and energy-only flags cannot authorize a change. A seeded choice matches the scene to current energy.

Link copied to clipboard
class VizDrive(val driver: VizDriver, val property: VizProperty, val curve: VizCurve = VizCurve.Linear, val response: VizResponse = VizResponse.Direct)

One driver moving one property, through one fixed curve, with one response timing.

Link copied to clipboard

An audio value a drawing reads.

Link copied to clipboard

How busy a drawing is, so something choosing for the listener can match it to the music.

Link copied to clipboard
interface VizFuture

A window onto audio that has been analysed but not yet played.

Link copied to clipboard
class VizMapping(val drives: List<VizDrive>, val needs: Set<VizNeed> = emptySet(), val silence: VizSilence = VizSilence.Idle, val quality: List<VizQualityControl> = emptyList(), val silenceSettleSeconds: Float = 2.0f)

What a drawing does with the audio, in a form a test and a menu can read.

Link copied to clipboard

What a drawing needs from the host to draw as intended.

Link copied to clipboard

The colours a drawing works in.

Link copied to clipboard
class VizParam(val name: String, val min: Float, val max: Float, val default: Float)

One setting a drawing lets a person change while it runs.

Link copied to clipboard

A part of the picture that a driver moves.

Link copied to clipboard

What a drawing can give up under load. An empty list means the cost is fixed.

Link copied to clipboard
class VizRenderState(val frame: SpectrumFrame, val timeSeconds: Float, val deltaSeconds: Float, val palette: VizPalette, val musicTime: Float = timeSeconds, val future: VizFuture? = null)

Everything a drawing needs to know about this instant.

Link copied to clipboard
class VizResponse(val kind: VizResponseKind, val seconds: Float = 0.0f, val delaySeconds: Float = 0.0f)

The timing of one response: what shapes it, how long it takes, and any deliberate wait.

Link copied to clipboard

How a drawing's own timing shapes a response. This is on top of the analysis envelopes.

Link copied to clipboard

What a drawing does when there is nothing to hear.

Link copied to clipboard

How one drawing gives way to the next.

Functions

Link copied to clipboard
fun SpectrumTimeline.asFuture(positionMicros: () -> Long): VizFuture

Lets a drawing see the audio that has been analysed but has not been played yet.

Link copied to clipboard
fun DirectedVisualizerSurface(director: VizDirector, frame: () -> SpectrumFrame, palette: VizPalette, modifier: Modifier = Modifier, future: VizFuture? = null, post: Boolean = true, switches: PostSwitches = PostSwitches.All, stats: RenderStats? = null, quality: RenderQuality? = null, reducedMotion: Boolean = false, visible: Boolean = true, framesPerSecond: Int = 0)

The same surface, with a director deciding what to show and how to change to it.

Link copied to clipboard

One whole frame: the background, the ground, the echo layer and the front.

Link copied to clipboard

A whole frame of a drawing that is not inside a VisualizerSurface, with no trail.

Link copied to clipboard

The echo layer of one frame, on a transparent bitmap: the frame before it faded and moved, then the new drawing. Pass the bitmap from the frame before as previous.

Link copied to clipboard
fun VisualizerSurface(visualization: Visualization, frame: () -> SpectrumFrame, palette: VizPalette, modifier: Modifier = Modifier, future: VizFuture? = null, post: Boolean = true, switches: PostSwitches = PostSwitches.All, stats: RenderStats? = null, quality: RenderQuality? = null, framesPerSecond: Int = 0, reducedMotion: Boolean = false, visible: Boolean = true)

Draws visualization every display frame, in layers: the ground, the echo layer, the front, and then the finishing pass.

Link copied to clipboard
inline fun DrawScope.withCamera(camera: Camera2D?, parallax: Float = 1.0f, block: DrawScope.() -> Unit)

Draws block through camera, moved parallax as far as the camera moves: less for far layers.