Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save victormurcia/660f82af4f0c423438f0810953139477 to your computer and use it in GitHub Desktop.
catterina_song_pedalboard
# Read in a whole audio file:
with AudioFile('catterina_song.wav', 'r') as f:
audio = f.read(f.frames)
samplerate = f.samplerate
print(samplerate)
# Make a Pedalboard object, containing multiple plugins:
board = Pedalboard([
LadderFilter(mode=LadderFilter.Mode.HPF12, cutoff_hz=100),
Delay(delay_seconds = 0.3),
Reverb(room_size = 0.6, wet_level=0.2, width = 1.0),
PitchShift(semitones = 6),
])
# Run the audio through this pedalboard!
effected = board(audio, samplerate)
# Write the audio back as a wav file:
with AudioFile('processed-catterina_song.wav', 'w', samplerate, effected.shape[0]) as f:
f.write(effected)
ipd.Audio('processed-catterina_song.wav')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment