N.Léveillé (b. 1977, France) programs real-time audiovisual and business software, manages projects, coaches programmers, plays and composes electronic music, and occasionally writes about his experiences.


nicolas @ uucidl

Upcoming event: Lazy Sunday Video (7010-04-25)

April 24, 2010 by nicolas, tagged live visuals, music and tpolm

This sunday 25/04 I’ll be doing the visuals for the first Lazy Sunday Video in 3 years.

You are all invited to listen to the mixes, which will last a great deal of the day. Some quite exceptional live music and visuals is to be played there.

Visually, there’ll be everything from analog synths to live coding to demo-style visuals and live photoshop.

Line up, details and streams at:


Audio/Video streaming will be done courtesy of http://ustream.tv


motivation-hacking (activity tracking)

February 14, 2010 by nicolas, tagged motivation and activity, filed under projects

An experiment in motivation-hacking

In the spirit of:

http://lifehacker.com/281626/jerry-sein … ity-secret

One night I was in the club where Seinfeld was working, and before he went on stage, I saw my chance. I had to ask Seinfeld if he had any tips for a young comic. (…)

He said the way to be a better comic was to create better jokes and the way to create better jokes was to write every day. (…)

He told me to get a big wall calendar that has a whole year on one page and hang it on a prominent wall. The next step was to get a big red magic marker.

He said for each day that I do my task of writing, I get to put a big red X over that day. "After a few days you’ll have a chain. Just keep at it and the chain will grow longer every day. You’ll like seeing that chain, especially when you get a few weeks under your belt. Your only job next is to not break the chain."

"Don’t break the chain," he said again for emphasis.

And so this daily tracking page was born. It shows the overall activity of our code trees. Each day a commit has been performed, the day will be darkened. As the number of updated files grows, so does the darkness of each square.

Do something every day and you will progress. Do it for a long time and you will become an expert.

Sean Barret's Judy vs Hashtable Performance Comparison

October 4, 2009 by nicolas, tagged programming


$ git clone http://uucidl.com/git/hashperf.git

Requirements: GNU Make; cc; gnuplot.


A couple of years ago, I stumbled upon the programming works of Sean Barrett. Both he and Molly Rocket partner Casey Muratori exhibit a refreshingly pragmatic approach to programming, a will to fight the useless complexity that too often plagues our field. Checking out their forums is also well recommended¹.

You might have read before about Judy, an associative array implementation by Doug Baskins, with peculiar performance claims.

Sean Barrett submitted Judy to his inquisitive eye, and produced an enlightening article "A Performance Comparison of Judy to Hash Tables"

A very interesting aspect of the comparison is that performance alone is not the sole focus: the article contrasts the Judy’s 200k lines of code with the 200 lines of code of a simple hash table implementation.

¹ As well as checking out Sean Barrett’s excellent pure C libraries: stb_truetype, stb_image, stb_vorbis and stb.

So what about it?

Well I just took a couple of hours to convert Sean Barrett’s original windows based test suite to POSIX platforms.

Just do:

$ git clone http://uucidl.com/git/hashperf.git

A Makefile (for GNU Make) to build the program, launch the (lengthy) tests and create the graphs, that’s about it.

To reproduce Sean Barrett’s results, just type:

$ make tests
$ make plot

Adding new implementations to the tests

You can easily add new implementations to the test suite by opening aatest.c:

Add your datastructure’s API to the top of the file:

// add your new datastructure code here

void *stlhashCreate(int size);
void stlhashFree(void* hash);
uint32 *stlhashFind(void *hash, uint32 key);
uint32 *stlhashInsert(void *hash, uint32 key);
int stlhashDelete(void *hash, uint32 key);
int stlhashCount(void *hash);


void reset(void)
    if (stlhash != NULL)
    stlhash = stlhashCreate(1);

Describe (AArray) the new hashtable to the test suite:

AArray stlhash_desc = { "stlhash", stlInsert, stlDelete, stlGet, stlCount, stlMem };

Add it to the command line:

int main(int argc, char **argv)
    if (!stricmp("judy", argv[i])) a = &judy_desc;
    else if (!stricmp("hash", argv[i])) a = &hash_desc;
    else if (!stricmp("bhash", argv[i])) a = &bhash_desc;
    else if (!stricmp("stlhash", argv[i])) a = &stlhash_desc;

You also have to produce the datasets in the Makefile

First add a new testing function, and add it to "both". Don’t forget to change both the parameter and the name of the output file.

## testing functions

stlhash=./$(TEST) stlhash $(1) $(2) $(3) $(4) $(5) $(6) $(7) $(8) $(9) > $(OUTPUT)/stlhash$(1)$(2)$(3)$(4)$(5)$(6)$(7)$(8)$(9).txt
bhash=./$(TEST) bhash $(1) $(2) $(3) $(4) $(5) $(6) $(7) $(8) $(9) > $(OUTPUT)/bhash$(1)$(2)$(3)$(4)$(5)$(6)$(7)$(8)$(9).txt
    $(call judy,$(1),$(2),$(3),$(4),$(5),$(6),$(7),$(8),$(9)) ; \
    $(call hash,$(1),$(2),$(3),$(4),$(5),$(6),$(7),$(8),$(9)) ; \
    $(call stlhash,$(1),$(2),$(3),$(4),$(5),$(6),$(7),$(8),$(9)) ; \
    $(call bhash,$(1),$(2),$(3),$(4),$(5),$(6),$(7),$(8),$(9))

Plotting the results: then you have to also manually add the new datastructure to the plotting scripts: buildraw.gp, proberaw.gp

Openframeworks: C++ for artists

August 29, 2009 by nicolas, tagged programming and art_and_code, filed under commentary

Three enthusiastic iconoclasts talk about Openframeworks, or OF.

OF is a software development package with ready-made tools to write interactive, audio-visual programs in the C++ language.

Why C++? The enduring success of this industrial language has provided a great deal of much desired libraries to it. Its success as a system language has also ensured a good baseline performance. The OF project was started to let more people take profit of this situation.

Installations and standalone programs are written in parallel with OF. In its current pre-release state, getting feedback from projects helps defining its core and improving it.

As general philosophy, users are encouraged to improve OF and make it evolve.

Teaching C++ to artists? Are you insane?

C++ made easier could be the unofficial slogan for OF. The tools it offers ‒ APIs ‒ avoid using fancy C++ concepts, and generally try to look like their counterparts in the successful JAVA-based package, Processing.

The authors themselves started with Flash (Fun), Lingo (Poetic) then Java (Learning by decompiling) and ACU, an earlier C++ based library written used internally at the MIT.

And returns on the first OF-based projects say those without a programming background have managed to learn and make use of it.

The main role OF is playing here is to provide wrappers for existing C/C++ libraries. OF hides their guts behind an easier and consistent facade.

OF is organized into two area:

  • OF Core
  • OF Addons

The OF Core represents the stable part of the wrapper, and OF Addons are libraries supported by third-parties and often quite experimental.

At the time of the talk it can be used in Mac, Windows, Linux and the iphone.¹

Similarities with Processing are numerous: The idea of not focusing on one single type of application, and rather trying to support various types such as installations, standalone programs, mobile phone programs, even print-based projects². The role as a meeting point for a community of creators. The label / brand it carries with it. And also the challenge that its founder face as they integrate a selection of libraries.

A great number of demonstrations is given then during the talk, and we especially like the last few minutes of the talk which concentrated on the community aspects.

The framework in its pre-release state is breathing through its internal forum. This gives the OF team and their users visibility of each other’s projects and encourage collaboration. The question is how to preserve this once OF has been released more widely? The team’s answer has been to organize events, workshops, coding parties in order to build and extend a tradition of collaboration around the OF project.

¹ No word was said on what often happens with multi-platform libraries. The tools offered through its API look the same yet when they are implemented by different libraries on different systems or device, then of course the output cannot be guaranteed to be the same. The supported inputs ‒ for example file formats supported for video content ‒ will also vary, for example.

² As with the examples given in the processing session, there is a strong fascination with giving a concrete manifestation to programs, to let them escape from the computer displays, or even to let the computer disappear. Is it because computers are too profane? Is it because while displays nowadays can be huge and high resolution, they are a limitation of their own?

Hans-Christoph Steiner: Pure Data and its community

August 22, 2009 by nicolas, tagged programming and art_and_code, filed under commentary

Hans-Christoph Steiner is yet again presenting a visual programming environment historically related to MAX/MSP: Pure Data.

Compared to his two counterparts (S.Oschatz, L.Dubois) H.C. Steiner shows a great deal of enthusiasm especially in the first half of his presentation.

His live examples are more sophisticated and give a better sense of the usage of PD.

What he communicates on the community itself is different from his counterparts: Sharing programs and distributing them seems more common within the Pure Data community than the VVVV and MAX community. This may be solely due to PD itself being Free Software¹.

One interesting piece of his presentation was a praise and critic of the Free Software concept itself, praising its concept for the right it gives to users and criticising its implementations in that the complexity of software systems and languages nowadays builds a high barrier of entry to any user willing to contribute.

After he’s seen examples such as netpd, a server to share pd patches over the network entirely built in PD itself, his opinion seems to be that visual languages can, on their own be legitimately used to create applications. And that their ease of access let them answer the question of improving software literacy (everybody read and write software) asked in Golan Levin’s introduction.

¹ MAX, VVVV and PD may be almost alike, their users have developed different traditions, and there lies different goals and practices. Analyzing a programming language or environment needs to take into account both its objective qualities and also the traditions of its user base.