Further attempts at untangling tablet weave

One of the great unknowns following the first weavecoding project was the nature of tablet weave. Other than a few primitive attempts that didn’t work in all cases and lead us to further questions, modelling tablet weave fully was left as an undeciphered mystery. Tablet weave is a complex and particularly ancient form of weaving, while it’s simple to do with easily found materials, it produces a kind of double weave with twisting, and you can create crazy higher level 3D structure as it is free from the constraints of fixed loom technology.

pic

The trick to start understanding this (I still have quite some way to go) came from only thinking about a single square tablet. If we follow the paths of each of the four threads while turning the square 90 degrees at a time we can see how tablet weaving is a combination of a weave (up and down movement) and a braid (left and right), as it twists the threads in relation to each other.

scribble

From this sketchy starting point it was possible to create two 3D objects to represent each twist, one for clockwise and another for anticlockwise. If you colour the separate threads appropriately and combine them together you get something like this:

pre-tension

While this looks fancy, it’s wrong. The threads may be in the correct form conceptually, but woven structure comes about as a relationship between the positioning of the threads and the tension applied to them. Many of the threads above should be pulled straight and push others out of the way to give a pattern that was actually straight stripes of colour, rather than chevrons. So how can we add tension?

One way to approach this problem would be to use a physical simulation of the kind usually applied to cloth simulation, and ‘relax’ the the threads to achieve a realistic result, using a stochastic approach to iteratively tighten them within collision constraints, until it ‘looked right’. The problem with this is that it wouldn’t lead to a deeper understanding of what is going on here. This in a way is related to a bigger issue with AI and machine learning, where techniques like artificial neural networks can be trained to solve problems well enough to be useful, for example in speech recognition – but do not provide any new knowledge about language or understanding of deeper scientific issues.

So if we want to understand some of the ‘thread logic’ of table weaving, we are can approach this in a more symbolic manner. Can we add additional straightened threads to our two twisted ones?

As with the twists, there need to be two forms of straightening – left or right twist to straightened threads, and then we need to get back from a straightened thread to a left or right twist.

primitives

Notice that some of these shapes connect, while others are incompatible. We can start with the original twisted weave above, and process it to pull the threads straight. In order to do this we need to know the past and future actions of the weaver, or the current twist in the context of those before and after it. This makes sense, as when weaving structure emerges fully a few wefts behind the current one you are weaving – only as the tension is applied to the fabric does it take form.

The rules to describe this turn out to be well represented as a diagram. The nodes are the 3D shapes required and the edges are the actions of the weaver (the special ‘floating’ state change interestingly depends on the action before the last one – memory does seem important in tablet weaving).

tension

For example, we can ‘left twist’ repeatedly (the top right state) as the arrow points to itself. If we start going in the other direction we then need to pass through two straightening states to get to a full ‘right twist’. If we start going backwards and forwards in smaller numbers of turns then more complex things happen.

When we process the first weave with these rules, you can see some of the straightening effects. The tension on the threads means that some cover up others, e.g none of the yellow threads are now visible on the top of the fabric at all.

post-tension

The structure is more visible here than on a real weaving as the threads are thinner that they would be for the resulting weave which would be more densely packed together (this is less realistic but helps to understand what is going on).

How do we know if any of this is correct? The only way to test this for sure is against real weave. We can try out different sequences of actions and see if the model matches. As indicated above, tablet weaving is a technique that comprises several categories of weaves – these define some specific types of structure we can test.

Type 1: Repeated twists and turn back

Most normal tablet weave consists of twisting repeatedly 90 degrees in the same direction and weaving a weft each time. In practice there is only so far you can go in the same direction before the unwoven warp threads behind the tablets get tangled up, so you need to change direction and go the other way until they are untangled, providing some symmetry to the pattern. The first example has all the tablet threads aligned in the same sequence – and we weave 8 turns one way and 8 turns back again. You can see in the middle when we change direction we create a short straightened ‘float’ section which causes the tension to pull the threads straight here.

aligned-comp

One of the further mysteries that our first tablet weaving simulations couldn’t previously recreate were situations where the pattern on the back and the front of the weave were not opposite of each other. This is highly unusual in weaving, but this model seems to represent this correctly. Here the actions are the same as the first example – 8 one way and then the other, but the thread colours in the tablets are offset from one another so they are staggered and you get the diagonal patterns.

rotate-comp

Type 2: Single faced double weave

Part of the complexity of tablet weaving is because it is a kind of double weave – there are two intertwined weave structures happening at the same time. If we repeat two wefts of 90 degrees one way followed by two more the other direction, the two weaves remain on the same side of the textile – which can be seen clearly if we colour them appropriately. This example keeps the white weave on the top side with the brown one on the lower side.

doublefaced-comp

Type 3: Degenerate floats

The third type of weave is not really a weave but a breakdown of the process caused by only weaving single 90 degree turns backwards and forwards repeatedly. This means half of the threads are not incorporated into the weave and ‘float’ along the surface on both sides.

float-comp

While the language to fully describe the tablet weaving has yet to be developed properly, you can have a go yourself with this model which is currently online here (takes a few moments to render at first).

This gets us closer to a working model of tablet weaving, and provides something we can start to use for a more advanced aims of the Penelope project. For example, can we use the pattern matrix to tangibly livecode tablet weaving? Does this make it possible to explore and explain this type of weaving?

If this kind of textile wasn’t complicated enough, people in ancient times combined multiple weaving techniques, for example tablet weaving and warp weighted weaving in the same piece of fabric. Creating a kind of ‘grand unified’ weaving model is an additional future challenge, so we can start to understand better the thought processes involved in these advanced techniques.

Ellen Harlizius-Klück – Textile MATRIX

Next week the weaving codes project assembles in the Museum für Abgüsse Klassischer Bildwerke in Munich. We’ll be working for a few days surrounded by these characters to get us in a classical mood:

antike8

The museum is hosting Ellen’s ‘Textile Matrix’ exhibition, a crossbreeding of logical science, religion, crafts and visual arts. The word ‘matrix’ originates from the latin word for mother or uterus, but today is predominantly used in mathematics, science and technology. Her work, as much of the weavingcodes project, provides new perspectives on connections between modern digital technology and ancient weaving.

Alex, Ellen, Emma and I will be in residency in the museum from the 6th May and I’ll be reporting our activities here as usual. On the 9th there will be talks and slub will be performing a special livecoding gig. On the 10th we will be presenting the work we have been doing during the residency and inviting people to participate in a citizen science event, exploring mathematics, weaving, music and code – including the brand new pattern matrix tangible weavecoding device.

An Incremental Approach to Compiler Construction

Compilers are perceived to be magical artifacts, carefully crafted
by the wizards, and unfathomable by the mere mortals.

This is from a great paper by Abdulaziz Ghuloum on how compilers are made. It, along with a timely email from Julian Rohrhuber inspired me to have a go at making a tiny one for compiling scheme to betablocker – the idea is that you only need a handful of scheme primitives before you are able to bootstrap all the other code together. Betablocker is no way powerful enough to go too far with this, but I think there may be some good uses for compiling bits of fluxus scheme code on Raspberry Pi and Android, maybe not to native binary but mixing an interpreter with a fast intermediate language for graphics processing would make it possible to compile object deformation inner loops i.e. (pdata-map!) and friends for per-vertex operations, but have it transparently the same language to the user/livecoder.

I’ve only dealt with fixnums, booleans, null lists and a handful of simple core procedures, but compiling something stupid like this:

(and
  (zero? (- (+ 12 4) (+ 43 (add1 34))))
  (boolean? #f))

Results in this:

compiled

Via the slightly more conventional looking:

   pshl 24
   pshl 8
   add
   pshl 86
   pshl 68
   pshl 2
   add
   add
   sub
   pshl 0
   equ
   jmpz label-1
   pshl 4
   jmp label-2
label-1:
   pshl 0
label-2:
   pshl 0
   pshl 3
   and
   pshl 3
   equ
   jmpz label-3
   pshl 4
   jmp label-4
label-3:
   pshl 0
label-4:
   and
   jmpz label-5
   pshl 4
   jmp label-6
label-5:
   pshl 0
label-6:

Spork factory

A system for creating an abundance of useless software for tiny devices. Spork Factory evolves programs that run on Atmel processors – the same make as found on the Arduino, in this case the ATtiny85 – a £2.50 8 pin 8bit CPU. I’m currently simply using a piezo speaker as an output and evolving programs based on the frequency of the sound produced by flipping the pins up and down, so creating 2bit synths using the Fourier transform as the fitness function. With more hardware (input as well as output) perhaps we could evolve small robots, or even maybe cheap claytronics or programmable matter experiments.

This project reuses the previous genetic programming experiments (including jgap as its genetic algorithm framework), and is also inspired by Till Bovermann’s recent work with Betablocker in Supercollider for bytecode synthesis.

The programs generated don’t use the Atmel instruction set directly, but interpret a custom one derived from Betablocker for two reasons. Atmel processors separate their instruction memory from data (the Harvard architecture) which makes it difficult to modify code as it’s running (either uploading new evolved code or running self modifying instructions), the other is that using a simplified custom instruction set makes it easier for genetic algorithms to create all kinds of strange programs that will always run.

I’ve added an ‘OUT’ instruction, which pops the top of the stack and writes it to the pins on the ATtiny, so the first thing a program needs to do is generate and output some data. The second thing it needs to do is create an oscillator to create a tone, after that the fitness function grades the program on the amount of frequencies present in the sound, encouraging it to make richer noises.

Here are two example programs from a single run, first the ancestor, a simple oscillator which evolved after 4 or 5 generations:

out
out
nop
nop
dec
nop
nop
nop
out
nop
jmpz 254
nop
nop
nop
dup

It’s simply outputting 0’s, then using the ‘dec’ to decrement the top of the stack to make a 255 which sets the rightmost bit to 1 (the one the speaker is attached to) and then loops with the ‘jmpz’ causing it to oscillate. This program produces this fft plot:

After 100 or so further generations, this descendant program emerges. The dec is replaced by ‘pshl 81′ which does the same job (pushes the literal value 81 onto the stack, setting our speaker bit to 1) but also uses a ‘dup’ (duplicate top of the stack) to shuffle the values around to make a more complex output signal with more frequencies present:

out
out
not
nop
pshl 81
pshi 149
out
nop
out
nop
dup
psh 170
jmp 0

Some further experiments, and perhaps even sound samples soon…

Thursday with Tangible Auditory Interfaces

I spent thursday afternoon in the tangible auditory interfaces studio at the Helsinki Media Lab with Till Bovermann and Erich Berger. Till has a report on our investigations of taking the Betablocker virtual machine into new noisemaking territories.

Here is an example of a betablocker program written without the help of the graphical programming interface, by poking heap memory directly to create a simple sawtooth oscillator:

// begin LFSaw
    u32 threadID = m.add_thread(23);
 
    m.poke(23, ORG);
    m.poke(24, PIP);
    m.poke(25, 6);
    m.poke(26, JMP);
    m.poke(27, 1);
// end

xxxxx-micro-research fluxus workshop

I spent last weekend in Berlin, on Saturday we has a fluxus workshop at pickled feet where I introduced livecoding and fluxus, and then had a quick play with the groworld game prototypes.

On Sunday I tried some audience participation livecoding. I think it went quite well, people were playing al jazari quite happily from the moment I got it set up, so I never really got the chance to explain anything – but it didn’t seem to matter too much. I just joined in with them, first doing some classic fluxus livecoding using the sounds they generated, then accompanying them with scheme bricks and finally al jazari myself, where I messed around with the bpm a bit too much and broke everything (slightly on purpose…)

I’d like to explore this form of audience inclusive performance more, I think it could work better if I was more in an audience role myself and not a separate entity – there is a bit of a performer/audience barrier to overcome.