Home           About           Downloads

Synthbench - A Reactable Simulator - Update 3

This is a bug fix release for the Synthbench_2010_12_16 version. The output node no longer auto connects when dragged. Prior to this fix, when the output node was dragged, it instantly tried connecting to itself, resulting in bizarre behaviour. Also, the output node is now labeled appropriately.

Synthbench - A Reactable Simulator - Update 2

This is a bug fix release for the Synthbench_2010_12_14 version. The program should no longer hang regardless of the node network you try to create.

Whenever there is a cycle in the network, Synthbench no longer hangs - the nodes in the cycle merely stop updating.

Synthbench - A Reactable Simulator - Update 1

This program is inspired by the Reactable, and it attempts to simulate it. This is a very limited early version - the project is an excercise in audio programming.

Differences between this version (2010_12_14) and the previous version (2010_12_03):
  • Its possible to add new nodes to the table by dragging them from the palette
  • The nodes auto-connect and disconnect as you drag them. Controller nodes connect to generators and other controllers, while generators only connect to the output node. Also, a node won't auto connect with a node further away from the output node than it is, encouraging radial node layouts. I may change this rule.
  • The nodes are labelled - generators are labelled "g", controllers are labelled "c".
  • The controller nodes modify a parameter away from the base setting, which means that manipulating the sliders will have an effect even if a controller node is connected.

  • Move a node by dragging it with the left mouse button
  • Pan the view by dragging an empty spot with the left mouse button
  • Zoom the view by dragging an empty spot up and down with the right mouse button
 Limitations and known bugs:
  • The output node doesn't do any mixing - it accepts only one input from a generator node
  • In fact, all the nodes accept only one input at the moment, which means the only thing you can make at the moment is a chain.
  • The only parameter a controller will modify is the period
  • The program might hang if you make a complex structure it can't support - only make a chain for now.
Despite these limitations, you can still achieve some interesting effects.

Coming up in the next version(s):
  • Low/high/band pass filters nodes and other effect nodes
  • Sequencer nodes
  • Controller nodes affecting more parameters
  • Improving the look - possibly switching to 3D so effects can be added
  • Make more use of the Lua console

Synthbench - A Reactable simulator

This program is inspired by the Reactable, and it attempts to simulate it. This is a very limited early version - the project is more of a proof of concept which provides an excercise in audio programming. You can still have some fun with it though. The table layout consists of a sinewave generator, with a sinewave controller controlling it. Selecting the sinewave controller (the node on the left) allows you to modify its parameters using the sliders at the top of the window.

The Lua scripting pane is a functional Lua repl that allows you to enter multi-line Lua expressions and programs, although isn't tied to anything in the simulator yet.

A better, actually useful version is coming soon.

Syntax Party 2010

I attended Syntax Party 2010 this year. I've always admired the demoscene from afar, so when I heard there was going to be an event in Melbourne, I had to go and see it. I ended up having the time of my life! The venue was filled with like-minded, friendly, enthusiastic programmers and artists all eager to show their creations, and to query in detail about the creations of others. People from all over Australia arrived to code and party all weekend, and the atmosphere was relaxed and fun. Even though I didn't have a production prepared specifically for the event, I was encouraged to enter some of the programs I had been showing people during the event. They were Mechabach and Ball Game, and they were both well received. I've made some great new friends, including an ANSI artist named Ozzy who created a logo for my new handle, "fugue":

I look forward to next year's Syntax Party event in Sydney!


This program demonstrates a simple procedural composition technique for automatically generating contrapuntal compositions. Sounds completely crazy? Try it.

When you run it, it generates a file called "test.mid", and proceeds to open it with the default midi playing program you have installed. I suggest using MAMPlayer, because of its visualisation of the midi file as it plays it.

What is it doing?

It generates several independent tracks, one note at a time. Notes inside beats 1 and 3 are always notes in the tonic chord, and notes inside beats 2 and 4 are always notes in the dominant 7th chord. Since it always works in C major, the tonic notes are C, E and G, and the dominant notes are G, B, D and F. Also the note that is chosen is either the nearest or 2nd nearest higher or lower note to the previous note that is part of the chord it is assigned to. The choice about whether the note is higher or lower, or is the nearest or 2nd nearest is a random choice. For example, if the previous note is C, and the next note falls inside the 2nd beat of the bar, then it may either choose the D or F above the C, or the B or G below the C. As for the rhythm, there are 3 rhythms, each 1 bar long. These are 4 crotchets, 8 quavers, or a hopping rhythm of 4 repeats of a dotted quaver and a semi-quaver. Every bar, it chooses randomly from these 3 rhythms.

Will it ever end?


Download source code

Assorted bits and pieces


This is a small program which generates a Dominosa problem to solve, then uses my implementation of Knuth's Algorithm X to solve it. The controls are:

Press 'r' to generate a new puzzle
Press 'p' to pause the solution search
Press 's' to single step the solution search
Press 'c' to continue the solution search


This started out as a utility to help explore the huge Eternity2 puzzle, but as usually happens with me, I became sidetracked by pretty objects. The puzzle solving aspect is a minor part of this tool - the major focus of it is in procedurally generating the designs of the tiles, and from a programming point of view getting practice using the OpenGL stencil buffer by using it to produce different designs, and learning how to render to many textures.

To edit a design, pan over to the single tile view (its near the bottom right of the board), and press the spacebar. (To pan, drag with the right mouse button.) Labels will appear underneath some of the sliders, indicating they may be changed to alter the design. This is the area in question:

If you pan to the left, you'll see this design repeated on a grid, to give you an indication of how it looks when tesselated. You can continue editing here as well of course.

If you like, you can still "play" Eternity 2, and attempt to solve the puzzle - when you click on an empty part of the board (the large greyish area), candidate pieces are revealed on the top right, which you can click to place the tile. Tiles highlighted green have already been placed, and will be moved if you click them. I was going to investigate some simple auto placement strategies, but I got bored and moved on before I did this.

Included is a file called e2dataset.txt. This is not the official Eternity 2 tile set - it is a randomly generated tile set which includes border and corner pieces.


A simple implementation of Peg Solitaire. Right click to move a peg. There is some inactive AI code in the project.


A simple render to texture experiment. Not interactive, but the texture is animated, so it may have instructive value.


A simple simulation to play with some of the dynamics of traffic and overtaking behaviours.

Some of the parameters are in the Freeway constructor if you want to play around.


Its an empty world. Its a simple 3D environment complete with scene picking and an intuitive camera behaviour which you can use to render whatever thing you're working with in a 3D space instead of the usual console window.

AudioTest - a precursor to a Reactable simulator


This application is a platform for some basic audio experiments and tests. It features:

  • A Lua REPL which permits the generation and modification of a waveform
  • Mouse modifiable waveform
  • Regeneration of waveform from Lua expression during the sliding of the sliders
  • The effects of modifications to the waveform are heard instantly, because it is being streamed as it is modified

It is my first foray into audio programming. It is a precursor for a "Reactable" simulator, similar to PsychoSynth.

Things to try

When the program starts, a sample expression appears, along with the resulting waveform, and the audio of the waveform should be heard.

Slide the first slider to alter the pitch of the waveform.

Slide the second slider, and notice the waveform and audio change according to the expression in the expression text box.

In the expression text box, enter a Lua expression that sets the variable "result". Variables you can refer to in the expression are:

  • x which is the time variable in the waveform, allowing you make "result" a function of time
  • p2, which is the setting of the second slider (The first slider controls the pitch). To see the value of p2, run print(p2) in the provided Lua REPL.

For example, the expression:

result = 0.2 * math.sin(x * ((2.0 * math.pi) / p2))

produces a sine wave whose frequency is modifiable with the second slider.

There are some more example expressions in audiooutput.cpp.


This project demonstrates the use of scripting languages in a Qt project to enable a 3D "live coding" environment. The scripting languages supported are Lua and Scheme (through s7 Scheme). For a version which uses Common Lisp (through ECL), see QtImagine and QtCSG.

The system calls the functions "update" and "render" in both languages to update and render the frame respectively. These functions can be redefined at runtime at the REPL.

When QtLuaImagine first starts, press "Enter" or click the "Execute" button to load an example Lua source file containing example definitions of update() and render(). Then, load the source file into your favourite text editor, make some changes, then load your freshly edited source file from the REPL by issuing the appropriate load command (dofile("filename.lua") for Lua, or (load "filename.scm") for Scheme) to see the effect of your change instantly. Of course, you can also enter expressions and definitions at the REPL itself. The REPL features a command history.

I hope this provides a starting point for programmers getting into live coding for the first time.