Coder Social home page Coder Social logo

gypsybud / signal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ideoforms/signalflow

0.0 1.0 0.0 2.83 MB

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

Home Page: http://libsignal.io/

C++ 89.58% C 5.72% Python 1.66% Objective-C++ 0.49% CSS 0.61% JavaScript 0.91% HTML 0.50% Shell 0.54%

signal's Introduction

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.

Signal is in alpha status. Interfaces may be subject to change.

Example

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

AudioGraphRef graph = new AudioGraph();

/*------------------------------------------------------------------------
 * A SynthTemplate constructs a reusable synthesis graph.
 * Objects whose names end in Ref are std::shared_ptr smart pointers,
 * for automatic memory management.
 *-----------------------------------------------------------------------*/
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: Modulate the sine wave's amplitude with the
 * output of the ASR envelope.
 *-----------------------------------------------------------------------*/
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));

/*------------------------------------------------------------------------
 * A SynthTemplate must have a single output node. 
 *-----------------------------------------------------------------------*/
tmp->set_output(delay);

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

Installation

macOS

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.

To run an example:

cd build
./hello-world

License

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

For commercial use, please contact the author.

signal's People

Contributors

ideoforms avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.