SOTO
A VS Code extension that turns the file you have open into a deterministic piece of generative art.
SOTO is a VS Code extension I’m working on that gives every file a face. It’s named after Jesús Rafael Soto, the kinetic and op-art sculptor whose artwork I was initially looking to emulate.
The idea
I’ve always gotten a kick out of personalising my working environment (reflected in my final year Art School project). Therefore I was smitten when I was introduced to VS Code Pets, years ago, by a colleague. I was looking for similar extensions and reckoned it would be fun to just build my own. I thought it would be cool to explore the concept of an extension taking your work, and using it to create something else.
How it works (at the moment)
Everything happens locally in the extension host and a small Canvas 2D webview:
- File metrics —
fileMetrics.tsruns a pass over the active document: line counts, comment/import/function-ish line counts, max line length, and an FNV-1a hash of the content. No AST parsing — it has to stay cheap enough to run on every keystroke (debounced ~500ms) and on save. - Deterministic rendering — those metrics feed a renderer (
renderArt.ts) built around a tiny mulberry32 PRNG. Composition is keyed on file identity (language + filename), so typing never reshuffles the whole piece — only the metrics that should move (shape count, shimmer phase) actually move.
Challenges
The hardest thing initially has been to try and ensure the user gets some kind of pleasing output in all cases. To begin with, very long, complex files ended up rendering far too many objects in the frame, making it overly busy. The generator also very much feels tied to the underlying inspiration pieces, with the parameters just tweaking angles, colours, width etc. It would be great to find a way to make every piece unique.
What’s next
- Generating pieces from entire codebases - and making the artwork representative of the structure in some way.
- Exporting/sharing the output.
- Rip off Hélio Oiticica less 👀 and add some kind of Swiss style-inspired option.