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.
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
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)
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.6-pp37-pypy37_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfeb08f1ae4e41f20903eb924ba486c4d26d5c58f4b6c636ab1bb4a54979a145 |
|
MD5 | eb9528e0b35b774f81440591fc7943df |
|
BLAKE2b-256 | fac56747ad4fd15d84b49cc978e89cf8fbffb8a90052c54192751c4e926425bd |
Hashes for pedalboard-0.3.6-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 851423586585d88d009162971b77abd0b2a4dad3363b7256a2147426db1c46de |
|
MD5 | c5574322afded5d4d6545cab443dc6b2 |
|
BLAKE2b-256 | 5897236337ba61053236eaf55f5b9edba2fc7923fd4baf8d95d78b029f228f55 |
Hashes for pedalboard-0.3.6-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b68b164933862e68144202640006eb02050392c5752a9c98d9d3202c73ee94e9 |
|
MD5 | 1e21f495fd35760060087e2f574e037a |
|
BLAKE2b-256 | 7566b43898880d54caa946889d5d19e24cba21372cb0d540dd7bcfc2f927973c |
Hashes for pedalboard-0.3.6-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4042e03877d8495b45ebf46a979e8a74b89eb8a01c8a3c9212bffe2016e31fc4 |
|
MD5 | 04bf9a13b9cc3c1ca00c894c8cb6d032 |
|
BLAKE2b-256 | 850d23c55939eced18fcd12954349ca12ac262fc83bc64040a082718245b5c7f |
Hashes for pedalboard-0.3.6-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a23d899f4c7ec65297b07495770b4b5f9f1ca0c16ace0cb00eee984e6ba79afe |
|
MD5 | 8a52b66b40b76cfb1bb83732e4e612e0 |
|
BLAKE2b-256 | 4d2f86cd29ef2fb4138590bbfacd9da14defd109763bdaa1f9c361971437b79c |
Hashes for pedalboard-0.3.6-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1800610e44ec4ec1164be77a9c9ce2133d61d2e578ecd332447e0facd82d4bb4 |
|
MD5 | 707ac4fbc48b3acd3a393ec99d744556 |
|
BLAKE2b-256 | b7bf0a6c0ad1bff1df74fb06f0d9d7ddcc50f0eb9bef0327bfc42c73243cfa30 |
Hashes for pedalboard-0.3.6-cp39-cp39-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85787e0afcb452309356916ab02d5ab6a6237aab98ed2648689248963d2f76b4 |
|
MD5 | 98b91b690f483c396d5708a71f02f035 |
|
BLAKE2b-256 | 577741adc003cd8117ed24f7b0690dbce153be2056f80688a5ec80c0bf3e785a |
Hashes for pedalboard-0.3.6-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f07ae9d8f42dc25e71103e83baa535a882b05a967c7137173d9f926dcb1cd16c |
|
MD5 | aaa56f2ba7e2f8bdb0d32b152a40c050 |
|
BLAKE2b-256 | 004dc0dbb8fd13bfe274048a65a8d072557a4f58f0926a493319f7dde6af51a2 |
Hashes for pedalboard-0.3.6-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9799ead4ea0918201dcf15f87905231fc6d2d33b09cbc53b006d28e472bd479b |
|
MD5 | a9628528d62cd77fff5f9760ffa96234 |
|
BLAKE2b-256 | d0aa1e8474a8f570ecdd39c35579c90542aaeb69f06abb17e919a62a29d242ad |
Hashes for pedalboard-0.3.6-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7652decc06732902ba89c7cea265a14cddb892fa43c4457dfefd272ded11f05 |
|
MD5 | 1cdc03881a75b5176bea8e1be5a6549b |
|
BLAKE2b-256 | b1e9d78562517ad5ef72ec0a61117d2caf740180e12d814c60de902cfbc5e27e |
Hashes for pedalboard-0.3.6-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4785bfd200a719386e5571e104238afa67ba7f90d3fe4a54f55975d900cf3ba4 |
|
MD5 | 032923924e75e2e2b802c559b859cd12 |
|
BLAKE2b-256 | 3c8a04664224776dfc28e387ef0fce2225b61b421571d5e459eb1414d28c79f2 |
Hashes for pedalboard-0.3.6-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 525c8a8e7769fef49b72d7e6b320ed1bee7292edaa9e5339cda207cfb8888297 |
|
MD5 | 9303602d11ebeb9360adfc8220150ff4 |
|
BLAKE2b-256 | ba39593e5a96f5b7e6a754cd8f2252fd11922aeab1807a2821109022238cdc32 |
Hashes for pedalboard-0.3.6-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e8f9b728cb70032cd307a5d66e70792e3036b65e17cb87a0a9eb33fd41702ff |
|
MD5 | e27af2f68d8ffb1b8f941671d192b396 |
|
BLAKE2b-256 | 4916e927f83b497fc008a372bf71a5db0f1fc7b07c3053c13379b4de956cc013 |
Hashes for pedalboard-0.3.6-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 462b5833097d3188a183c9dbc96f03a5d37f77e62915c5d3ec90947e4dfa6a8a |
|
MD5 | 502980aaf13b631b34682852cc27d60d |
|
BLAKE2b-256 | b53e0fea813eaaa24fb71253008175cc12d196ada3892d9d02592f88506ad1c4 |
Hashes for pedalboard-0.3.6-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b75dfacb3860ac63eac94fe3d631da96d6ed6799ffd81a57c02dcc6746d9818 |
|
MD5 | ee6a1485b11963fa319d63340eda8b73 |
|
BLAKE2b-256 | 0f37a8679e56198451f912aed0d88e75428c9042c7c80e66f59b64d01615bf2b |
Hashes for pedalboard-0.3.6-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eee7cd407eb49d4dce536128a57601866698d46cb1e73bc802a6a8e1f81cf72c |
|
MD5 | 1251ca1e786fd1542b3a8fc9238e1c31 |
|
BLAKE2b-256 | eafde6fef24895ed5c25d35f9c0c3004092e4ad4f816e5f9f43efb0d3d28c32e |
Hashes for pedalboard-0.3.6-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9214e2e1d2875f84a7f57a4d41b702630292ac2f7003461dff54aeabc3c522c8 |
|
MD5 | 4f74b85d638291b862cc97f39e696535 |
|
BLAKE2b-256 | cf9ffe4185a5af7e4cc6740ca843b9fb874982068966cfc31235d8726e1799b1 |