xipd

programming language for audio processing that compiles to PureData
git clone https://git.ce9e.org/xipd.git

NameSize
.gitignore11B
LICENSE1072B
README.md5050B
run_test.sh136B
screenshots/example.png6343B
screenshots/simple.png1652B
setup.cfg452B
setup.py38B
test/test.pd445B
test/test.xipd146B
xipd/__init__.py0B
xipd/__main__.py424B
xipd/format.py1873B
xipd/parser.py5116B
xipd/renderer.py3667B
xipd/std.xipd480B

xipd is a programming language for audio processing that compiles to PureData.

Example

include "std.xipd"

osc(freq) {
    osc = `osc~`
    freq -> osc
    return osc
}

osc1 = osc(1)
osc2 = osc(osc1 *~ 20 +~ 440)
osc2 -> `dac~`

PureData Primer

PureData is a graphical programming environment for real-time audio processing. It consists of nodes and connections. For example, there could be one oscillator node, one node for audio output, and a connection between them.

There are two kinds of connections: control connections for sporadic messages and signal connections for continuous streams. Nodes that expect signal connections are usually suffixed with "~". For example, the + node can be used to add two numbers, but if you want to mix audio streams you have to use +~ instead.

Nodes can have multiple inlets and outlets. For example, the + node has two inlets. The value of a node is only updated when it receives a message to its first inlet. The first inlet is therefore referred to as hot while the others are called cold.

PureData comes with a large set of built-in nodes for low-level audio processing. There is also a large community that shares more high-level structures.

Goals

I personally had some issues with PureData, so I tried to wrap it in something that feels more familiar to me. The result of that attempt is xipd. The goals are:

Features

Names

Names for functions and variables must consist of upper and lower letters, digits, and underscores. The first character must not be a digit.

Expressions

An expression always represents a node combined with a default inlet/outlet. If no inlet/outlet is provided it always defaults to 0. There are many different types of expressions:

Statements

Each file is parsed line by line. Empty lines and lines starting with # are ignored, as is leading and trailing whitespace. All other lines must match one of the following patterns:

Low-level language

By not using functions and operators you can have a low-level language that is quite close to the PureData text representation:

X1 = 1
X2 = `osc~`
X3 = 20
X4 = `*~`
X5 = 440
X6 = `+~`
X7 = `osc~`
X8 = `dac~`
X1:0 -> X2:0
X2:0 -> X4:0
X3:0 -> X4:1
X4:0 -> X6:0
X5:0 -> X6:1
X6:0 -> X7:0
X7:0 -> X8:0