Skip to content
Fabian-Robert Stöter edited this page Nov 26, 2016 · 35 revisions

Python in Audio Research

this is a comprehensive, curated list of python software and packages realted to scientific research in audio.

  • signal processing
  • music information retrieval
  • speech processing
  • ...

The python ecosystem is huge

Related lists

There is already this list, but it not up to date and includes too much packages of special interest, mostly not relevant for scientific applications. Awesome-Python is large curated list of python packages. However the audio section is very small. Please contribute.

Python Workflows

Spyder a.k.a the thing that looks like Matlab

Spyder is an Open Source Python IDE that comes with feautures like variable explorer and a builtin iPython/jupyter kernel view. Sometimes a bit buggy, but if you really rely on the MATLAB workflow this is the way to go. ⚠️ painful to install without anaconda.

Jupyter Notebooks

Best way to generate reports that include code and and results/figures

  • 👍 Easy to share. Can be hosted on github.com or jupyter nbviewer
  • 👍 Looks great and you can play audio right from the noteboook.
  • ✊ Working is cells works for short code segments, but can become messy, when there are many functions
  • 👎 Very limited builtin text editor
  • 👎 Native format is binary, so it not working nicely together with git

Atom

Atom is a relatively new open source text editor which has a great plugin system.

  • Python-Autocomplete autocompletion powered by Jedi. Also Go-to-definition.
  • Flake8
  • ⭐️Hydrogen Jupyter notebook like environment inside Atom. Allows you to run cells similar to Matlab.

Graphical Dev Environments

  • pyCharm Commercial Python IDE by JetBrains. Has free community edition available.
  • PyDev Eclipse based IDE

Start Python Audio in 3 Minutes

pip install soundfile
def process_audio(signal, factor=1.0):
    return signal * multiplier

# read wavfile into numpy array of shape (nb_channels, nb_samples)
audio, fs = sf.read("input.wav")
# Process audio
processed_audio = process_audio(audio, factor=0.5)
# write out processed audio to file
sf.write("out.wav", processed_audio, fs)

from awesome list

  • audiolazy - Expressive Digital Signal Processing (DSP) package for Python.
  • audioread - Cross-library (GStreamer + Core Audio + MAD + FFmpeg) audio decoding.
  • beets - A music library manager and MusicBrainz tagger.
  • dejavu - Audio fingerprinting and recognition.
  • pydub - Manipulate audio with a simple and easy high level interface.
  • TimeSide - Open web audio processing framework.
  • tinytag - A library for reading music meta data of MP3, OGG, FLAC and Wave files.

Packages to access public APIs

Tutorials/Books

Basic Audio Packages

Read/Write

Do not use scipy.io.wavfile, because it doesn't scale the data to [0, 1] also it doesn't support 24bit PCM wavfiles.

Courses/Notebooks

Transformations, General DSP

Perceptial/Auditory Models

Special Interest

Realtime applications

  • PYO C++ lib with python bindings for realtime audio (like supercollider)

Music Information Retrieval

  • essentia C++ feature extractor + general purpose audio/MIR related DSP algorithms like pitch tracking, beat detection.

  • Madmom MIR packages with strong focus on beat detection, onset detection and chord recognition.

  • VamPy Host

  • mir_eval common heuristic accuracy scores for various MIR tasks.

  • pyAudioAnalysis Feature Extraction + Classification

  • pyYAAFE Python bindings for YAAFE

  • aubio feature extractor, written in C, python interface

  • audiolazy Realtime Audio Processing lib, general purpose

Machine-Learning / Deep Neural Networks

  • Scikit-Learn
  • Keras
  • Lasagne
  • Tensorflow

Optimization

Source Separation

Visualisation/Plotting

  • matplotlib
  • seaborn
  • bokeh

Statistics

  • Pandas
  • Statsmodels
  • Scipy.stats

Symbolic Music

  • Music21
  • MIDO Realtime MIDI
  • Pretty-MIDI Utility functions for handling MIDI data in a nice/intuitive way
  • Mingus
  • mingus - An advanced music theory and notation package with MIDI file and playback support.

Speed

  • Numba

Bindings/Wrappers to other languages

Clone this wiki locally