Skip to content

The Cursed Library

Masterminded by Belgian animator Karim Maaloul, The Cursed Library is a visual feast with a rich soundtrack.
Concept, illustration and programming – Karim Maaloul

Karim Maaloul showed me his Cursed Library project in late 2023. It was a very rich 3D interactive piece featuring six portals into spooky worlds, each one being a phenomenal interactive scene in itself. I was simply stunned by it. It was only missing one thing – a soundtrack.

My musical collaborator Jules Maxwell and I set about recording improvisations against screen capture recordings of the worlds, much like scoring a movie. I then deconstructed the parts into much smaller elements – loops and one-shot sounds – that could be composed in different ways and shared between different scenes to keep the file size as small as possible and let us build all the scenes for all the worlds from configuration files. The biggest challenge on the audio side was keeping the file size down, since the 3D model files were already pretty hefty and, after the initial loading stage, we never wanted to show a “Loading” message or wait for audio to load.

To achieve this, I built a custom audio engine for the piece, based on the open-source WebAudio library ToneJS. The concept was fairly simple – to set up groups of sounds that shared as many elements as possible, using a crossfade technique to smoothly change the ambient sound as the viewer moved around each world.

Occasionally the engine would also choose random options from “pools” of sounds at the various camera viewpoints so it wasn’t always the same.

For example, in the Kafka world, there are 6 gnarly tremolo guitar lines in a kind of Marc Ribot / Tom Waits style. If a scene has a guitar in it, the engine chooses from the pool of guitar sounds for that scene. Once the sound has played, it can chain on to the next sound, play another random one or just stop. Having various options in the configuration files, meant we had quite a bit of flexibility to try out different arrangements without ever having to create any new audio files.

The engine became more and more advanced as the project went on, eventually providing options for voiceovers, multiple music layers, background world sounds, gesture audio, effects and a white noise generator.

One of our favourite uses of the engine is the gory layering of sound effects to create rhythms in The House of Bluebeard. Stevie took sound effects like chains, axes, blood dripping and his own evil grunting sounds to create a morphing rhythmic loop that accompanies the viewer through the visuals of the house. Accompanied by Jules and Stevie’s drunken accordion song, it makes for a pretty unusual soundtrack.


Karim thought that the project would benefit from some narration, or at least some words on the screen, as the whole project was about books. Not being a native English speaker, he turned to the internet’s favourite poet – ChatGPT – to create a poem for each scene. ChatGPT is amazing at many things, but alas, poetry is not one of them.

To a native English speaker, the poems written by ChatGPT were terrible, with no musical rhythm and some excruciatingly angular rhymes! I insisted that the only way to do it was the old-fashioned way – sitting in my favourite cafés of south east London and writing them all by hand in ny notebook. I decided to make them all four lines long, the bare minimum to set the scene so the graphics and music could do the rest.

Intro poem – Chat GPT

In the cursed library, beware!
Scary books are everywhere,
Spectres haunt the dusty shelves,
Whispers fill the spooky delves.

Each book holds a scary tale,
With curses and spells that never fail,
But if you’re brave and do not fear,
You’ll find adventure lurking near.

So come and see the cursed hall,
But watch your step, don’t trip or fall,
For in this library, the scary books,
Will leave you with spooky looks.

My Intro poem

In this library dark and cursed
lies more than meets the eye
Portals six are hidden here
To find them you must try

I recorded the spoken poems in my Northern Irish accent, adding a touch of formant shifting to push the vocals into pure horror territory. The final decision was to have both text on the screen and the spoken word as audio since English spoken in a Northern Irish accent may as well be some ancient language from Lord of The Rings; the Belgian test listeners had no idea what I was saying. I did also provide the option to remove the voiceovers for a “minimal experience” (ie. to shut myself up once and for all).