Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save victormurcia/144c538dbb3af1d6f89960fab1a35760 to your computer and use it in GitHub Desktop.
nature_song_pedalboard.
# Read in a whole audio file:
with AudioFile('nature_harmony_combined.wav', 'r') as f:
audio = f.read(f.frames)
samplerate = f.samplerate
# Make a Pedalboard object, containing multiple plugins:
board = Pedalboard([
LadderFilter(mode=LadderFilter.Mode.HPF12, cutoff_hz=100),
Delay(delay_seconds = 0.1),
Reverb(room_size = 1, wet_level=0.1, width = 0.5),
PitchShift(semitones = 6),
#Chorus(rate_hz = 15),
Phaser(rate_hz = 5, depth = 0.5, centre_frequency_hz = 500.0),
])
# Run the audio through this pedalboard!
effected = board(audio, samplerate)
# Write the audio back as a wav file:
with AudioFile('processed-nature_harmony_combined.wav', 'w', samplerate, effected.shape[0]) as f:
f.write(effected)
ipd.Audio('processed-nature_harmony_combined.wav')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment