Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have own JUCE plugin recognized as Instrument #255

Open
DamRsn opened this issue Oct 3, 2023 · 1 comment
Open

Have own JUCE plugin recognized as Instrument #255

DamRsn opened this issue Oct 3, 2023 · 1 comment
Labels
bug Something isn't working Plugin Issue Issues with audio plugins in general (not specific to one plugin)

Comments

@DamRsn
Copy link
Contributor

DamRsn commented Oct 3, 2023

Thanks for making this amazing library!

I'm working on building a synth with JUCE and I'd like to be able to use it from Python with pedalboard. But I'm having issues loading the VST3.

When I load it, it gets detected as an effect. After browsing pedalboard's code a bit, I realized that this was determined by whether the plugin accepts audio in the main input buses. This was the case for me as I had something like this:

AudioProcessor()
    : AudioProcessor(BusesProperties()
                         .withInput("Input", AudioChannelSet::stereo(), true))
                         .withOutput("Output", AudioChannelSet::stereo(), true))

So I removed the .withInput("Input", AudioChannelSet::stereo(), true)).

But when I try to load this new version of the plugin (with 0 channels as input), I get an exception from pedalboard coming from ExternalPlugin.h (setNumChannels() , line 741) saying:

Plugin '...' does not support 2-channel output. (Main bus currently expects 0 input channels and 2 output channels.)

It seems that this function tries to make the number of input and output channels (from the main bus) match, I'm not sure why. Perhaps mainInputBus should be nullptr for an instrument? In this case, the number of main input channels would not be modified.

As a dirty fix, I've added this to the setNumChannels() function, and with that I can load my plugin as an instrument:

if (mainInputBus->getNumberOfChannels() == 0)
      return;

Do you know how I can have my plugin recognized as an instrument properly?

Ideally I'd like to be able to keep my original busesProperties to stereo/stereo. Maybe load_plugin could have another argument is_instrument=None, that is used only if set to true or false to determine the type of plugin.

Anyway thanks for your help!

@jorshi
Copy link

jorshi commented Oct 16, 2023

@DamRsn -- in your ProJucer / Cmake do you have the IS_SYNTH flag set to TRUE? I was able to get pedalboard to recognize my JUCE synth with this.

I encountered a slightly different (but related) problem where I have a plugin that accepts audio as input, but can also accept midi. It seems like pedalboard treats plugins as either an audio effect or a synth, but not both, even though it is possible to congifure a plugin like this

@psobot psobot added bug Something isn't working Plugin Issue Issues with audio plugins in general (not specific to one plugin) labels Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Plugin Issue Issues with audio plugins in general (not specific to one plugin)
Projects
None yet
Development

No branches or pull requests

3 participants