Home           About           Downloads

Lua based live coding tools for the Nokia E71


Using Nokia PC Suite, install the following .sis files:

  • qt.sis
  • LiveCode.sis
  • TextEd.sis
  • spectrum.sis

They can be installed in any order.
After installing, its handy to map the hardware buttons mapped so they start LiveCode, TextEd and spectrum to save you from having to traverse the menu every time you want to make a change to your lua code or see the effect of your change.

Running the tools

LiveCode and TextEd together provides a basic and fun live coding environment for Nokia mobile phones. When you run LiveCode, it loads a file called livecode.lua in the Root directory of the phone memory to retrieve the newest definitions of the update and render functions. Running the TextEd program after this will open livecode.lua for editing in a basic text editor, where any lua code may be written and update and render can be redefined. After making your changes and saving, you can return to the running instance of LiveCode, and reload your definitions of update and render by hitting any key on your phone.

I've included a small set of samples to get you started. Place them in the Root directory of the phone memory, rename one of them to livecode.lua then start the LiveCode program to try it out! If you read the samples, you'll see the only callback currently defined is drawLine, which takes 4 numbers to specify the endpoints of the line to be drawn. This function can only be called inside render.

Audio coding with spectrum and lua

I have also provided a version of the spectrum demo with a slight modification - this version allows the waveform to be specified from lua. The spectrum program reloads the file spectrum.lua whenever the mode settings are changed to obtain the newest definition of the calcsample function, which it uses to compute the waveform. If you open TextEd after opening spectrum, TextEd will allow you to edit the spectrum.lua file. Starting the LiveCode program will tell TextEd to go back to editing livecode.lua the next time it starts.

The original version of the spectrum demo comes from the Qt SDK, available from qt.nokia.com

wtf-atabimp - fugue @ Flashback 2011


This demo is built on a framework that allows the entire demo to be driven by lua. The lua files are included, and can be modified freely. There is also a console available from the demo itself, providing a "live coding" environment which permits complete modification of the demo while it is running. There is an unmarked pane splitter at the bottom of the window which can be moved to reveal the console.

This is my first demo, and I wrote it this way to permit the protoyping of different effects easily. In this demo, there are only 3 effects:

  • A 3D braitenberg vehicle simulation, where 200 randomly placed objects self organize into a group of 3D curves
  • An animated heightmap
  • A randomly generated group of polylines with a bunch of triangular guys moving along them.

Synthbench - Flashback update

I presented this version at Flashback 2011. It features:

  • Generator and controller elements that use lua specified waveforms
  • A continuously running tracker where instruments can be assigned to the tracks using "music" effect elements
  • Completely scriptable operation. From the lua console it is possible to construct the table, and manipulate all its controls including the data in the tracker or the waveforms in the lua generators and controllers over time.
  • Update callbacks which are called at 20Hz, and also after each note played by the tracker
  • The delay effect now mixes the input with a delayed version of itself
  • There are also 3 filter effects - band pass, high pass and low pass filters
 I'm in the process of uploading some videos demonstrating the new features. They will appear in this youtube channel.

There are some example scripts which demonstrate how to use the scripting features. You can also refer to the readme file for further documentation.