International Conference on Live Coding (ICLC) 2025, Barcelona, May 27th - 31st.

dublang:

A multi-language live coding system


by Joenio M. Costa and Mari Moura

Laboratory 4two.art

Joenio Marques da Costa

http://joenio.me

Laboratory 4two.art

  • PhD candidate in Software Engineering
  • Work at Cortext Platform (www.cortext.net)
  • Debian Developer

Mari Moura

http://marimoura.4two.art

Laboratory 4two.art

  • Black Brazilian performer artist
  • PhD in art and technology
  • Undergraduate student in Systems Analysis and development

The name dublang is inspired
by the musical style dub

dub
Remixes of existing music
dublang
Remixes of existing software

Goals

  • Separation of concerns
  • Mix multiple languages
  • Plugins
  • Project management

Question: How to reduce the amount of windows?

Answer: A multi-language live coding system.


#!supercollider

{ SinOsc.ar([220, 140]) }.play

#!tidalcycles

d1 $ sound "808bd(3,8)" # shape 0.2

#!obs

stream.start


Available plugins

Name Description Name Description
Alda Programming language for music composition MPV Media player
eSpeak Speech synthesizer OBS Studio Screencasting and streaming app
Festival Speech Synthesis System Pure Data Visual programming language
FoxDot Python-based language for making music Sardine Python musical instrument
FUDI Pure Data networking protocol SM Displays multi-line text fullscreen as large as possible
Git Version control system SuperCollider Real-time audio synthesis environment
Tidal Cycles Live coding environment and algorithmic patterns etc…  

Lua

  • Pronounced “LOO-ah” means “Moon” in Portuguese
  • Created in 1993 at PUC-Rio University
  • Lightweight, tiny, embeddable scripting language

https://lua.org

Neovim

  • Text editor engineered for extensibility and usability
  • Installed by default on most Linux distributions
  • Lua 5.1 is the permanent interface for Nvim Lua

https://neovim.io

Systemd

  • A system and service manager
  • An init system used to manage user processes
  • The majority of Linux distributions adopt systemd

https://systemd.io

Client-Server Architecture

Systemd example: supercollider.service


[Unit]
Description=dublang supercollider service

[Service]
Type=simple
EnvironmentFile=$dublang_path/config/supercollider
Environment="LUA_PATH=$DUBLANG_LUA_PATH"
ExecStart=$dublang_path/handlers/supercollider-start

[Install]
WantedBy=multi-user.target


executed by the dublang Command-Line Interface written in Shellscript

Handler example:
supercollider-start


#!/usr/bin/env lua5.1

local handle, pid = uv.spawn('sclang', {
  stdio = {handler.stdin, handler.stdout,
                          handler.stderr}
}, function(code, signal) -- on exit
  print("exit code", code)
  print("exit signal", signal)
end)
assert(handle, "E: unable to run sclang\n" .. pid)
print("sclang started, pid = " .. pid)


this code runs with the standalone Lua 5.1 installed on the system

Neovim example:
supercollider.lua


return {
  name = 'supercollider',
  host = '127.0.0.1',
  port = 42001,
  filters = {util.envsubst, util.confsubst},
  connect = socket.tcp_connect,
  disconnect = socket.tcp_disconnect,
  run = socket.write,
  bite = hooks.bite,
}


this code runs with the embeded Lua 5.1 available inside Neovim

Architecture Layers

Demo

  • dublang Command-Line Interface
  • Filters
  • Triggers
  • Hooks
  • dublang Plugin

#!supercollider

SynthDef("osc", {
  arg freq;
  Out.ar([0,1], SinOsc.ar(freq, 0, 0.25));
}).add;

x = Synth("osc", ["freq", 440]);

#!mpv

video "videos-apocalypse-now/01.mp4"

vflip

neg

#!tidalcycles

d1 $ sound "cp"

#!espeak

test

#!dublang

cycle({
  function()
    espeak([[300 hertz]])
    mpv([[show-text "300 hertz"]])
    mpv([[clear]])
    supercollider([[x.set("freq", 300)]])
  end,
  function()
    espeak([[200 hertz]])
    mpv([[show-text "200 hertz"]])
    mpv([[vflip]])
    supercollider([[x.set("freq", 200)]])
  end
})

length(5000)

hooks('tidalcycles', {
  function(plugin, block)
    espeak([[tidal]])
  end
})


Future Work

  • Add support for other text editors
  • Add support for collaborative sessions
  • Add plugin for openFrameworks
  • Add plugin for Lua LÖVE 2D
  • Add plugin for WirePlumber (PipeWire)
  • Create a compiler based on Lua 5.1

dublang webpage:

https://dublang.4two.art

 

dublang source code:

https://codeberg.org/joenio/dublang-dev

Thanks!

joenio@joenio.me


This presentation is available at:

http://joenio.me/iclc2025-dublang-talk

Export this presentation as PDF (require chromium browser)

(source-code: https://gitlab.com/joenio/joenio.gitlab.io)

License Creative Commons

Presentation history

Where and when this presentation was done