Skip to content

Instantly share code, notes, and snippets.

@victormurcia
Created September 3, 2022 05:24
Show Gist options
  • Select an option

  • Save victormurcia/e8aa79f0317661662532f53faf553db8 to your computer and use it in GitHub Desktop.

Select an option

Save victormurcia/e8aa79f0317661662532f53faf553db8 to your computer and use it in GitHub Desktop.
water_song_pedalboard
from pedalboard import Pedalboard, Chorus, Reverb, Compressor, Gain, LadderFilter
from pedalboard import Phaser, Delay, PitchShift, Distortion
from pedalboard.io import AudioFile
# Read in a whole audio file:
with AudioFile('water_song.wav', 'r') as f:
audio = f.read(f.frames)
samplerate = f.samplerate
# Make a Pedalboard object, containing multiple plugins:
board = Pedalboard([
#Delay(delay_seconds=0.25, mix=1.0),
Compressor(threshold_db=-100, ratio=25),
Gain(gain_db=150),
Chorus(),
LadderFilter(mode=LadderFilter.Mode.HPF12, cutoff_hz=900),
Phaser(),
Reverb(room_size=0.5),
])
# Run the audio through this pedalboard!
effected = board(audio, samplerate)
# Write the audio back as a wav file:
with AudioFile('processed-water_song.wav', 'w', samplerate, effected.shape[0]) as f:
f.write(effected)
ipd.Audio('processed-water_song.wav')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment