The SAU language & saugns program

saugns is an audio generation program. Written in C, it implements the SAU (Scriptable AUdio) language – a simple language for mathematical audio synthesis. SAU could also be called an audio programming language, or a music programming language, these being old and commonly used terms for something rather general.

Project and downloads

Browse pages

saugns program

More on command-line usage here.

saugns (the Scriptable AUdio GeNeration System) is a command-line parser and player for SAU (Scriptable AUdio) files and text strings. It can also write audio from scripts to WAV files, Au streams, and raw data.

The program is written in C, without dependencies beyond the standard C library plus system audio support on the given platform. (Only systematically tested on x86/x86-64 on *BSD and Linux systems.) While currently at most around 120 KB when built on my systems, it may grow with the language. It's designed to be fast and can be used even on old and underpowered laptops.

The README file describes how to build and install it. (If you're running one of the 4 major BSD systems, `make` should be enough to get it built.)

Simple tests

After building the program, a 1-second 440 Hz test tone can be produced by simply running:

./saugns -e "Wsin"

A more interesting test to run after building may be the following, for 10 seconds of "engine rumble" using PM (it should sound like this):

./saugns -e "Wsin f137 t10 p[Wsin f10*pi p[Wsin r(4/3)(pi/3)]]"

Or for 30 seconds of random chirp drum drumming, with randomly strong dynamics-shaping...

./saugns -e "\$seed=time() Wsin f33 p[Rxpe mt1 f5 a33] a0.r1[Rcub f5*2] t30"

Further examples and test scripts come with the program, along with a concise SAU language reference, as described in the README file. (There's also a selection of examples with rendered audio available on the examples page.)


saugns is distributed under the terms of the GNU Lesser General Public License (LGPL), version 3 or later. Some smaller parts are however more permissively licensed, and each such file notes which license (e.g. the ISC license) it is provided under.

This website is available under the Creative Commons Attribution-ShareAlike 4.0 License – except for CC0 public domain example scripts and rendered audio.

SAU language

See the main broad language overview; for some specific uses, there's also more how-to examples. A more detail-focused language reference is in the README.SAU file.

SAU is a simple language for mathematical audio synthesis, deliberately without support for the use of pre-recorded samples. While developed with the aim of becoming useful for writing electronic music, it is currently mainly suitable for sounds and soundscapes. The language is by design limited, and not Turing complete, all scripts having pre-calculable duration. Within those limits, more features are however planned.

Currently, audio generation is supported through the use of the following types of audio generators, and ways of configuring such objects:

The long-term goal is for the syntax both to describe complex sounds in a simple way, and, especially, for it to make it simple to write long and intricate sequences of sounds – music – both tersely and in a way easy to mentally map and keep track of. The former may be the easier part; the latter requires greater expressiveness than the language has at present. The road towards something more full-featured is different than that taken by most languages – but the planning is only half-formulated, and ideas are welcome, as long as they allow for something reasonably simple.

Changes between versions

The SAU language sometimes changes between versions of the saugns program. Changes are listed both in the version tags and in a shorter language change log.

Project and plans

The history is briefly described here.

Some ideas for future development are mentioned on the project wiki and issues on Codeberg. Among them, a shorter list includes:


Any of the sites which the project is on can be used (the main ones being Codeberg and Framagit). Feedback is welcome, and you can also reach me by email (I'm "joelkp" at, and "joelkpettersson" at

I also have a personal website where I touch on related and other things.

I'm interested in finding work, especially work on things related to those involved in this project – or more broadly in surrounding areas.