Already happening now!

Fringe Arts Bath (FaB) is a test-bed for early career-curators, and those who prefer to operate outside of the gallery-based arts scene. FaB aims to raise the profile of contemporary visual arts in Bath and beyond, providing opportunities for early-career and emerging artists.

...

Co.Lab Sound is an experimental testbed for artists to develop new work and collaborate live. Informed by a long line of experimental music, sound art and performance, these events embrace the processes of improvisation and experimentation to showcase artists expanding the field of sound art and what it means to experience art live.

...

I have 3 works in the online exhibition (Dynamo, disco/designer and Puzzle), and my live slot is scheduled for this Wednesday evening (assuming I can resolve the issues with Zoom...).

]]>My generative techno patch Dynamo is being exhibited at Galerije VN, Zagreb, Croatia, 12 November to 7 December 2019, as part of the group show free_art_-_source/2019 organized by Format C. Opening hours Mon-Fri 8-20:00, Sat 8-14:00.

On Saturday 23rd November, also in Zagreb, I'll be leading a free workshop on live-coding audio in the C programming language using Clive. Note that clive does not work on Windows or Mac.

clive is a C audio live-coding skeleton. It allows you to hot-swap DSP processing callbacks, providing not much more than automatic C code recompilation, object code reloading, and state preservation.

The workshop will work on dependencies installation, basics of sysadmining and git, CLI, define DSP and examples similar to clive, sound synthesis and feedback, shaping sounds and a live performance preparation.

The workshop is conducted in English language.

To participate, you need to bring your own (GNU/Linux OS) laptop, and (optional) headphones.

Applications (open until Nov 20th 23:59CET):`hello at formatc.hr`

A bit nervous, but have been preparing intensively so it should be fine.

]]>Pau Ros took some great pictures of my exhibition opening, part of Sonic Electronics Festival:

The exhibition is open until 27th April. Check the Chalton Gallery website for spacetime coordinates.

]]>I have an exhibition coming up April 2019 in London, UK.

Claude Heiland-Allen

Digital Art - Computer Graphics - Free/Libre Open Source Software

Chalton Gallery, 96 Chalton Street, Camden, London UK NW1 1HJ

Opening Thursday 11 April 2019, 6pm.

Concert Thursday 18 April 2019, 7pm.

Exhibition opens 12-27 April 2019.

Tuesdays: 8 am to 3 pm

Wednesday to Saturday: 11:30 am to 5:45 pm

*Digital print 120x60cm, framed*

Prismatic is rendered using a physics-based ray-tracer for spherically curved space. In spherical space the light ray geodesics eventually wrap around, meeting at the opposite pole to the observer. To compound the sphericity a projection is used that wraps the whole sphere-of-view from a point into a long strip.

The scene contains spheres of three different transparent materials (water, glass, quartz) symmetrically arranged at the vertices of a 24-cell. The equatorial plane is filled with a glowing opaque checkerboard, this acts as a light source with a daylight spectrum.

The 3D spherical space is embedded in 4D Euclidean (flat) space. Represent ray directions by points on the “equator” around the ray source, and use trigonometry to transform these ray directions appropriately when tracing the rays through curved space. The code is optimized to use simpler functions like square root and arithmetic instead of costly sines and cosines.

The materials are all physically based, with refractive index varying with simulated light wavelength, which gives rainbow effects when different colours are refracted by different angles. To get the final image requires tracing a monochrome image at many different wavelengths, which are then combined into the XYZ colour space using tristimulus response curves for the light receptors in the human eye.

*Digital prints 20x30cm, 16 pieces, unframed*

The concept for Wedged is “playing Tetris optimally badly”. Badly in that no row is complete, and optimally in that each row has at most one empty cell, and the rectangle is filled. Additional aesthetic constraints are encoded in the source code to generate more pleasing images.

Starting from an empty rectangle, block off one cell in each row, subject to the constraint that blocked cells in nearby rows shouldn’t be too close to each other, and the blocked cells should be roughly evenly distributed between columns. Some of these blockings might be duplicates (taking into account mirroring and rotation), so pick only one from each equivalence class.

Starting from the top left empty cell in each of these boards, fill it with pieces that fit. Fitting means that the piece is entirely within the board, not overlapping any blocked cells or other pieces. There are some additional constraints to improve aesthetic appearance and reduce the number of output images: there should not be too many pieces of the same colour in the board, all adjacent pieces should be a different colour, and no piece should be able to slide into the space left when blocked cells are removed (this applies only to the long thin blue pieces, the other pieces can’t move due to the earlier constraint on nearby blocked cells).

The filling process has some other aesthetic constraints: the board must be diverse (there must be a wide range of distinct colours in each row and column), the complete board must have a roughly even number of pieces of each colour, and there shouldn’t be any long straight line boundaries between multiple pieces. The complete boards might have duplicates under symmetries (in the case that the original blocking arrangement was symmetrical), so pick only one from each equivalence class.

*Sound installation*

Generative techno. Dynamo creates music from carefully controlled randomness, using numbers to invent harmonies, melodies, and rhythms. Dynamo is a Pure-data patch which plays new techno tracks forever. It is a generative system, and not a DJ mix.

When it is time to generate a new track, Dynamo first picks some high level parameters like tempo, density, and the scale of notes to use. Then it fills in the details, such as the specific rhythms of each instrument and which notes to play in which order. Finally an overall sequence is applied to form the large scale musical structure.

Pure-data is deterministic, which makes Dynamo deterministic. To avoid the same output each time the patch is started, entropy is injected from outside the Pure-data environment.

*Audio-visual installation*

Sliding tile puzzles have existed for over a century. The 15-puzzle craze in 1880 offered a cash prize for a problem with no solution. In the Puzzle presented here the computer is manipulating the tiles. No malicious design, but insufficient specification means that no solution can be found; the automaton forever explores the state space but finds every way to position the tiles as good as the last…

Each tile makes a sound, and each possible position has a processing effect associated with it. Part of the Puzzle is to watch and listen carefully, to see and hear and try to pick apart what it is that the computer is doing, to reverse-engineer the machinery inside from its outward appearance. The video is built using eight squares, each coloured tile is textured with the whole Puzzle, descending into an infinite fractal cascade. The control algorithm is a Markov Chain that avoids repetition.

Puzzle is implemented in Pure-data, using GEM for video and pdlua for the tile-control logic.

*Interactive installation*

A graph is a set of nodes and links between them. In GraphGrow the term is overloaded: there are visible graphs of nodes and links on the tablet computer, and a second implicit graph with links between the rules.

The visible graphs give the name of GraphGrow - a fractal is grown from a seed graph by replacing each visible link with its corresponding rule graph, recursively. The correspondence is by colour: a yellow link corresponds to the graph with yellow background, and so on. The implicit graph between rules thus *directs* the expansion. The implict graph is also a *directed graph* (even more terminological overloading!).

The rule graphs are constrained, with two fixed nodes at left and right. When growing a graph, each link is replaced with the corresponding rule graph with the left-hand fixed node of the rule mapped to the start point of the link and the right-hand fixed node of the rule mapped to the end point of the link. The mapping is restricted to uniform scaling, rotation and translation. The fixed nodes are coloured white on the tablet.

The fractal is projected, along with rhythmic drones amplified through speakers. Both are generated from the graph data. Dragging the brightly coloured nodes on the tablet in each of the four rule graphs, allows the gallery visitor to explore a subspace of graph-directed iterated function system of similarities.

*Video installation*

Fractals are mathematical objects exhibiting detail at all scales. Escape-time fractals are plotted by iterating recurrence relations parameterised by pixel coordinates from a seed value until the values exceed an escape radius or until an arbitrary limit on iteration count is reached (this is to ensure termination, as some pixels may not escape at all). The colour of each pixel is determined by the distance of the point from the fractal structure: pixels near the fractal are coloured black and pixels far from the fractal are coloured white, or the reverse.

Escape-time fractals are generated by formulas, for example the Mandelbrot set emerges from *z* → *z*^{2} + *c* and the Burning Ship emerges from *x* + *i**y* → (|*x*| + *i*|*y*|)^{2} + *c*, where *c* is the coordinates of each pixel. Hybrid fractals combine different formulas into one more complicated formula: for example one might perform one iteration of the Mandelbrot set formula, then one iteration of the Burning Ship formula, then two more iterations of the Mandelbrot set formula, repeating this sequence in a loop.

Claude Heiland-Allen is an artist from London interested in the complex emergent behaviour of simple systems, unusual geometries, and mathematical aesthetics.

From 2005 through 2011 Claude was a member of the GOTO10 collective, whose mission was to promote Free/Libre Open Source Software in Art. GOTO10 projects included the make art Festival (Poitiers, France), the Puredyne GNU/Linux distribution, and the GOSUB10 netlabel. Since 2011 he has continued as an unaffiliated independent artist and researcher.

Claude has performed, exhibited and presented internationally, including in the United Kingdom (London, Cambridge, Winchester, Lancaster, Oxford, Sheffield), the Netherlands (Leiden, Amsterdam), Austria (Linz, Graz), Germany (Cologne, Berlin), France (Toulouse, Poitiers, Paris), Spain (Gijon), Norway (Bergen), Slovenia (Maribor), Finland (Helsinki), and Canada (Montreal).

Claude’s larger artistic projects include RDEX (an exploration of digitally simulated reaction diffusion chemistry) and clive (a minimal environment for live-coding audio in the C programming language). As a software developer, Claude has developed several programs and libraries used by the wider free software community, including pdlua (extending the Puredata multimedia environment with the Lua programming language), buildtorrent (a program to create .torrent files), and hp2pretty (a program to graph Haskell heap profiling output).

]]>I modified Pure-data and libpd just enough to compile it with Emscripten. See microsite here:

mathr.co.uk/empd

Not user friendly yet, maybe someone else will contribute that stuff...

]]>If you're near Split, Croatia this August you can check out the Sounding DIY exhbition, which features an updated version of my 2008 work Puzzle:

Sounding DIY

Tin Dožić, Claude Heiland-Allen, Noise Orchestra, Bioni Samp, Hrvoje Hiršl / Davor Branimir Vincze

Aug 6th 2018. - Aug 22nd 2018.

Curator/s: Darko Fritz, Laura Netz

Supported by: Ministarstvo kulture RH, Zaklada Kultura nova

MKC, Ulica slobode 28, Split

opening and live acts 6th August at 21 h

live acts by Hrvoje Hiršl / Davor Branimir Vincze and Tin Dožić.

Monday-Saturday 10-13 h, 17-21 h

free entrance

I didn't manage to get it running properly on an RPi, otherwise I could have sent just an SD card filesystem image, so it'll be running on my old 2006-era laptop, which I hope will survive the travel (both ways).

]]>(Graph labels are missing "~", couldn't figure out how to display "~" with GNUPlot...)

Pure-data's [expr~] is convenient for writing arithmetic expressions involving signal vectors, but unfortunately it has quite an overhead - it's much slower than patching objects together, [fexpr~] even more so.

This is because [expr~] interprets the parsed expression each DSP block, and because its inner loops don't have the unrolling tricks of Pd's signal arithmetic objects (search the source code for perf8 or perform8 or similar to see what I mean by that).

One way of solving it I thought could be for [expr~] to dsp_add() the corresponding inner loop perform functions at DSP chain recompilation time (ie, not very often). But that would require allocating signal vectors separately, as there is no way as far as I know to grab spare signal vectors from Pd's free pool (without having inlets or outlets to own them, that is). This would be a lot of work to get right.

An alternative (and the one I favour this moment) might be for [expr~] to create a new canvas behind the scenes and patch together the primitive objects making up the expressions. The more I think about it the more it solves problems: no need to duplicate the inner loops in multiple classes, no need to allocate (and deallocate) signal vectors, Pd can do its cache-locality beneficial signal vector recycling, the DSP chain compiler for patches does the topological sort so we don't have to, ...

Not sure how much it would benefit [fexpr~], but it wouldn't be too hard(?) to add support using [block~ 1] and [delwrite~]/[delread~] for the feedback signals. And I think [expr] could stay as it is, not so likely to be much of a hot code path.

A stepping stone to [expr~] dynamic patching might be to write an offline processor, that replaces instances of [expr~] in patch files by subpatches.

Does anyone feel up to the challenge? I'm not doing so much any more with Pd these days, so I'll pass.

You can download the C and Pd source code for running the benchmarks: thoughts_on_expr.tar.bz2

]]>Back in 2008 I made a patch with Pure-data, Gem, and PdLua that took the form of a sliding tile puzzle with generative ambient drones. You can see a video in my 2009 blog post. In 2013 I updated it with extra features (tiles that spin and flip over occasionally, plus black borders, and sound based on rhythms) but never published the changes. I recently got given a Raspberry Pi 3 B, and thought this would be a nice project to test out its graphics capabilities.

I installed the Raspbian Jessie full image on a 32GB SD card, and installed a few additions. Installing mesa-utils and running glxgears was very disappointing - 40fps with a tiny window and very high CPU load, with glxinfo reporting OpenGL 3.0 via Gallium llvmpipe. Some searching of the internet later I found the hint to sudo raspi-config and enable the experimental OpenGL driver in the advanced settings. Then glxgears ran at 60fps with no load, and glxinfo reported OpenGL 2.1 via Broadcom.

I uncommented the deb-src line in /etc/apt/sources.list so I could run

sudo apt-get update sudo apt-get build-dep puredata sudo apt-get build-dep gem sudo apt-get install liblua5.2-dev subversion

Then I got Pd source from git, Gem source from git, and pdlua source from svn (note: I got the whole trunk repository as the build system there is not self-contained):

mkdir ~/opt/src cd ~/opt/src git clone git://git.code.sf.net/p/pure-data/pure-data pure-data-git git clone git://git.code.sf.net/p/pd-gem/gem gem-git svn checkout svn://svn.code.sf.net/p/pure-data/svn/trunk pure-data-svn

I applied a small patch to force generating mipmaps in Gem's pix_snap2tex (hopefully in the future this patch won't be necessary) and compiled everything like this:

export CFLAGS="-g -O3 -mfloat-abi=hard -mfpu=neon" export CXXFLAGS="${CFLAGS}" cd pure-data-git ./autogen.sh ./configure --prefix=${HOME}/opt --enable-jack make -j 4 make install cd .. cd pure-data-svn/externals/loaders/pdlua make prefix=${HOME}/opt objectsdir=${HOME}/opt/lib/pd/extra \ pkglibdir=${HOME}/opt/lib/pd/extra \ CFLAGS="${CFLAGS} -Wall -W -g -I/usr/include/lua5.2" \ ALL_LIBS="-llua5.2 -lc" make prefix=${HOME}/opt objectsdir=${HOME}/opt/lib/pd/extra \ pkglibdir=${HOME}/opt/lib/pd/extra \ CFLAGS="${CFLAGS} -Wall -W -g -I/usr/include/lua5.2" \ ALL_LIBS="-llua5.2 -lc" install cd ../../../.. cd gem-git ./autogen.sh ./configure --prefix=${HOME}/opt make -j 4 make install cd ..

Building Gem especially takes a while (37mins on the quad core Pi). Finally I tried running the Puzzle:

qjackctl & # configure and start JACK git clone https://code.mathr.co.uk/puzzle.git cd puzzle ./start-simple.sh

It works very comfortably at 512x512 window size, but (WARNING) I did try it at 1024x1024 and after a minute or so of struggling to keep up it eventually locked up my Pi hard and I had to cut the power. Luckily on next boot it seems everything is fine (no data loss). Here's a grab of the smaller size:

Fun!

]]>One representation of a biquad filter's transfer function is:

\[ H(z) = \frac{ b_0 + b_1 z^{-1} + b_2 z^{-2} } { a_0 + a_1 z^{-1} + a_2 z^{-2} } \]

Without loss of generality, it can be assumed that \(a_0 = 1\) (otherwise divide both top and bottom by the original \(a_0\) to give a new set of coefficients).

Another representation of the transfer function is:

\[ H(z) = g \frac{ (z - Z) (z - Z^*) } { (z - P) (z - P^*) } \]

where \({}^*\) denotes complex conjugation. Here \(Z\) is a zero and \(P\) is a pole, and both are complex, and \(g\) is gain factor, which is real. It will make things easier to assume \(g = 1\), if it isn't then just multiply the input \(x\) by \(g\) before-hand. Multiplying out the top and bottom, and dividing both by \(z^2\), recovers the first representation:

\[ H(z) = \frac{ 1 - 2 \operatorname{Re}{(Z)} z^{-1} + |Z|^2 z^{-2} } { 1 - 2 \operatorname{Re}{(P)} z^{-1} + |P|^2 z^{-2} } \]

Or more explicitly:

\[ \begin{aligned} a_0 &= 1 & a_1 &= -2 \operatorname{Re}{(P)} & a_2 &= |P|^2 \\ b_0 &= 1 & b_1 &= -2 \operatorname{Re}{(Z)} & b_2 &= |Z|^2 \end{aligned} \]

The utility of the second **pole-zero** representation is in filter
design, the former is useful in filter implementation. The **direct form 2**
implementation is a pair of recurrence relations, where \(x\) is the input,
\(y\) is the output, and \(w\) is only used internally:

\[ \begin{aligned} w_n &= \phantom{a_0} x_n - a_1 w_{n-1} - a_2 w_{n-2} \\ y_n &= b_0 w_n + b_1 w_{n-1} + b_2 w_{n-2} \end{aligned} \]

The software Pure-data implements its **biquad~** object
using direct form 2, except with \(a_1\) and \(a_2\) negated. So an
instantiation **biquad~ A B C D E** has the correspondence:

\[ \begin{aligned} A &= -a_1 & B &= -a_2 & C &= b_0 & D &= b_1 & E &= b_2 \end{aligned} \]

The final puzzle is the factorization from direct form 2 into pole-zero representation. Assuming \(a_0 = 1 = b_0\) (otherwise factor out the gain coefficient and normalize), we get:

\[ \begin{aligned} \operatorname{Re}{(Z)} &= -\frac{1}{2} b_1 & \operatorname{Im}{(Z)} &= \sqrt{ b_2 - \frac{1}{4} b_1^2 } \\ \operatorname{Re}{(P)} &= -\frac{1}{2} a_1 & \operatorname{Im}{(P)} &= \sqrt{ a_2 - \frac{1}{4} a_1^2 } \end{aligned} \]

The motivation for this post was
mkfilter
giving code output which is inherently unstable for higher order filters,
reducing it to smaller stages (like biquads) in serial is much less likely
to blow up. I did some experiments converting the pole-zero output from
mkfilter into Pd patches using **cpole~** and **czero~**,
but biquads are more efficient as the input and ouput are both real (a biquad
needs 5 real multiplications and 4 real additions, whereas a single complex
multiplication needs 4 real multiplications and 2 real additions).
The next step is to write a program into which I can pipe mkfilter output,
and get out a Pd patch using some chained biquads.

In the process I fixed some minor issues in the mkfilter source code (retrieved 2015-03-26) and wrote a new build system to get it to compile in the modern age.

]]>One of the fun parts of using Pure-data is being able to draw arbitrary waveforms and use them for oscillators. Unfortunately the naive approach using [tabread4~] suffers badly from aliasing - if you define your table with 1027 points (a power of two plus 3 guard points for polynomial interpolation), using it for an oscillator at frequencies above around 45Hz (depending on sample rate) will cause aliasing of high frequencies in the table (playing a table faster than 1 table sample per output sample will start aliasing, playing slower is fine). Halving the table size doubles this aliasing frequency, but loses the high frequency content from the table.

I do some graphics, and learned that mipmapping is a very important part of OpenGL texturing if you don't want it to look really bad (with lots of aliasing artifacts like Moiré patterns). So I thought about applying the same technique to audio. Mipmapping works by using the spatial derivative of the index into the texture to choose which resolution to use - when the index is changing rapidly, the derivative is large and a low resolution should be chosen, when the index is changing slowly the derivative is small and a high resolution should be chosen.

My implementation requires only Pd vanilla (built-in core objects) and is available at maximus/pd-bl on Gitorious bandlimited on code.mathr.co.uk, under the same BSD-style license as Pd itself.

Usage is quite simple: create a [table] for your source waveform, create a [bl-table] for the bandlimited wavetable, turn on dsp and send a message to a [bl-gen~] to generate the content in the [bl-table] by copying from the source [table] and repeatedly filtering and downsampling. Then you can use the [bl-table] as an oscillator waveform with [phasor~] and [bl-tabread4~].

Here are some images of a waveform repeatedly filtered and down-sampled by [bl-gen~] (I hacked a patch together to save all the tables inside the [bl-table] to text files, then rendered them with some Haskell code):

And here's what the two methods sound like (you might want to reduce volume before playing as they are quite loud):

- aliased (using [tabread4~])
- FLAC, Ogg Vorbis
- bandlimited (using [bl-tabread4~])
- FLAC, Ogg Vorbis

You can also download the Haskell source code used to create the gallery images in this post, using the Diagrams library.

Future work might research into extending the technique to wave-shaping distortion, or other domains I haven't thought of yet.

]]>Welcome!

]]>I started pdlua in 2007, but in the last few years it dropped down my priorities with little new developments. Martin Peach has picked up the ball and is continuing the project in the pure-data externals SVN repository:

svn repository browser at sourceforge

svn co http://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/externals/loaders/pdlua/

Bug reports and patches are best sent to the Pure-data development mailing list.

The pdlua project on Gitorious is now deprecated.

]]>