A Python library for adding effects to audio.
Project description
pedalboard
is a Python library for adding effects to audio. It supports a number of common audio effects out of the box, and also allows the use of VST3® and Audio Unit plugin formats for third-party effects. It was built by Spotify's Audio Intelligence Lab to enable using studio-quality audio effects from within Python and TensorFlow.
Internally at Spotify, pedalboard
is used for data augmentation to improve machine learning models. pedalboard
also helps in the process of content creation, making it possible to add effects to audio without using a Digital Audio Workstation.
Usage
- Built-in support for a number of basic audio transformations:
Convolution
Compressor
Chorus
Distortion
Gain
HighpassFilter
LadderFilter
Limiter
LowpassFilter
Phaser
Reverb
- Supports VST3® plugins on macOS, Windows, and Linux
- Supports Audio Units on macOS
- Strong thread-safety, memory usage, and speed guarantees
- Releases Python's Global Interpreter Lock (GIL) to allow use of multiple CPU cores
- No need to use
multiprocessing
!
- No need to use
- Even when only using one thread:
- Processes audio up to 300x faster than pySoX
- Releases Python's Global Interpreter Lock (GIL) to allow use of multiple CPU cores
- Tested compatibility with TensorFlow - can be used in
tf.data
pipelines!
Installation
pedalboard
is available via PyPI (via Platform Wheels):
pip install pedalboard
If you are new to Python, follow INSTALLATION.md for a robust guide.
Compatibility
pedalboard
is thoroughly tested with Python 3.6, 3.7, 3.8, and 3.9, as well as experimental support for PyPy 7.3.
- Linux
- Tested heavily in production use cases at Spotify
- Tested automatically on GitHub with VSTs
- Platform
manylinux
wheels built forx86_64
- Most Linux VSTs require a relatively modern Linux installation (with glibc > 2.27)
- macOS
- Tested manually with VSTs and Audio Units
- Tested automatically on GitHub with VSTs
- Platform wheels available for both Intel and Apple Silicon
- Compatible with a wide range of VSTs and Audio Units
- Windows
- Tested automatically on GitHub with VSTs
- Platform wheels available for
amd64
(Intel/AMD)
Plugin Compatibility
pedalboard
allows loading VST3® and Audio Unit plugins, which could contain any code.
Most plugins that have been tested work just fine with pedalboard
, but some plugins may
not work with pedalboard
; at worst, some may even crash the Python interpreter without
warning and with no ability to catch the error. For an ever-growing compatibility list,
see COMPATIBILITY.md.
Most audio plugins are "well-behaved" and conform to a set of conventions for how audio
plugins are supposed to work, but many do not conform to the VST3® or Audio Unit
specifications. pedalboard
attempts to detect some common programming errors in plugins
and can work around many issues, including automatically detecting plugins that don't
clear their internal state when asked. Even so, plugins can misbehave without pedalboard
noticing.
If audio is being rendered incorrectly or if audio is "leaking" from one process()
call
to the next in an undesired fashion, try:
- Passing silence to the plugin in between calls to
process()
, to ensure that any reverb tails or other internal state has time to fade to silence - Reloading the plugin every time audio is processed (with
pedalboard.load_plugin
)
Examples
A very basic example of how to use pedalboard
's built-in plugins:
import soundfile as sf
from pedalboard import (
Pedalboard,
Convolution,
Compressor,
Chorus,
Gain,
Reverb,
Limiter,
LadderFilter,
Phaser,
)
audio, sample_rate = sf.read('some-file.wav')
# Make a Pedalboard object, containing multiple plugins:
board = Pedalboard([
Compressor(threshold_db=-50, ratio=25),
Gain(gain_db=30),
Chorus(),
LadderFilter(mode=LadderFilter.Mode.HPF12, cutoff_hz=900),
Phaser(),
Convolution("./guitar_amp.wav", 1.0),
Reverb(room_size=0.25),
], sample_rate=sample_rate)
# Pedalboard objects behave like lists, so you can add plugins:
board.append(Compressor(threshold_db=-25, ratio=10))
board.append(Gain(gain_db=10))
board.append(Limiter())
# Run the audio through this pedalboard!
effected = board(audio)
# Write the audio back as a wav file:
with sf.SoundFile('./processed-output-stereo.wav', 'w', samplerate=sample_rate, channels=len(effected.shape)) as f:
f.write(effected)
Loading a VST3® plugin and manipulating its parameters
import soundfile as sf
from pedalboard import Pedalboard, Reverb, load_plugin
# Load a VST3 package from a known path on disk:
vst = load_plugin("./VSTs/RoughRider3.vst3")
print(vst.parameters.keys())
# dict_keys([
# 'sc_hpf_hz',
# 'input_lvl_db',
# 'sensitivity_db',
# 'ratio',
# 'attack_ms',
# 'release_ms',
# 'makeup_db',
# 'mix',
# 'output_lvl_db',
# 'sc_active',
# 'full_bandwidth',
# 'bypass',
# 'program',
# ])
# Set the "ratio" parameter to 15
vst.ratio = 15
# Use this VST to process some audio:
audio, sample_rate = sf.read('some-file.wav')
effected = vst(audio, sample_rate=sample_rate)
# ...or put this VST into a chain with other plugins:
board = Pedalboard([vst, Reverb()], sample_rate=sample_rate)
# ...and run that pedalboard with the same VST instance!
effected = board(audio)
For more examples, see:
- the
examples
folder of this repository - the Pedalboard Demo Colab notebook
- an interactive web demo on Hugging Face Spaces and Gradio (via @AK391)
Contributing
Contributions to pedalboard
are welcomed! See CONTRIBUTING.md for details.
License
pedalboard
is Copyright 2021 Spotify AB.
pedalboard
is licensed under the GNU General Public License v3, because:
- The core audio processing code is pulled from JUCE 6, which is dual-licensed under a commercial license and the GPLv3
- The VST3 SDK, bundled with JUCE, is owned by Steinberg® Media Technologies GmbH and licensed under the GPLv3.
VST is a registered trademark of Steinberg Media Technologies GmbH.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file pedalboard-0.3.7-pp37-pypy37_pp73-win_amd64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-pp37-pypy37_pp73-win_amd64.whl
- Upload date:
- Size: 2.5 MB
- Tags: PyPy, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 261c76494233508f8215a853d84d8516afc6292ed6ab7c949fa2eff95882c65f |
|
MD5 | 932b807f043a65a962b701efa76d28ef |
|
BLAKE2b-256 | 102b7c4144e92fdb1db7ac5ac8670326dd234f38725c90c8b2341c51d16be488 |
File details
Details for the file pedalboard-0.3.7-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: PyPy, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43bf1a3b79202036190cc6efc8484717d57ac7c5f91d43a086e3b7e760c69126 |
|
MD5 | 7de103aea2d82b1a7edc949439ef6344 |
|
BLAKE2b-256 | 0d2048258f23b2ad9059bb84147c9aefd488fff86648588291e021dd96314a74 |
File details
Details for the file pedalboard-0.3.7-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: PyPy, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01a5ae8eb62ea9dd7ea1466f9adf0fe242557d519c9f7ce8c89bcec942795626 |
|
MD5 | 88462f1485f4c9e5645a8d040074af69 |
|
BLAKE2b-256 | 90ee5b254eb81a3a4890e481478795cbfab36c2e7a215d024e78eafb45b6cc92 |
File details
Details for the file pedalboard-0.3.7-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca55b45a2709eb5d7e11f3aeea1fe991312b6ac2067339d44214dc579adfd547 |
|
MD5 | 83c14cffb19679c63981fc28c4fb45ad |
|
BLAKE2b-256 | 5dd94258246fc9c615847637ca97f0e2b0107cfaea000eecd49c2bffbf94e9a6 |
File details
Details for the file pedalboard-0.3.7-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.9, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ab6a57514bad1c4f57a8fcee744955349832d840ddd6fb001a35325478d8197 |
|
MD5 | 998dbe644c88ea15e5ea6dc8842a2d99 |
|
BLAKE2b-256 | 882e5c85b22a7b055571db3f2119927b70a909b0568009137e6379034f3572e0 |
File details
Details for the file pedalboard-0.3.7-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | de01f5d79aa87a90392d7b3987eba960554437d1f81728f09196da7b5fe87e30 |
|
MD5 | 0061e03170d8263f1d3aa5eb8138834d |
|
BLAKE2b-256 | 7991da7d9ca805620f865ac5fbd4944a583701e914d54e5cf4065897613fcc54 |
File details
Details for the file pedalboard-0.3.7-cp39-cp39-macosx_10_9_universal2.whl
.
File metadata
- Download URL: pedalboard-0.3.7-cp39-cp39-macosx_10_9_universal2.whl
- Upload date:
- Size: 5.7 MB
- Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4bac3615d0caee9097d94352b8c8033c1dd5446016ff49c8f6b7607fb7bf5ca |
|
MD5 | 3a8163d04844562ca7cd084a2370bc4e |
|
BLAKE2b-256 | 8cfb8d2e9ad7a85821db26444ed7a4ea59da348a89e9a70af517a1ce7103d080 |
File details
Details for the file pedalboard-0.3.7-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb57eeb08b82500b097d0943352c0f21779621e87533784e78dfcfefa75fcd6b |
|
MD5 | aaed29b01fdaf30aae1d647b18a313c6 |
|
BLAKE2b-256 | 98bfbf1da53ec74355e524a38619ce50f07a4701dd3605c3d9a89239a60f173a |
File details
Details for the file pedalboard-0.3.7-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c77b3f064b5c150f2844973e293242fe84983f3ebe23a4380b7c2823048e0f8 |
|
MD5 | 4fdfa03ddf82a27f5e920426f46dae9a |
|
BLAKE2b-256 | bcc4358dfb3df82b8e35d88c8a95eb609dcf87071d24f39ecdf467b7b2aeefb4 |
File details
Details for the file pedalboard-0.3.7-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05b810d36941d89b652bd71ca7f0a19477f8f22f188475e5e43650f5648b24b7 |
|
MD5 | 66833fad9fe1370606dfb9e214b5ea2a |
|
BLAKE2b-256 | fdbe2fb2ac197d559995479cd64d90cef1c3148ffa51a438a9db3f11555fdf5e |
File details
Details for the file pedalboard-0.3.7-cp38-cp38-macosx_10_9_universal2.whl
.
File metadata
- Download URL: pedalboard-0.3.7-cp38-cp38-macosx_10_9_universal2.whl
- Upload date:
- Size: 5.7 MB
- Tags: CPython 3.8, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d9a95a2545bcac8e8618e9f2e61e1828e459de35a75399e19f13bb2344f84e6 |
|
MD5 | d25de57fec3fc877fa617b1d4344d762 |
|
BLAKE2b-256 | b87dab11fa9969ad7342b281167cc287baf48bdd511e5b7bedd6b0b2bfc503d3 |
File details
Details for the file pedalboard-0.3.7-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f02992925c20cc54fbb35e4511aad09ae65a0cac972486a6957b1baf7931983d |
|
MD5 | df72e768f095973c5a0ecfac27e25456 |
|
BLAKE2b-256 | 0354d6380034f4b2d6661ee3e7a8c44a997fd4a3da3c908810301567f07413f1 |
File details
Details for the file pedalboard-0.3.7-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12b9ebc031cf3889c92513775e030afcfdc7ec6bf6d8248ba29d961cbfa79f93 |
|
MD5 | 30c39246d0914c6cdc13e931c3687457 |
|
BLAKE2b-256 | 4772af884b15e31025010ed210151221f887a9fa5c863f64fb7cd31cf82a1429 |
File details
Details for the file pedalboard-0.3.7-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f22e2b52789df7931375dd41bdaae47adde52e8dd5591f090370232e308a0193 |
|
MD5 | 60624bb8d4f78a660e9e74e6b107211a |
|
BLAKE2b-256 | 064f7cd9c6bdc40dfec427bb83762a2a4e10f432ff31bee43c6b1b7e5dd74e11 |
File details
Details for the file pedalboard-0.3.7-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbef8fa050d222632225526a8e907f0b873db1b5a3bc4fbbf1bcb0b4c7ede896 |
|
MD5 | 188999f1678ea7712fbe04728c2b4288 |
|
BLAKE2b-256 | 0cd6168ca1bf430b7b7c3ec6837c784535c07cf18eb5e0fff99d0d6f78253aca |
File details
Details for the file pedalboard-0.3.7-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb881e7d518d93171fe964a43c52dc46a3eb7fa5f0faa836c65917be3be9658c |
|
MD5 | 0d66cd7e358fbcba6077a07530687228 |
|
BLAKE2b-256 | dd369c18a11490ee6ac8a983ad27ff972d31f4c8bc9a061dddf9847472f4a412 |
File details
Details for the file pedalboard-0.3.7-cp36-cp36m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pedalboard-0.3.7-cp36-cp36m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: CPython 3.6m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e5e50d3f3fcf43dd711930719694ce907bd55be199241bb1ad005df37e65a99 |
|
MD5 | 6bfaacba558c6488c67bee61703b977b |
|
BLAKE2b-256 | 90970dff727702eec459dc46238070965a1ab3bfd1c4e97febe877c4604805ec |