spotify / pedalboard

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

Allow MIDI messages for all external instrument plugins #345

Closed kmontag closed 3 days ago

kmontag commented 5 days ago

Problem

Some external instrument plugins have audio inputs on the main bus when loaded in pedalboard. This has been observed with AU and VST3 versions of Native Instruments Reaktor 6 and Arturia ARP 2600 V3, for example. When attempting to send MIDI inputs to such plugins, pedalboard throws an error like "ValueError: Plugin '[name]' expects audio as input, but was provided MIDI messages."

Solution

Instead of using the presence of audio inputs to determine whether a plugin accepts MIDI messages, use the isInstrument value from the plugin description object.

kmontag commented 5 days ago

Unfortunately there are no new tests added here, since I couldn't find any OSS plugins that reproduce this issue - I've only seen it with proprietary ones. I'm happy to add tests if anyone has ideas for how to do so...

psobot commented 3 days ago

This is great - thanks @kmontag!