String Art 1 String Art 2

Creative Programming / Creative Coding

Here’s what’s been on my mind:

  • making a programming language for origami is hard.
  • string art is cool and can be replicated in ocaml-joy.
  • comparisons with music

This is something I’ve been fascinated by since a young age. This was my first experience with programming that I liked and wanted to do more of. Of relatively late, I have been working with ocaml-joy (hosted on kaustubh.page/joy) where I had last explored tessellation art.

Tessellation 2

While in a fit of boredom, I remembered that @anandology had once described his explorations with string art. I took inspiration and started hacking on OCaml Joy’s online editor. The result was this starter code that comes with a few abstractions to emulate a nailboard and threads. It’s rough around the edges, but I was able to take an instructables post and reliably see it in my canvas (see the heart photo at the top).

Along similar lines, I have Wolfram’s A new kind of science on my reading pile. That book is full of interesting visualizations that I want to get to.


I can’t help but see the similarities between string art and music. There’s a period with which patterns repeat themselves (a bar). There is a play on how big each step is and that changes the output you will find. Two interesting explorations come to mind here:

  1. conversions for these art steps to music exist and must surely sound good (time to test the hypothesis)
  2. a program that uses code to represent a certain visual animation is a program that represents a certain musical composition. what combination will look and sound the best?

All of this is another way to say that visual art, when abstracted enough - has similarities to musical art, when abstracted enough. In math, we do this all the time. Abstract something in one place (say, counting -> numbers) and then play with that abstraction until we end up with natural language (LLMs) or even utter nonsense such as a complex plane and the Mandelbrot fractal.


Besides this, I also (briefly) felt the motivation to bulid a programming language for origami. A way to describe the folds unambiguously, such that an interpreter will know for sure the state of the paper and be able to create a 3D visualization.

The more I thought about it, the more I realised the difficulty of this problem. How do we describe a fold in a way that feels more or less natural to a human and is at the same time unambiguous? An instruction as simple as “Fold such that corner P aligns with corner Q” can have multiple ways of being done in 3D space. It gets more complicated with more folds. How do we keep track of the state? How does the user identify one edge from another? A single fold can create multiple new edges and corners in a way that isn’t easy to track without an origami REPL.

This is a problem that, nonetheless, is interesting to me. It feels like a challenging exercise in a way that is comparable to a hard, multi-day trek.


  • tixy.land
  • similar to the origami language, can there be an unambiuguous language to describe crocheting?
  • spirographs
  • how do i extend the string art abstractions to accommodate more complex nail-shapes - such as the flower hole pattern?