MUSEDPAINT
TOOLS · GPU
A browser-native painting application. A 4096² GPU canvas, a brush engine driven by pressure, tilt and velocity, an audio system that binds analysed sound to brush parameters, and a compositor in which effects are layers. Built as a side project, under two constraints: it has to run within the memory limits of Safari on an iPad, and the audio-reactive behaviour has to remain legible to an audience.

Platform:
Web (React, Three.js)
Year:
2026
Role:
Design & build
Canvas:
4096² WebGL, half-float

Platform:
Web (React, Three.js)
Year:
2026
Role:
Design & build
Canvas:
4096² WebGL, half-float
Introduction
The problem: latency, and the constraints it sets
musedpaint is a browser-native painting application, built as a side project to study instrument design. The defining constraint is latency. The interval between a pen moving and a mark appearing determines whether a painting tool is usable, and brush variety does not compensate for a failure there. The application is built around that constraint: the canvas is a 4096-square WebGL framebuffer rather than a 2D canvas, every dab is composited on the GPU in half-float precision so that tone builds without banding, and the loop that runs thousands of times per second does not allocate memory.


The application running on an iPad, unedited — painting, the brush and colour panels, the effect stack, and the compositor, recorded over two minutes and forty-seven seconds.
  • Seven layer types — raster, vector, text, adjustment, group, effect and video — each with masks, clipping and blend modes.
  • A brush engine driven by pressure, tilt and velocity, with five tip shapes and two distinct smudge models.
  • An audio system where any analysed channel can be wired to any brush parameter.
  • 124 effects in the registry, composed as stackable, maskable layers rather than a filter menu.
  • Brush import from Photoshop, Krita and Procreate; PSD in and out; a document format that embeds its own fonts.

  • All material shown here is output from the running application. The stroke sheets were painted by a scripted pen rather than by hand, so the path is synthetic, but the marks were produced by the dab pipeline itself, with pressure varying along each stroke and tilt set. The moving footage is a screen recording taken from an iPad.
    The Engine
    The dab pipeline, from pointer input to composited pixel
    Raw pointer input is smoothed, then converted into evenly spaced dabs along a quadratic Bézier curve. Dab density adapts to brush size, and the curve tangent provides the angle for oriented tips. A dynamics engine modulates size, flow, opacity, scatter and angle jitter from pressure, tilt and velocity. Each dab copies the current layer into a working target, composites itself on top and swaps — a ping-pong architecture in half-float textures, which prevents banding during a slow build-up of colour.
    The path from pointer input to pixels: coalesced pointer events are smoothed, spaced into dabs along a curve, modulated by pressure, tilt and velocity, then composited on the GPU through a ping-pong pair of half-float render targets before the layer stack and effect chain resolve to screen.INPUTTHE HOT PATH · NO ALLOCATIONSOUTPUTPOINTERcoalesced events, ~240 Hz on Pencilpressure · tilt · velocitysampled at pen rateSTABILISERlow-pass smoothing for penand mouse jitterAUDIO (OPTIONAL)bass · mid · high · presencerms · beat · pitchsampled around the hot pathBRUSH ENGINEevenly spaced dabs along aquadratic Bézier, density adaptiveto size; tangent gives tip angleDYNAMICS ENGINEmodulates size, flow, opacity,scatter, angle jitter, huefrom any bound channelDAB COMPOSITEcopy layer → working target,composite dab, swap. Half-floatso tone builds without banding4096² CANVASone WebGL framebufferper layer, not a 2DcanvasLAYER STACKraster · vector · textadjustment · groupeffect · videoEFFECT CHAINGPU passes over thecomposite below, mixedback and maskableTHE RULE THAT SHAPES EVERYTHINGThe dab path takes no new per-pointer-event allocations, readbacks or texture churn. Anything new must be branch-gated sothat switching it off costs nothing — which is why audio features are sampled beside the loop rather than inside it.AND THE ONE THAT SAVED THE IPADWork is scheduled off display rate, not input rate. A Pencil emitting 240 events a second no longer means 240 fullpipeline runs a second — input is sampled at pen rate and rendered at frame rate.
    Fig. 01 — Pointer to pixel. The middle column runs thousands of times a second, which is why nothing in it is allowed to allocate.
    Undo, and the memory budget
    Undo captures only the bounding box a stroke has touched, before and after, as small render targets rather than whole-canvas snapshots. On a 4096-square canvas this distinction determines whether the application continues to run or is terminated by the browser. Memory management proved to be a recurring constraint throughout the project.
    Brushes
    Brush engine: tips, dynamics and smudge models
    Five tip shapes are supported — circle, flat chisel, dense rake, sparse rake, and a bristle constructed from multiple sine frequencies — each rotating with stroke direction. Two smudge models are implemented, as the distinction affects the result: smear samples per-pixel behind the brush, comparable to a clone stamp, while dull samples a single colour per dab. The shipped library covers inks, a graphite range from 4H to 6B, oils and blenders. The engine imports brush files from Photoshop, Krita and Procreate, so existing brush sets do not require rebuilding.
    The working surface. Brush list left, colour picker in OKLCH with its gamut warning, and the dynamics panel right — shape, transfer, stroke, colour, texture, dual and audio, each able to take pen input. The three strokes are what those settings produce.
    Sound
    Audio-reactive painting: scenario and analysis
    The audio work started from a defined scenario: a person painting for an audience that is listening to music while watching. This sets requirements for every mapping. The causality between sound and mark has to be perceptible, the behaviour has to vary across a track, and the canvas cannot become static. Analysis covers beat detection, per-band onsets, smoothing, and offline feature extraction for tracks that can be analysed in advance.
    The Brush Composer: binding audio channels to brush parameters
    The Brush Composer is a nodal editor: audio sources on the left, brush parameters on the right, and a connection between them that constitutes the binding rather than describing it. Dragging from a channel to a parameter creates the binding, and deleting the edge removes it. Input sources include the analysed file, microphone input, MIDI, a websocket event bus and a Strudel panel for live-coded patterns. A set of brushes was designed specifically for audio input, including Beat Stamp, Spectrum Rake, Pitch Painter and Bass Melter.
    Audio source channels on the left — bass, mid, high, presence, level, beat and pitch — wired to brush parameters on the right, including size, flow, opacity, scatter, rotation, hue shift and smudge length. Each connecting line is a binding.AUDIO SOURCEBRUSH PARAMETERBASSMIDHIGHPRESENCERMS · LEVELBEATPITCHSIZEFLOWOPACITYSCATTERROTATIONHUE SHIFTSMUDGE LENGTHSources also include microphone, MIDI, a websocket event bus and live-coded Strudel patterns. An edge is the binding —drag to connect, delete it to unbind. No middle layer between the sensor and the parameter it drives.
    Fig. 02 — The audio brush as a patch. Representative bindings; the point is that any channel can reach any parameter.
    The compositor. Sixteen analysis channels on the left — RMS, five bands, beat and time-since-beat, spectral centroid, flux, zero-crossing rate, pitch. One is wired into a binding that owns a response curve, a range, and its own attack and release.
    One constraint shaped the implementation: audio features are sampled beside the dab loop rather than inside it. Any additional per-dab work is branch-gated, so that disabling the feature carries no cost. This is what allows the same brush to continue drawing correctly with audio disabled.
    Layers & Effects
    Effects as layers
    Effect chains run as GPU passes over the composite of the layers beneath them, mixed back by opacity and blend mode, and can be masked. Because effects occupy their own layer type, they stack, reorder and mask in the same way as any other layer. The registry contains 124 entries, with preset stacks named for their output — VHS, Datamosh, Riso, Dreamcore, Neon Night, Cymatics, Alchemy, Mandala.
    The stack on a single layer — CRT monitor, depth points, pixel sort, glyph engine, circuit bent, modulation, optical glass — each one toggleable and reorderable, with the brush’s own dynamics panel open beside it.
    One photograph through four effects
    Passing a single image through several effects demonstrates the range of the registry. A photograph was placed on a raster layer and processed by four effects, with no parameters altered beyond each effect's defaults. Modulation reads the image as a brightness field and renders it as drifting lines. Contour Lines traces iso-lines through its tone. Risograph separates it into two inks on rotated screens. Glyph Engine re-sets it as structure-matched type on a staggered lattice.

    The source, sitting on a raster layer.
    Clockwise from top left: Modulation, Contour Lines, Glyph Engine, Risograph. Every one of them is a GPU pass over the layer beneath, so any of them can be masked, faded by opacity, or driven by audio.
    Seven layer types and the compositing contract
    Raster layers own pixels that a brush can write to. Text, shape, adjustment, group, effect and video layers do not. Each is composited through its own path, and the paint guards, cursor resolvers and transform tools in the application respect that distinction. Mask editing is the one deliberate exception: while a mask is active a brush stroke targets the mask rather than the layer pixels, which is how a non-paintable layer is painted on.
    The layer stack, with the canvas and paper controls beneath it. Masks, clipping and blend modes apply uniformly across all seven types — including video, whose pixels are re-stamped every frame.
    Modulation, in motion
    Modulation is difficult to represent in a still image, as the movement carries the effect. It holds the lines back where the image is bright, so that they crowd in those regions and render tone as line density rather than as grey, and it re-integrates the field on every frame. The palette is a parameter and the lines are recomputed continuously. The recording below was made on an iPad while the effect was running.
    Screen recording from an iPad. The Modulation effect over a photographic layer, cycling palettes — 35 seconds, no edit, no post.
    The iPad Problem
    iPad: memory and scheduling constraints
    On an iPad the application stuttered and tabs terminated. Two causes compounded. The first was memory: at rest with a single layer, the application held approximately 1.3 GB — five always-live 4096-square half-float scratch targets, masks, screen targets and a post-process stack that was no longer in use — against a Safari tab ceiling of roughly 1 to 1.5 GB on a 4 GB device. Removing the always-live targets and placing undo on a byte budget reduced this by approximately 470 MB on device. The second was scheduling: work scaled with input rate rather than display rate, so an Apple Pencil emitting approximately 240 events per second triggered a full pipeline run for each event. Decoupling the two removed the stutter while retaining coalesced events for tablet fidelity.
    GPU memory at rest with one layer: about 1.3 gigabytes before the work, about 830 megabytes after, against a Safari tab ceiling of roughly 1 to 1.5 gigabytes on a 4 gigabyte iPad. Each extra layer adds about 134 megabytes.GPU MEMORY ON IPADMEGABYTESSAFARI KILLS THE TAB · 1.0–1.5 GBAT REST · BEFORE1300 MB5 always-live 4096² half-float scratch targets, masks, screen targets, a dead post-process stackAT REST · AFTER830 MB~470 MB cut on device — scratch targets removed, undo byte-budgetedPER EXTRA LAYER134 MBevery additional layer adds its own framebufferTHE OTHER HALF OF THE FIXRendering was scheduled off input rate rather than display rate, so an Apple Pencil at ~240 Hz ran a full pipeline percoalesced event. Decoupling the two removed the stutter without giving up tablet-rate input fidelity.
    Fig. 03 — On iPad, memory is the feature. The ceiling is fixed by the browser; everything else has to fit under it.
    The same build on the iPad, with an audio binding live over a bristle-rake layer — sample source, reactivity and analysis window all editable on device.
    The brush model does not change on iPad. What changes is whether the browser permits the document to exist at all, which makes memory and scheduling design constraints in the same sense as any interaction pattern.
    Documents
    Document format and font embedding
    Text is rendered through an SVG foreignObject so that live editing and rasterised output match. That raster runs in an isolated renderer with no access to the document's fonts or the network, which means a typeface appears only if its bytes were embedded. The .muse format therefore carries font binaries, captured at the point a font is selected rather than at save time, because the browser's font access permission is live at selection and a save must not raise a dialog. The authored font name is not rewritten when a font is missing, so the file opens correctly on a machine that has it.

  • PSD import and export, brush import from three ecosystems, PNG export.
  • Video export through WebCodecs, GIF, and timelapse with audio sync.
  • Vector layers keep parametric strokes, so zoom re-renders rather than magnifying pixels.
  • Video layers composite like any other layer, with effects and blend modes applying to moving frames.
  • Reflection
    Reflection: instrument design as a performance brief
    A painting application sets a performance brief that is difficult to meet partially. Latency is perceived rather than measured, banding is visible, and a memory leak ends the session mid-stroke. The project has been useful primarily as a study in instrument design — tools where the design decisions concern response and feel rather than layout, and where the person using the tool is performing rather than completing a task.