question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Convolutional reverb

See original GitHub issue

Is your feature request related to a problem? Please describe. It’d be nice to add the ability to convolve signals with impulse responses, possibly multichannel impulse responses.

Describe the solution you’d like I think we could implement it with the following API:

import nussl

audio = nussl.AudioSignal('/path/to/audio.wav')

# load impulse from file
impulse = nussl.AudioSignal('/path/to/impulse.wav')
# or load from array gotten by some means
impulse_array = generate_random_ir()
impulse = nussl.AudioSignal(audio_data_array=impulse_array, sample_rate=audio.sample_rate)

# non destructive (default), returns a new signal
convolved = audio.convolve(impulse) # -> AudioSignal

# destructive
audio.convolve(impulse, overwrite=True) # -> inplace

Three cases:

  • If impulse is single channel, then it is applied to all channels in audio.
  • If impulse is multi-channel, and audio is single-channel, then audio is broadcast to impulse. The output of convolve will be multi-channel in this case, even when audio is single-channel. It will have the same number of channels as impulse.
  • If both impulse and audio are multi-channel, then audio and impulse must have the same number of channels. Since impulse is an AudioSignal object, one could do to_mono() if there is a channel mismatch, then apply it:
# fix for channel mismatch
convolved = audio.convolve(impulse.to_mono())

or use make_audio_signal_from_channel:

convolved = audio.convolve(impulse.make_audio_signal_from_channel(0))

Treating impulse responses as just AudioSignal possibly gives a lot of nice benefits. Users could also convolve two signals even if one of them is not an impulse response, which could sound…interesting.

Describe alternatives you’ve considered Implementing this outside is nussl is simple by just editing the audio_data arrays. But this could be a nice feature, especially for data augmentation.

Additional context Add any other context or screenshots about the feature request here.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
pseethcommented, Aug 11, 2020

For actual implementation, we can just use scipy.signal.convolve, I think? We could do a GPU implementation via torch as well but I don’t know if that’s worth it.

0reactions
pseethcommented, Aug 11, 2020

I think I’d like it to be inmixing.py with a hook in audio_signal.py.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Convolution Reverb - Ableton
Convolution Reverb is a creative device for bringing new space to your sounds – a sample-based reverb suite with hundreds of impulse responses...
Read more >
What is Convolution Reverb? - Ask.Audio
Basically, a convolution reverb takes an input signal (the sound to be reverberated) and processes it with the sound of an actual or...
Read more >
Convolution Reverb 101: 7 Best Plugins and How to Use Them
Convolution reverb can transport a listener to a cathedral, an arena, or a cozy studio. Here's an explainer and top plugin picks!
Read more >
Convolution Reverb Explained - B&H
A Convolution Reverb consists of a recorded sample (called an Impulse Response or "IR") of an acoustic space to excitation from a signal...
Read more >
The 10 Best Convolution Reverb Plugins 2022 - Integraudio
Convolution Reverb is an effect that digitally simulates how sound would reverberate in a physical space. It uses a recording from the room's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found