What is LOVE?

LOVE is the Live Occam Visual Environment, a demonstration of live graphical programming based on occam-pi. (If you're wondering what live programming is, have a look at the splendidly weird TOPLAP web pages.)

More to the point, LOVE is a framework and GUI for connecting up occam-pi processes that perform operations upon MIDI and audio streams; it's a graphical tool for making (simple) music with occam-pi.


The graphical process network editor idea has been done -- and done better -- many times before, but as far as I'm aware LOVE is the first graphical process network editor written almost entirely in occam-pi. Since the editor has minimal coupling to the processes it's manipulating (it just sends them channel ends using predefined protocols), it should be possible to rework it to be able to edit different types of process networks.

LOVE's processes consist of "obvious" occam-pi code -- the id process looks exactly like it does in basic occam courses -- with a simple wrapper to allow them to be replugged at runtime (following Carl Ritson's approach). The process author does not need to worry about repluggability.

LOVE's graphical output is entirely vector-based and resizable; the SDL_gfx library is used to draw graphics primitives onto an SDL surface. Graphical widgets are processes, which communicate with the frontend (exchanging lists of vectors to draw and input events) using channels.

LOVE is research-quality software; expect occasional oddities. If you're interested in using LOVE (or bits of it) for a project, then please let me (Adam Sampson, ats@offog.org) know, so I can clean up and document the code appropriately.

Downloading LOVE

A Linux i386 binary of LOVE, along with the shared libraries it needs, is available from here:


The LOVE source code is available using the Darcs revision control system; once you've installed Darcs, you can type:

darcs get http://offog.org/darcs/love/

to download the latest version. If you don't have Darcs, you can still browse the latest source code by pointing a web browser at http://offog.org/darcs/love/.

To compile LOVE, you will need:

On a Debian or Ubuntu system, you should be able to install the non-KRoC prerequisites by doing:

apt-get install libsdl1.2-dev libsdl-gfx1.2-dev libasound2-dev

Typing make should compile the source and leave you with a love binary.

Using LOVE

When you start LOVE, you'll get a square window with a grid (upon which processes can be placed) and a toolbar. There's an out process on the grid already. To place a new process, left-click on the process you want on the toolbar, then left-click on the grid to place it (or right-click to cancel, if you've decided you don't want that process after all). To move processes around, drag with the left mouse button.

Processes have input ports and output ports, represented by blobs on their left and right sides, which may be connected by wires (which are, to a pretty good approximation, occam-pi channels). Ports and wires come in two varieties: blue ports carry MIDI data (note events), and orange ports carry continuous "analogue" signals. To connect a wire between two ports, left-click on one port, then left-click on the other (or right-click to cancel). While you're connecting a wire, other ports will be coloured green or red depending on whether you're allowed to connect to them or not. To disconnect a wire, hover the mouse pointer over it (it'll be highlighted in yellow) and right-click. You can have as many inputs connected to one output as you like, but you may only have one output connected to each input.

Some processes have graphical elements you can interact with using the keyboard. Number entry boxes (like on const) represent a numeric value; to change it, hover the mouse pointer over the box, type the new number and press return (invalid entries will be ignored). Sliders represent a value between 0 and 1 as a horizontal pink bar on a grey background; to change it, hover the mouse pointer over it and press a number between 0 and 9 (for 0.0 to 0.9) or dash (for 1.0). (Yes, this is silly; I haven't implemented mouse events for widgets yet!)

The following processes are available:


The simplest way to make a noise is to connect a const to a sine, and that to out -- which'll result in a constant (and rather annoying) tone. Play around with the const's value to change the frequency. Connect up a scope too, so you can see the shape of the waveform.


For a more interesting noise, chain several sines together:


If you'd like to hear the difference more clearly, use a mixer to combine the outputs from the different sines together:


You might also like to try multiplying or adding two sine waves together. If you add two sine waves at frequencies A and B, you'll hear both frequencies plus the beat note A-B (try 400 and 401 Hz -- you'll get a 1 Hz pulse). If you multiply two sine waves, you'll get A+B and A-B. It's a bit easier to see why on the scope:


And we can build a servicable police siren by using the output from one oscillator (scaled appropriately) as the frequency input of another:


This isn't really very musical as such, so let's add some MIDI control. Feed a sine from the pitch output of an M->pg, and multiply its output by the gate. You'll now be able to play notes on an MView and hear them come out the output -- and if you add some scopes, you can see what the pitch and gate signals look like (remember the numeric readout is the peak amplitude of the signal).


Now try connecting up a sequencer and getting it to play a loop of notes.

For more ideas, see the big example image at the top of the page.

Future work

While LOVE has already served its initial purpose -- to show that you can deform the semantics of occam channels sufficiently to permit live programming without making the language unusable -- there are still a number of things that I'd like to do to it to make it a more useful piece of software.

LOVE (last edited 2006-09-26 21:57:48 by ats1)