Knotcoding – inspired by Quipu

Our PENELOPE project looks to integrate ancient weaving into the history of technology. One part of this work is to create new technology, such as the Pattern Matrix, incorporating designs for new interfaces based on ancient structures of weaving. Our aim is that the structural similarities between ancient weaving and the technologies we create runs deep; for example the binary representation of numbers (as a configuration of four magnets) within the Pattern Matrix ‘pucks’, is inspired by the configuration of coloured threads in traditional tablet weaving. Dave Griffiths explains the earlier development of his design the pattern matrix in a blog post from Weaving Codes project, the precursor to PENELOPE.

The Pattern Matrix is designed to represent the ups and downs of weaving, naturally forming a grid. However we are also developing mini programming languages which take a different approach, instead representing the path of a single thread around a weave, rather than an overall repeating structure. The problem is that such a path is represented not with a two-dimensional grid of values, but in a computer programming language. On the surface, code written in a programming may look grid-like, but in terms of its syntax, the code actually forms a tree structure.

I’ll return to these tree structures later in this post, but first lets turn our attention to a different textile technology: the Andean Quipu.

Drawing of a Quipu (Meyers Konversations-Lexikon, 1888)

Quipu is the practice of storing data in knots, most famously used by the Inca empire. Although the Quipus that remain are not fully understood, we do understand that many of the knots represent numerical data, perhaps for astronomy or agricultural purposes. Dave Griffiths and Julian Rohrhuber, again in work relating to the Weaving Codes project, have investigated data from Quipus through visualisation and sonification. Greatly inspired by this, and by Dave’s suggestion of representing code in Quipu, I decided to try making Quipu-like structures myself. After spending time in the library and reading on-line articles, but mostly hands-on work, here’s what I found.

Learning to knotcode

I started with yarn, in particular 100% cotton yarn from a local haberdashers. I was tempted to try Alpaca yarn, but couldn’t immediately get hold of any, and read that most Quipu finds are in any case cotton. The first thing I did was to ‘double up’ a piece of the yarn. This is done by putting twist into it, for example by standing on one end of the yarn, and twisting the other with my fingers, or by attaching something heavy (like a penknife) to one end, letting it dangle, then spinning the object. You need to spin it so that the yarn tightens, rather than loosens. You then fold the yarn in half, hold the two ends together and let the rest wrap around itself.

A piece of yarn ‘doubled up’ into a strand.

One reason for doubling up the strand it to make it thicker and perhaps a little easier to work with, but there is a more crucial reason. You can see in the above that I’ve tied a slip knot into it on one end, simply to stop it from unravelling. The other end you can see another loop, formed by the doubling process, where the original yarn folds back on itself. This end loop is what is used to hitch one strand onto another. I found there is a balance to be struck when twisting up the original yarn – too loose and it makes the resulting knots indistinct, but too tight and it’s harder to create this loop on the end of the strand.

Close up of the end loop

An early authority on Quipu was a book “The Ancient Quipu” by Locke (1923). Reading his descriptions and illustrations of the structure of Quipu, I get the strong impression that the author didn’t understand how this doubling is done, or the structure of the resulting strands, despite being common practice in textile crafts. This further demonstrates the importance of getting hands-on with threads. It strikes me that this structure influences the behaviour of the strands and indeed practicalities of how data can be encoded within it.

Illustration from Locke (1923) apparently showing incorrect structure of quipu strands, evident in the top loops and hitches.

I understand that all quipu consist of a main cord to which the knotted strands are attached. So the next step is either to hitch the new quipu strand onto a main cord, or tie knots in the strand before attaching it. It doesn’t seem to matter too much which order you do it – handily, there are two ways to hitch the strand on to the main cord, one of which does not involve feeding the strand through its own loop, in which case ready-tied knots don’t get in the way. I found it a little easier to tie knots first, starting with the bottom of the strand (with the loop being at the top). The sooner you can get a knot in the better, as it stops the strand from unravelling, although I found myself putting a quick and temporary slipknot in the bottom of strands to buy myself time, so it’s nice to see the same done in the above illustration (k).  Anyway here are some knots:

The above contains five knots which represent two numbers. From the bottom, the strand has a ‘long knot’ with three turns (representing the digit ‘3’), then three overhand knots close together (representing the digit ‘3’ in the tens position), forming the number 33. It then has another long knot, this time with four turns, representing the number 4. I found this webpage of the “khipu database project” to be the clearest and most consistent explanation of knotting numbers. It’s helpful that the Inca people used the same decimal number system as us.

The next step is to hitch the strand onto the main cord. I ‘doubled up’ the main cord twice, which I believe technically makes it a rope (apparently ropes are made of strands, which are made of yarns, which are made of fibres). A cow hitch is used, which as I said before can be done in two ways – either by creating two half hitches in opposite directions, and sliding it onto the main cord, or by passing the strand around the main cord and through its own end loop. It’s good to have this flexibility, I imagine what you end up doing depends on what’s already attached to the strand or main cord.

Ok, that’s it!

Knotcoding in practice

Now it’s just a case of deciding what to knot. Earlier on in this post, I started talking about the tree structure of code. Here’s an example:

jux (|*| speed "1.5") $ foldEvery [3,4] (0.25 <~) $ stack [
    s "less:2([3 5]/2,8)" # unit "c" # speed "4",
    s "less(3,8)" # cut "1" # up "{0 -3 1}%32",
    s "{~ [~ cp] ~ less:3/2 ~}%4",
    s "[less:1*2 less:1]*2"]

It’s actually a piece of TidalCycles code representing a rhythmic pattern, created by Kindohm. It sounds like this:

I managed to knot this code into a quipu-like structure one evening, while away camping:

The above quipu-like structure requires understanding of both TidalCycles and knots to be read, but briefly:

  • Knots are numbers, including a slightly awkward attempt at representing rational numbers (tying the numerator around the denominator)
  • Values which are not directly numerical are represented with beads. Samples are yellow for cp and purple for feel (the sample number is a number, so is a knot). As an exception, single letters of the alphabet are treated as ordinal numbers and so represented with knots, e.g. c = 3.
  • Function names are a bead followed by a brown bead. In particular, red brown for jux, pink brown for foldEvery, blue brown for ~>
  • Subpatterns and functions-as-parameters are separate strings tied on to the side (currying works out fine)
  • Parameter names are a bead followed by a black bead. red black for sound, green black for cut, blue black for up, pink black for speed.
  • Hitched-on subsidiary cords are parenthesis, e.g. parameters, lists or other sub-statements – this is where the tree structure comes in

The beads by the way are ‘Hama beads’ (or a cheap copy from Ikea), which turned out to be perfectly sized, and easy to thread on using a crochet hook.

I learned a lot in the process of making this. Particularly that knots use up a surprising amount of yarn, and indeed higher numbers use up more than lower ones. Real Quipu are very organised with units, tens, hundreds etc equally spaced. I’m not sure how this is achieved, perhaps it means you need to start at the top of the quipu and work down, rather than the other way around. For this knotcode I did not even attempt to keep the spacing between numbers consistent, and as a result I think it would be a big challenge for someone to interpret. Furthermore the knots themselves are not easy to count. I’m sure this is partly down to my poor technique and lack of knowledge, but for now I mostly blame this on the yarn, which is of course designed for clothing not quipu.

I’m really happy with the results, nonetheless. In a way it feels like a more fitting representation of code than discrete characters on a screen, due to the physical tree structure of the strands, hitched on strands, matching well with the structure of the syntax tree. The next step would be to attempt to compose a piece of music in knots and beads, and then type it into a computer to hear what it sounds like.. It would be interesting to see if the affordance of knotting has an impact on the music that is made.

Knotcoding workshop

Knotcoding workshop materials

I ran a workshop with a small group of people in Sheffield (as part of a fundraiser for Hannah Directory), to try out this approach of storing data in knots with others. The aim for me was to see what they thought and what kind of data they’d like to store and how. They quickly got the hang of it inside the two-hour workshop, and generally decided to encode words in quipu numbers, where 1 = a, 2 = b, and so on. Two people collaborated on knotting their names together, another a name of a longstanding whatsapp group they share with friends. One started work on an artwork, with significant dates encoded on each strand. Another just concentrated on preparing the strands, wanting to knot a message to their partner later on, in private. A few of my rather low quality photos from the workshop can be found here.

That’s it on knotcoding for now. This was a digression from the more pressing topic of modelling the integration of weaving and tablet weaving, but might well prove useful later on in the project, if we need a nice way to represent the syntactical tree structures of code.


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.