spotify / pedalboard

🎛 🔊 A Python library for audio.
https://spotify.github.io/pedalboard
GNU General Public License v3.0
5.15k stars 260 forks source link

Support for multiple inputs plugins #254

Open spolezhaev opened 1 year ago

spolezhaev commented 1 year ago

Hello! Thank you for the great library.

Are there any plans to support plugins with multiple inputs, such as for sidechain compression?

psobot commented 12 months ago

Hi @spolezhaev!

That's not currently on the roadmap, but wouldn't be too hard to add - the process method of ExternalPlugin would need to be overloaded to take in multiple input buffers, and multi-input plugins would not be supported as part of Pedalboard objects/chains. (Adding that would also be possible, but that's a significant API overhaul that I'm not sure how to design just yet.)

Do you have an example of such a plugin that could be used for testing?

spolezhaev commented 12 months ago

Thanks for the info!

As an example, you can use RoughRider3, a free compressor plugin. It has sidechain input which is the second input of the plugin.

dodeca-6-tope commented 6 months ago

@spolezhaev did you figure it out? I'm also interested in using external plugins with multiple inputs.

yogeshpatki commented 1 month ago

@psobot sorry to bring this up after almost an year, but is this on a recent version of roadmap?

If not, could you give me some pointers to start working on the overloaded process method? I'm happy to have a stab at it.

I did some digging around and found that vst3 plugins report multiple input buses. Usually, the sidechain audio input is to be fed to one of these input buses.

I'm guessing most vst3 plugins that require/support multiple inputs, require the messages to be fed to different input buses.

yogeshpatki commented 1 month ago

To simplify my previous message,

Plugins that support multiple audio inputs often seem to expect the audios to be fed into different input buses. (This may play into design decisions, if this feature request is honored)

Pedalboard seems to feed the input audio in the first input bus, while disabling the other input buses. I am not sure if there is a simple fix/work around for supporting multiple audios.

Will be great if you can provide any pointers as to where I could start looking in the code.