Skip to main content

SignalFlow is a sound synthesis library designed to make it quick and intuitive to explore complex sonic ideas

Project description

SignalFlow

ci stability-beta

SignalFlow is a sound synthesis framework designed for clear and concise expression of complex musical ideas. It has an extensive Python API, for fluid audio experimentation in iPython/Jupyter. Its core is written in C++11, so it can also be embedded into other cross-platform applications.

SignalFlow is in beta status. Interfaces may be subject to change.

Example

from signalflow import *

#--------------------------------------------------------------------------------
# An AudioGraph is made up of a network of interconnected Nodes, which generate
# and process audio. 
#--------------------------------------------------------------------------------
graph = AudioGraph()

#--------------------------------------------------------------------------------
# Passing an array of frequencies creates a stereo output.
#--------------------------------------------------------------------------------
sine = SineOscillator([440, 880])

#--------------------------------------------------------------------------------
# Simple attack/sustain/release envelope with linear curves.
#--------------------------------------------------------------------------------
env = ASREnvelope(0.01, 0.1, 0.5)

#--------------------------------------------------------------------------------
# Use standard arithmetic operations to combine signals. When a multi-channel 
# signal is multiplied by a mono signal, the mono signal is auto-upmixed.
#--------------------------------------------------------------------------------
output = sine * env

#--------------------------------------------------------------------------------
# Connect the output to the graph, and begin playback.
#--------------------------------------------------------------------------------
output.play()
graph.wait()

Installation

SignalFlow requires Python 3.8 or above.

Installation: macOS

macOS

Install an up-to-date version of Python 3 using Homebrew (guide): brew install python3

Install SignalFlow using pip:

pip3 install signalflow

That's it! To test that it is installed successfully, play a test tone by running: signalflow test

From source

To build on macOS from source, install dependencies with Homebrew:

brew install cmake python libsndfile libsoundio

Clone this repository, then build and install with pip:

pip3 install .
Installation: Linux, Raspberry Pi

Linux, Raspberry Pi

SignalFlow supports Linux (verified on Ubuntu 20.04 and Raspberry Pi OS buster) with alsa and pulseaudio backends.

Via pip

Installation via pip is supported for Linux x86_64. To install:

pip3 install signalflow

That's it! To test that it is installed successfully, play a test tone by running: signalflow test.

If installation does not succeed, follow the instructions for building from source below.

From source

To build the Python library from source on Linux, install dependencies with apt:

apt-get install -y git cmake g++ python3-pip libasound2-dev libsndfile1-dev libsoundio-dev fftw3-dev

If you experience an error on Raspberry Pi libf77blas.so.3: cannot open shared object file:

sudo apt-get install -y libatlas-base-dev

Clone this repository, then build and install with pip:

pip3 install .
Installation: Windows

Windows

This is work in progress.

Currently, dependencies need to be downloaded and built by hand. These can be placed anywhere.

To build SignalFlow, use the CMake GUI. Press configure and you will see three empty fields to fill in with the path to the two build folders and the FFTW binaries folder (see above). Set these parameters then press Configure, then Generate then Open. Then build in Visual Studio 2019.

As of 2021-03-03, only the signalflow project has been ported to build correctly on Windows. Only tested in x64 and for Debug builds. Tested using Visual Studio 2019.

Installation: C++ only (no Python layer)

To build and install the C++ core without the Python binding layer:

mkdir build
cd build
cmake ..
make -j8

Examples

See examples for a number of example scripts.

Documentation

More detailed documentation can be found at signalflow.dev.

Node classes

The following Node classes are currently included with the base distribution:

Category Classes
Analysis CrossCorrelate, OnsetDetector, VampAnalysis
Buffer BeatCutter, BufferLooper, BufferPlayer, BufferRecorder, FeedbackBufferReader, FeedbackBufferWriter, GrainSegments, Granulator, SegmentPlayer
Control MouseX, MouseY, MouseDown
Envelope ADSREnvelope, ASREnvelope, DetectSilence, Envelope, Line, RectangularEnvelope
FFT FFTContinuousPhaseVocoder, FFTConvolve, FFT, FFTNode, FFTOpNode, FFTFindPeaks, IFFT, FFTLPF, FFTNoiseGate, FFTPhaseVocoder, FFTTonality, FFTZeroPhase
Operators Add, AmplitudeToDecibels, DecibelsToAmplitude, ChannelArray, ChannelCrossfade, ChannelMixer, ChannelSelect, Equal, NotEqual, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, Modulo, Abs, If, Divide, FrequencyToMidiNote, MidiNoteToFrequency, Multiply, Pow, RoundToScale, Round, ScaleLinExp, ScaleLinLin, Subtract, Sum, Sin, Cos, Tan, Tanh
Oscillators Constant, Impulse, LFO, SawLFO, SawOscillator, SineLFO, SineOscillator, SquareLFO, SquareOscillator, TriangleLFO, TriangleOscillator, Wavetable, Wavetable2D
Processors Clip, Fold, Smooth, WetDry, Wrap
Processors: Delays AllpassDelay, CombDelay, OneTapDelay, Stutter
Processors: Distortion Resample, SampleAndHold, Squiz, WaveShaper
Processors: Dynamics Compressor, Gate, Maximiser, RMS
Processors: Filters BiquadFilter, EQ, MoogVCF, SVFilter
Processors: Panning AzimuthPanner, ChannelPanner, SpatialPanner, StereoBalance, StereoPanner, StereoWidth
Sequencing ClockDivider, Counter, Euclidean, FlipFlop, ImpulseSequence, Index, Latch, Sequence
Stochastic Logistic, PinkNoise, RandomBrownian, RandomChoice, RandomCoin, RandomExponentialDist, RandomExponential, RandomGaussian, RandomImpulseSequence, RandomImpulse, RandomUniform, StochasticNode, WhiteNoise

Contributors

Thanks to the following contributors:

  • Arthur Carabott (@acarabott), Tim Murray-Browne (@timmb): Windows support
  • Dan Stowell (@danstowell): Build improvements
  • Marc Fargas (@telenieko): Generous donation of the signalflow pypi namespace

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

signalflow-0.4.4-cp312-cp312-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.12 Windows x86-64

File details

Details for the file signalflow-0.4.4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for signalflow-0.4.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 dc056b4b61fd822ff277d038d9ea923b205bdb626677f8a4a57b4d6ee6d09d52
MD5 8a82ec7b3fe16e21a233136af71521cc
BLAKE2b-256 46306f1c8af1cc11f3457bd0fcf0ada3f12f6aa25b2bf4ea1d0f3ce886fd5302

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page