Get started

Build and install

To go through this tutorial, you need Linux and the following tools:

All of those tools are available in most Linux distributions.

First, clone the repository and cd into it:

$ git clone https://pedantic.software/git/sndc
$ cd sndc

You can build and install it in one command:

$ sudo make install

This will install sndc system-wide. You can specify a different installation prefix by setting the PREFIX environment variable:

$ make install PREFIX=~/.local

A couple of things get installed at once:

Check that everything is correctly installed with:

$ sndc -h

First SNDC file

Let’s write our first SNDC file. Create a new directory anywhere that we will use as a working directory. Create a new file in it named test.sndc, and copy the following content into it:

o: osc {
    function: "sin";
    freq: 440;
    duration: 1;
}

You can now play this file using the sndc_play wrapper that was installed above:

$ sndc_play ./test.sndc

This should produce a single tone at 440Hz lasting one second. If not, make sure all the above tools are installed.

Next: Basics