• Stars
    star
    179
  • Rank 214,039 (Top 5 %)
  • Language
    C++
  • License
    Other
  • Created about 9 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A sound synthesis framework for Python, designed for clear and concise expression of musical ideas

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 alpha status. All 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/python 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, 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

More Repositories

1

python-twitter-examples

Examples of using Python for Twitter social data mining, using the python-twitter-tools framework.
Python
584
star
2

pylive

Query and control Ableton Live from Python
Python
467
star
3

AbletonOSC

Control Ableton Live 11 via Open Sound Control (OSC)
Python
366
star
4

isobar

A Python package for creating and manipulating musical patterns, designed for use in algorithmic composition, generative music and sonification. Can be used to generate MIDI events, MIDI files, OSC messages, or custom actions.
Python
366
star
5

python-supercollider

Python client for the SuperCollider audio synthesis server
Python
60
star
6

processing-sc

A Processing library to interface with the SuperCollider synthesis engine.
Java
25
star
7

tweetarchive

A lightweight twitter archiving tool, written in Python
Python
12
star
8

xgrid-installer

Apple Xgrid installer for Mountain Lion
CSS
10
star
9

subvertle

A framework to access, translate and synthesise BBC iPlayer subtitles.
Python
6
star
10

python-blockbuffer

Buffer samples and iterate over blocks of a fixed size, with overlap
Python
6
star
11

gossip

network-based model of gossip spread
5
star
12

sc-monome

SuperCollider classes to simplify interfacing with Monome OSC controllers
SuperCollider
4
star
13

ideoforms

3
star
14

pysoso

a quiet and pythonic way to follow the web
Python
3
star
15

lumin-order

Reorder a video file by frame luminosity.
Python
3
star
16

pcr1000

A Python package to interface with the ICOM PCR-1000 serial-controlled radio receiver.
Python
3
star
17

markup-melodium

The Markup Melodium: A JavaScript framework which translates webpages into music
JavaScript
2
star
18

proxy-toggle

OS X shell script to create an ssh web proxy
Shell
2
star
19

generate-changelog-from-releases

Generate CHANGELOG.md from GitHub releases
Python
2
star
20

audio-io-manager

A minimal audio I/O interface for iOS.
Objective-C
2
star
21

signalflow-audio

Audio files for the SignalFlow DSP engine
2
star
22

python-jdp

JSON Datagram Protocol for Python
Python
1
star
23

natural-systems

Processing code demonstrations on simulating natural systems
Processing
1
star
24

phd

Simulation code from my PhD thesis
C
1
star
25

qlspectrogram

QuickLook plugin to render audio files as a spectrogram
Objective-C
1
star