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.
Features
- 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 (
pedalboard.load_plugin
) - 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 for single transforms, and 2-5x faster1 than SoxBindings
- 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, 3.9, and 3.10 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
(x86-84, 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
Hashes for pedalboard-0.3.8-pp37-pypy37_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 364bdf3774b662369fe8b70265230f13103ad5d9a4a3cccd7dd191cc498ab131 |
|
MD5 | f88f66d9bb182e0e048eca416f3b5a06 |
|
BLAKE2b-256 | e78e63942c08e213923424d5dc2f11a2a791f8188cb20f03afd9df06cc3480d8 |
Hashes for pedalboard-0.3.8-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea50cb023fc7eb53edc7f0a14419a30d7ee24d51056eb567dba56af6cdb6cb4a |
|
MD5 | 0cbf7a2587d9cf202784253fd007ad38 |
|
BLAKE2b-256 | acf8a51d629e4e24ba8e72eba8e11167c6b4b26102df6c9599559627e3d3836d |
Hashes for pedalboard-0.3.8-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a16ca8f4907106a9e6011a167cb5fcd0ea0fb082a38b2f485b3c86be64319dd0 |
|
MD5 | 191dfe9098b4c53e0ac0181bdc2480ba |
|
BLAKE2b-256 | 8dcf12f073258c2b5ade3ff1cf410395317bd2bfb5b6688ec96334a29f019932 |
Hashes for pedalboard-0.3.8-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4fa21a82f67d08364bdb87d6217c85f38aa2aa9e3800c7777120ce5e9129bb7 |
|
MD5 | 491aefe9fdaec3e0852b411d1c28685f |
|
BLAKE2b-256 | f97a42536418a11c12fbf3823bebe98abeaa155573a668df99c9c4a3670a05a1 |
Hashes for pedalboard-0.3.8-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce7e6ed877297c9c731fabbc39e090ac938df742431587e5df8c0eb10e77deec |
|
MD5 | e539970d3e00b3e4898fa9d406503b25 |
|
BLAKE2b-256 | 4f196089d7f739d249bb47d7590ad654334b37ec764093078241f4fdbb9e0d42 |
Hashes for pedalboard-0.3.8-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a8d85ad2e281479699e7a795abdef15fe943e8df928be43beff39b6e8d5b672 |
|
MD5 | 1e0e3826b4a7658bc9f3c374dc9bc72d |
|
BLAKE2b-256 | e674648d58727086d631e148f68f4202712bcaa2eb5600c76d5c309d04c74ee6 |
Hashes for pedalboard-0.3.8-cp310-cp310-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b0967c8ad38a32b33eddedc13024bacd6441f7e52302f933e510c4a58769da7 |
|
MD5 | a365bd739c68be55c2783c5be5ea7883 |
|
BLAKE2b-256 | 37af3e8fcd630440aa5b89d5ebfb95bce4ce9a52c83e3ee1eeaf588ff9aef34d |
Hashes for pedalboard-0.3.8-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ac12b15ccec9b42a2e6ac93e60091407c27ba98ae75fe68b7a5ae0fe126b401 |
|
MD5 | c6758fbe695eb8b835032e01c7bc6c82 |
|
BLAKE2b-256 | c7db87db46936bed428f3d8c98c6b8bd1c9c6b324f00433f546202c105999711 |
Hashes for pedalboard-0.3.8-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91b3d45497302e072ddcb5e08fe06343d7a6ad6413207ce18a8946bf788e79e8 |
|
MD5 | 98e370db2560e4966b49c6641514cee4 |
|
BLAKE2b-256 | 9cff9ff72bc7336dd56dc93ccf73547412164b03968cb46d6b588b5c36df64d9 |
Hashes for pedalboard-0.3.8-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 436e22e6e4f1db2b94a04ec34e346299175dbd9772911efb11de953860e17100 |
|
MD5 | e7ed57129814a2b7da44fc1059d52ba4 |
|
BLAKE2b-256 | 345be5b19c4a088b8f99f063e09543855f4decdf2f5db57aa1efecd3a95b65ac |
Hashes for pedalboard-0.3.8-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f66fc814c046a14875cd5e9adafe4168c05ad8b79505d09d3ad42ba76891292b |
|
MD5 | ec4145a1cfbd91c203cb4a7c46777351 |
|
BLAKE2b-256 | e404a73f9ef5bd4415c386d50799194dd1ab6bf4f612597619660114d1c30ed7 |
Hashes for pedalboard-0.3.8-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edf46f7e2c09b07a5785dc19a951c652e3951653abdd4f548a3e895425fcb21b |
|
MD5 | c31a94c957734d163904f2eaad0ba616 |
|
BLAKE2b-256 | e21b59fc292bec43a3199c433c073a6e905811c7540bbe9d6f73fb7d651b9532 |
Hashes for pedalboard-0.3.8-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eed71e0f468570587ccf97033047fd13673cb37584ef013e93d1d8aab5f8134d |
|
MD5 | 574d53b5687d7bd7f157c08ccd0c480c |
|
BLAKE2b-256 | 66e730bc349f1d0e26764105cb8d45704f41273e53744716a5041ac22241984e |
Hashes for pedalboard-0.3.8-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59996424a914c61e2af496f1125acea4e1551022b4b4af0a17a623abfa3004b4 |
|
MD5 | c549545a71cd35610dfec0ee4813b407 |
|
BLAKE2b-256 | 43e822531a30decb1506f6c8a8cf2e3b84f4b656eaa70cc61cf56388e0a7c8d3 |
Hashes for pedalboard-0.3.8-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 156373921829bb004d9ed080738b04028480ec24bfd01327be330a09435424bf |
|
MD5 | 8f5e95d9e5f402cc8f43caec4cbdeeb0 |
|
BLAKE2b-256 | eca0687926af88def4865fe7cad5f6415b71f7c692bd358d5a96cafbac57d401 |
Hashes for pedalboard-0.3.8-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a196c09026e10c4fb36b392e1a2e1659725202428e1bc9c13917eabb264bf4a |
|
MD5 | 4f1f1cce280798725e71136ea8e10da9 |
|
BLAKE2b-256 | 792792a7dec81fe45b5f968a83560d7d12c1e44b72f130dc46b8da0bca7b2757 |
Hashes for pedalboard-0.3.8-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a09fe7abb3c4540ea1522b35507806900dce43db03370798f7d6f34ae6e624d9 |
|
MD5 | 66884538a7cb9d608b820843e77dd864 |
|
BLAKE2b-256 | 5f46a38b4593cf9ccd7ca5971b1040bb405dfd9274bb5072251d13453e6c9bd3 |
Hashes for pedalboard-0.3.8-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3bdce7198050c4b8b47dcd871f68f8d8033a026571ec5080c3222e12339b088 |
|
MD5 | 20745c2113f4a3bd641cd2c93604d242 |
|
BLAKE2b-256 | 4703e10c6bc59e431e025377b9861be9779a8b6139c9e56035c3ec5593f1c704 |
Hashes for pedalboard-0.3.8-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7c1884629db784f7f45e1c5ae6cbbf24d0e8182c50ef3cd57ac2503a8a55cb6 |
|
MD5 | 7ac6e21d3cefb2e2a800828e223ec114 |
|
BLAKE2b-256 | 286771e582bc4d68062696bce8da2ea06656a394cf433c6864e2359af1c97bee |
Hashes for pedalboard-0.3.8-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e7eebacbcf21ea6641fb71303b8db643d091250550fbd2e1e39ae8686a8dd95 |
|
MD5 | 582b42fd0c9a829253dbcc6c6e686534 |
|
BLAKE2b-256 | cad4c34d060462a1be13cf6a851795189b20c55b32da9aa55a75809a51432dd0 |
Hashes for pedalboard-0.3.8-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 005975808a7224becdf2e0ff6049b3c4f3e78489a7fb2579e3f7267cf05e9fc8 |
|
MD5 | e5968e9ad66be26c58702d4e81869ae0 |
|
BLAKE2b-256 | 4026ee00b5977fa18ab0799c5ee3346d905cf5d579303c4ac9e770e6f3450436 |