Previous slide
Next slide

The Art of Mathematics

Vicarage Studio's poignant homage to Messiaen's Quartet for the End of Time is built from the same numerical rules as its inspiration.

By Steve Jarratt

In 1940, the French composer Olivier Messiaen was captured by German forces and imprisoned in Stalag VIII-A in the east German town of Görlitz. While in captivity, he met with a cellist, a violinist and a clarinettist, for whom he wrote his Quatuor pour la fin du temps, or Quartet for the End of Time. The four of them performed the piece to an audience of some 400 prisoners on a cold and rainy evening on January 15th, 1941.

To celebrate its 75th anniversary, Sinfini Music commissioned freelance animation director Simon Russell of Vicarage Studio to produce a video for the piece. The final 3m 46s animation is accompanied by The Crystal Liturgy, one of the eight movements in Quartet for the End of Time.

The stunning animation features a single camera move, rendered in one unbroken take, as the viewer is drawn through the mechanical contraptions and polygonal life forms inhabiting an island floating in a monochromatic void. But amid the seeming chaos, the form and movement is all driven by the same numerical laws that Messiaen employed to conceive his music.

"It's based on a talk by mathematician Marcus du Sautoy,"' explains Russell. "He talked about how Messiaen used mathematics in his music. It's really about the mathematics of nature and how that brings beauty."'

Russell suggests that the challenge was in "trying to understand then translate some quite complex mathematical ideas into animation and then form them into a very watchable, interesting format. Once the concept was done it was a matter of dealing with a polygon-heavy scene and making it feel light and synchronised to the music."'

The sequence begins with the camera dollying back through a forest of trees and bushes, many of which are generated using the Lindenmayer system or L-System, which employs a set of instructions to describe the growth behavior of plants and trees.

"You tell it to 'Go forward two, turn right one',"' says Russell, "and you can also have branching instructions as well. So you can have it like: 'Go forward two steps, and then branch one left and one right.' Then you can say, 'Repeat that'. Or you can do a replacement; you can say, 'Every time I go forward, do the same structure again,' so it branches within itself."'

The end result is a complex system that replicates the fractal forms in nature, and in Cinema 4D is built into the MoSpline object's Turtle mode. Having created the spline, it's then a case of using a Sweep object to give it solidity. The system can also insert Clone groups into the structure, which was used to generate the various forms and rotating shapes at the tips of the branches. But while Cinema's L-System was useful, Russell found that he needed more sophistication, which is when he turned to Houdini.

Cinema 4D has offered integration with Side Effects Software's app since R16, enabling you to build assets in Houdini Engine and then load them into Cinema. "The setup was straightforward,"' says Russell. "I created a fairly simple L-System node tree in Houdini then wrapped it up as an asset with options to allow me to clone elements onto the system in Cinema."'

As the camera moves on we see more geodesic shapes that resemble the growth pattern of sunflower seeds or Romanesco broccoli, both of which follow a spiral based on the Fibonacci series of numbers. To build these, Russell employed the Golden Ratio: "If you put a seed or a point at a certain number of degrees [it's 137.5° – the 'Golden Angle'] and repeat that enough times and keep pushing the pattern out, you start to get these Fibonacci spirals or these really organic structures."' He tried various methods to achieve these shapes, including particles and cloners, but mainly used an XPresso setup to draw a spline and then clone onto it or sweep or extrude it.

"MoGraph allowed me to go so far,"' admits Russell, "but when it came to really heavy geometry I built a Houdini asset that allowed me to create even more complex structures. The system took a base piece of geometry – a cube, tetrahedron etc. – and then 'cloned' these shapes onto its own surfaces. Each generation cloned more of the same shapes but smaller in scale. So it created a kind of fractal crystal growing asset. In Cinema 4D you could simply swap in your base piece of geometry and set the number of generations it should grow by. It was interesting to see how the overall shape changed by simply changing the base geometry. Once I was happy with the crystal shape I then baked it out and put it in a Fracture object to animate it."'

The overall poly count of the scene (which tops out at around four million) was kept under control by baking each model out to an Alembic file. "With the crystals and the crystal animation, I would have a really, really heavy MoGraph setup, but just in another document,"' explains Russell. "You export that as an Alembic file, render it to disk, and then just pull it back in. You can have a huge amount of geometry. It's the equivalent of doing an edit with loads of really good HD footage, that's all on your drive."'

As the reveal continues, we see a geometrically patterned landscape, based on the mathematics of tiled structures. Wikipedia provided a rich source of SVG (Scalable Vector Graphics) files that Russell plundered, and then imported using the free CV-ArtSmart plugin from Cineversity. He then deformed the extruded tiles using the sculpting tools to create the curved overhangs at the edge of the landscape.

A key element of the sequence is the mathematical machine with two rotating cogwheels that appear around the 1:25 mark. The upper wheel has 29 teeth, while the lower one has 17, representing the piano, which plays a 29-note sequence on a 17-note rhythm. "Because they're prime numbers, they don't really ever intersect. So that kind of creates a sense of timelessness, which is what the composer wanted."'

Russell describes how he went through the music, keyframing the piano chords and then using those keys to drive the various objects and mechanisms via XPresso. "It's all based off one hand-keyframed element,"' he says, "which drives the machine in the middle. Each time it moves on one of the setups, it changes a random seed of something. So the cloner expresses in a different way each time; sometimes it's used as a trigger, sometimes it drives it directly, sometimes it's used as a position or whatever. There's a number of fun and fiddly little setups which just push everything."'

The sudden release of a swarm of cicadas – achieved via X-Particles – references the fact that this use of prime numbers also appears in nature. The North American periodical cicada only appears in its adult form after either 13 or 17 years, living 99% of their lives as juveniles underground. They emerge en masse on a specific day in vast numbers, mate, lay their eggs and then die a few weeks later. Its been suggested that the timing of this appearance – both 13 and 17 are prime numbers – is to prevent synchronisation with any predatory species.

The camera continues its languid journey, revealing a pair of watchtowers and a large wall – referencing the POW camp in which the composer was confined. Again, both structures have their bases in mathematics. The tower structure is defined using the Mongean Shuffle – which Messiaen used to arrange notes in Ile de Feu II – in which you take a card from the top, one from the bottom, one from the top, one from the bottom… and so on. Russell used this shuffling pattern for the intertwining lattice of the tower. The wall, which appears to be made up of randomly shaded blocks, is actually based on the number of different rhythms you can make from eight beats (which is 34) repeated around its perimeter. Indian musicians studied the number of rhythms you can make from sets of beats and as the size goes up, the result is always a Fibonacci number. Indeed, the sequence was suggested by Indian scholar Acharya Hemachandra in 1150, some 50 years before Fibonacci presented his work in the mathematical treatise, Liber Abaci.

Eventually the full scale of the floating island is revealed, and again, while it may just appear like a large geometric mass, its origins lie within the music. "I used Houdini's audio analysis nodes in CHOPs [Houdini's Channel Operators] to create the inverted mountain shape the island sits on. The mountain is actually a visual representation of the various frequencies of the piece of music baked out as geometry."'

As the island fades into the distance, the amazing thing about the animation is that it's all done in a single take, with just a handful of passes composited in Adobe After Effects. But despite its seeming complexity, Russell says it was quick to render, taking just eight to ten seconds per frame on his latest model 12-core Mac Pro. "It was fairly quick to render because there's really just one light, so there's no reflections going on, there's no subdivided polygons. It's quite a graphic, illustrational piece."'

The whole scene also features very simple materials, with around six shades of grey – just to differentiate the items on screen – and a degree of luminance. The final greyscale image was then tone mapped in Adobe After Effects using the built-in Colorama filter.

A separate cel-shading pass was rendered and composited over the tone-mapped image. However, because of the size of the elements, Russell needed to limit the effect: "Obviously you've got tons of polygons in the background, and the cel-shader will do a one-pixel line on everything so it gets really heavy. So I used a depth pass to show the cel effect closer to the camera. Then as you go further back, it loses that quality, so you can only see the cel shader on things which are closer to you."'

Incredibly, all the design, modelling, animation and rendering took Russell just two months to accomplish, a feat he modestly puts down to being organised and working in a structured way. "You build it as a very light wireframe and just keep everything very simple,"' he says. "Just keeping organised. So everything in layers so you can turn stuff on and off easily; just being very disciplined in that sense."' He also suggests that the sequence is simpler than it looks: "The complexity is in the synchronisation and the modelling and the ideas. I think because of the kind of thing it is, it looks more complex than it is."'

In terms of Cinema 4D, Russell cites the combination of MoGraph and XPresso as its major strength, enabling him to get up and running quickly. "Cinema 4D was great in the fact that it allowed me to quickly realise complex ideas. You can just throw stuff together and play with complex systems. Just the ability to go from sketch to idea very quickly."'

Steve Jarratt is a long-time CG enthusiast and technology journalist based in the UK.

All images courtesy of Vicarage Studio.

Vicarage Studio Website:

Previous slide
Next slide