saugns & SAU language

saugns is an audio generation program. Written in C, it implements the SAU (Scriptable AUdio) language – a simple language for mathematical sound synthesis.

saugns program

Command-line usage examples can be found here.

saugns (the Scriptable AUdio GeNeration System) is a command-line program which reads SAU (Scriptable AUdio) scripts or strings and produces audio. Output can be to system audio, and/or a 16-bit PCM WAV file.

The program is written in C and on the lightweight side, without any dependencies beyond the standard C library and support for system audio on the given platform. While currently smaller than 100KB once built, it may grow with the language.

saugns is distributed under the terms of the GNU Lesser General Public License (LGPL), version 3 or later.

Supported platforms include x86 and x86-64, running DragonFly, FreeBSD, Linux, NetBSD, or OpenBSD. (It may or may not work on other *nix platforms.)

The README file (GitHub view) describes how to build and install it. (Short version: For the 4 major BSDs, ` make ` is enough to get it built.)

A more interesting test to run after building is the following, which produces 10 seconds of "engine rumble" using PM:

./saugns -e "Osin f137 t10 p+[Osin f32 p+[Osin f42]]"

A set of example and test scripts are included, along with a concise SAU language reference, as described in the README file.

SAU language

A brief overview of the syntax is available here. A compact language reference is included in the saugns doc/README.SAU file (GitHub view).

SAU is a simple language for mathematical sound synthesis, without support for the use of pre-recorded samples. While developed with the aim of becoming useful for writing electronic music, the language still has significant limitations, and the audio generated is retro-ish in its qualities. It is however easy to use for experimenting with sounds.

A collection of basic wave types are supported, as well as AM, FM, and PM (the "FM" of most commercial synthesizers). An arbitrary number of oscillators can be used.

Compared to older and more well-known audio synthesis languages, SAU is simpler (and less developed/full-featured) and more focused on FM/PM. There are differences in basic ideas concerning the language, which will be reflected in further development.

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.

Project and plans

The history of the project is briefly described here.

At some point in the future, the bulk of the program could be split off into a C library implementing support for the SAU language. Such a library could be used in e.g. media players to play SAU files, or in retro-ish games to play music or sounds from SAU files.

Some further ideas are listed on the saugns GitHub wiki.