Skip to content

cequencer/signal

 
 

Repository files navigation

signal

Build Status

Signal is an audio synthesis engine designed for structural clarity, lightness of code, and concise expression of complex ideas. It is built with modern standards, taking advantage of the powerful expressive capabilities of c++11 and json.

As of May 2016, Signal is in alpha status. Its codebase is under frequent development, and its interfaces may be subject to sudden change.

Example

#include <signal/signal.h>
using namespace libsignal;

AudioGraphRef graph = new AudioGraph();

/*------------------------------------------------------------------------
 * A SynthTemplate constructs a reusable synthesis graph.
 * -Ref objects are std::shared_ptr smart pointers,
 * so no memory management required.
 *-----------------------------------------------------------------------*/
SynthTemplateRef tmp = new SynthTemplate("ping");

/*------------------------------------------------------------------------
 * Initializing Sine with an array of frequencies creates a stereo output.
 *-----------------------------------------------------------------------*/
NodeRef sine = tmp->add_node(new Sine({ 440, 880 }));

/*------------------------------------------------------------------------
 * Simple attack/sustain/release envelope with linear curves.
 *-----------------------------------------------------------------------*/
NodeRef env = tmp->add_node(new ASR(0.01, 0.1, 0.5));

/*------------------------------------------------------------------------
 * Operator overloading: Apply the envelope to the sine wave's amplitude
 *-----------------------------------------------------------------------*/
NodeRef ping = tmp->add_node(sine * env);

/*------------------------------------------------------------------------
 * Single-tap delay line with feedback.
 *-----------------------------------------------------------------------*/
NodeRef delay = tmp->add_node(new Delay(ping, 0.5, 0.5));
tmp->set_output(delay);

/*------------------------------------------------------------------------
 * Instantiate the synth and route it to the audio output.
 *-----------------------------------------------------------------------*/
SynthRef synth = new Synth(tmp);
graph->add_output(synth);
graph->start();

Installation

OS X

To build with Homebrew dependencies:

brew install libsndfile libsoundio gsl
./waf

Linux (Ubuntu 14)

  • apt-get install git cmake g++ libasound2-dev libgsl0-dev libsndfile1-dev
  • Install libsoundio
  • ./waf

Raspberry Pi

Requires Raspbian jessie (for g++ 4.9).

  • apt-get install git cmake libasound2-dev libgsl0-dev libsndfile1-dev
  • Install libsoundio (latest GitHub version required)
  • ./waf

Examples

See examples for a number of example programs.

License

For non-commercial use, Signal is available under the terms of the GPL v3.

For commercial use, please contact the author.

About

An lightweight and cross-platform audio DSP engine, built in c++11.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 89.2%
  • C 6.1%
  • Python 1.5%
  • JavaScript 1.0%
  • CSS 0.7%
  • Shell 0.6%
  • Other 0.9%