Epimorphism is an art project which simulates video feedback in a mathematically interesting, fractaline, and aesthetically pleasing fashion. It is written in the language PureScript, a dialect of Haskell which compiles to Javascript, and runs in users' web browsers.
Epimorphism is a digital simulation of video feedback. Video feedback is a traditionally analog art form which has existed in the form of kaleidoscopes & other mirror based systems throughout history and then since the 1960s using video technology to create recursive & self similar animated systems. The basic modern concept is simple, and requires only a video input source(camera) and an output source(screen). The output of the camera is routed to the screen and the camera is then pointed at this information, using the output of the camera(with some time delay) as its input. In the simplest example, where the camera is slightly zoomed out, you see an image of the screen as it was a few(n) ms previously. In the inner screen you see an image of the screen as it was 2*n ms ago, and so forth. The situation can get significantly more interesting when you rotate the camera, adjust the zoom, add filters, add external imagery, etc, and quite often the system can become chaotic, which is a common characteristic of recursive systems.
A traditional video feedback system can be mathematically modeled by a transfer function T where
f(t') = T(f(t))
f(t) = the video frame at time t
T = the transfer function of the camera + display combination
f(t', x) = T(f(t), x) = C(f(t, S(x)) + Ext(t, x))
x = the 2d coordinate we are intrested in finding the color value of
C = the color transfer function of the system, usually an artifact of imperfect color reproduction/display
S = the spatial transfer function of the system, such as camera zoom, pan or rotation.
Ext = external information entering the system - the edges of the screen, hands waving, etc
The Epimorphism software project attempts to expand upon these ideas by digitally simulating this process, adding fidelity, precision and breadth of possibility to the system. A virtual framebuffer is maintained and the above equation applied. We can immediately see many ways in which the analog situation can be improved upon & expanded. For the color transfer function, we no longer have to deal with imperfect color reproduction and loss of saturation inherent in cameras & displays. We are free to use this part of the pipeline in an explicitly asthetic capacity as well. We are also no longer constrained to the basic affine transformations supported by a camera such as zoom, pan & rotation. Epimorphism makes extensive use of elementary complex transformations such as those used in computing the Mandelbrot & Julia sets, lending the system a distinctly fractaline appearance. We are also no longer constrained to manually inserting external information into the system. We can now seed the system with arbitrary shapes & textures.
The current iteration of the project is written largely in PureScript, a dialect of Haskell. The project is open source and can be found here. The PureScript component of Epimorphism acts as the front end for a parallel/high performance computing application which runs directly on the clients graphics hardware via pixel shaders & WebGL. The frontend of the application is responsible for the WebGL interface, application UI, pixel shader compilation, state evolution, and maintaining and modulating the pattern library. The backend of the application is responsible for implementing the feedback transfer function above. It is a highly parallel application, where the color value of each pixel is computed in its own thread directly on the graphics hardware. The backend of the application is a highly parameterized system, taking each of the above sub-transfer functions and breaking them down further, creating a very high dimensional parameter space for the system. The default mode of operation of the system is a random walk through the parameter space; numerical parameters, as well as transfer functions themselves are animated and interpolated by the front end of the software. Interactive modes of the software are also available, exposing the parameter space to the user. Previous versions of the software have enabled MIDI, OSC, TCP, and basic audio information to control the system as well, however these features have not been ported to the current version of the application.
A beta version of the software is currently live. An interactive demo is proposed to be given at FARM 2016 which intends to covers the topics mentioned herein and provide a more detailed exploration of the parameter space of the system.
PureScript is a relatively new functional programming language inspired by Haskell which compiles directly to javascript. PureScript borrows heavily from Haskell - it shares a very similar syntax, is strongly statically typed, supports type inference, has immutable data, ADT's, pattern matching, type classes, and so on, with the major high level difference being that in PureScript evaluation is strict. There is a collection of more trivial differences, but the language should be easily picked up by anyone fluent in Haskell.
The project is intended to target as wide of an audience as possible, as easily as possible - in particular anybody with a web-browser which supports WebGL 1.0. The software has been tested on all major web browsers as well as several other platforms, and this breadth of support is possible because of the ubiquity of support for HTML5 applications. PureScript is one of the more powerful, well developed, and easy to use entries in the fairly small space of functional + web. Furthermore, its similarities to Haskell, a language with an immense body of associated technical sophistication and breadth directly increase the power of the language. A large array of sophisticated technologies from the Haskell ecosystem are either directly or easily accessible.
The software has been in development in some form for ~10 years, and is currently in its 3rd major rewrite, with the majority of significant features from the previous applications largely functional. Significant near term plans for the software include audio responsiveness, a more detailed & user accessible creation UI, and implementing machine learning algorithms to more adeptly navigate the phase space of the software, possibly even tailoring the results to users individual tastes. An algorithm to ray trace a generalized version of the software in 3 dimensions using distance fields has also been developed but technology is currently lacking. However back of the envelope calculations suggest that consumer hardware is only about 2 generations away from being able to support this idea :)
f(t', x) = T(f(t), x) = C(f(t, S(x)) + Ext(t, x))
as follows:
A very noticable effect at play here is a result of the fact that our framebuffer is of finite size. In particular, what is stored in memory as the previous frame is considered to represent the square from -1-i -> 1+i in the complex plane. The function S(z) does not always return a value in this region, so we reduce the value to this square via the use of a standard mirrored repeat, which is basically a modular opperation to the given square, but one which preserves continuity. This 'feature' is directly responsible for the kaleidoscopic quality of the system.