spotify / pedalboard

🎛 🔊 A Python library for audio.

Home Page:https://spotify.github.io/pedalboard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some VST3 instruments produce no audio output until a UI is shown.

DavidDiazGuerra opened this issue · comments

Hello,

I've been working with some VST3i instruments in Windows and some of them do not work or have very weird behaviors.

With Spitfire's BBC Symphony Orchestra Discover, I only get any audio if I do a plt plot before calling the instrument. This can be replicated with the following script:

from pedalboard import Pedalboard, Reverb, load_plugin
from mido import Message
import matplotlib.pyplot as plt

instrument = load_plugin("C:/Program Files/Common Files/VST3/BBC Symphony Orchestra (64 Bit).vst3/Contents/x86_64-win/BBC Symphony Orchestra (64 Bit).vst3")

# plt.plot(0)
# plt.show()

audio = instrument(
  [Message("note_on", note=60), Message("note_off", note=60, time=5)],
  duration=5, # seconds
  sample_rate=44100,
)

plt.plot(audio.T)
plt.show()

I've run this code in one computer with Windows 11 and in one with Windows 10 and in both cases audio is all zeros. However, uncommenting the plt lines, audio is correctly filled with the synthesized signal. Any idea about what can be going on?

I've also tried with Orchestools' Strings plugin and neither in Windows or in Linux could I get any synthesized signal, even doing a plt plot before calling the instrument.

I've tested the installation of both plugins using Reaper DAW and they work well there. The Magical8BitPlug2 plugin works well with pedalboard in those installations.

Hey @DavidDiazGuerra!

Thanks for the bug report - I can confirm that I can reproduce this issue on macOS with Spitfire plugins. While I haven't been able to find the root cause just yet, I have a suspicion that these plugins do something on their non-audio thread that "unlocks" the audio output, and their main thread doesn't get a chance to run unless the UI event loop is driven (either by plt, or by instrument.show_editor()).

I'll be able to take a look at this shortly, but one alternative workaround would be to call the .show_editor() method to open the plugin's native UI, then send a KeyboardInterrupt (a.k.a. Ctrl-C) to close it.

@DavidDiazGuerra The fix for this issue should now be available on PyPI in version 0.7.6, which was deployed over the weekend.

I've just tested the new version and both Spitfire's BBC Symphony Orchestra Discover and Orchestools' Strings plugin works well on Windows.

Thanks for fixing this!

And Orchestools' Strings plugin also works well in Linux!