Glicol

Glicol (an acronym for "graph-oriented live coding language") is a computer music language with both its language and audio engine written in Rust, a modern alternative to C/C++. Given this low-level nature, Glicol can run on many different platforms such as browsers, VST plugins, and Bela board. Glicol's synth-like syntax and powerful audio engine also make it possible to combine high-level synth or sequencer control with low-level sample-accurate audio synthesis, all in real-time.

Get Started

🚀 The Web App

The easiest way to try Glicol is through its web app. Here, you can find guides, demos, documentation, and collaborative tools.

Features

🎁 For Audio Dev

Glicol provides various features for audio developers:

  • NPM Docs: Safe, performant, light-weight, and ergonomic audio library for web apps.
  • Rust Audio Lib: Write VST plugins, such as the Dattorro reverb plugin.
  • Run on Bela: Use Glicol DSL on the Bela board for quick audio prototyping.

🍿 YouTube Channel

Check out Glicol demo videos on the YouTube playlist.

Philosophy of Glicol

The motivation behind Glicol is to:

  • Help people with zero knowledge of coding and music production to get started with live coding.
  • Offer experienced music coders a tool for quick prototyping and hacking.

Glicol is known in the NIME community for its "low entry fee and high ceilings" approach.

Design and Implementation

Glicol adopts a graph-oriented paradigm, which allows users to connect different nodes like synth modules. It can be used in browsers with zero installation. The basic idea is to understand the audio input/output behavior of each node. Nodes are connected using >> and ~reference.

// Amplitude modulation and lazy evaluation example
// Chain with ~ is a ref chain and will not be sent to the DAC
 
o: sin 440 >> mul ~amp
~amp: sin 1.0 >> mul 0.3 >> add 0.5

This also applies to sequencers and samplers:

// Sequencer pattern
// First divide one bar with space
// Then further divide each part based on midi number and rest(_)
 
o: speed 2.0 >> seq 60 _~a _ 48__67 >> sp \blip
 
// Quantity alters probability
~a: choose 60 60 0 0 72 72

You can try these examples on the web app.

Zero-installation

For the audio engine, Glicol is written entirely in Rust. The parser and the audio engine work seamlessly with the AST processing, and it is ported to browsers using WebAssembly, AudioWorklet, and SharedArrayBuffer. This approach allows for performant audio in browsers, easy access, and live coding collaboration.

Meta Node

By writing everything from a low-level perspective, Glicol also opens the door for meta nodes. An example of a "hello world" tone in Glicol:

o: meta `
    output.pad(128, 0.0);
    for i in 0..128 {
        output[i] = sin(2*PI()*phase) ;
        phase += 440.0 / sr;
    };
    while phase > 1.0 { phase -= 1.0 };
    output
`

Roadmap

Glicol's development is ongoing and highly experimental. The API may change before version 1.0.0. Some milestones in the roadmap include:

  • 0.1.0: Initial version with dasp_graph and pest.rs
  • 0.2.0: BPM control in console
  • 0.3.0: Complex node plate reverb using basic nodes
  • 0.4.0: Efficient graph updating with LCS algorithm
  • 0.5.0: Support for local sample loading
  • 0.6.0: Modular refactor
  • 0.7.0: Mixing JS with Glicol
  • 0.8.0: Embed Rhai in Glicol
  • 0.9.0: Redesigned architecture
  • 0.10.0: VST plugin support
  • 0.11.0: Run on Bela
  • 0.12.0: Distribute as an npm package

Similar Projects