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

Add L/R channel routing for VST plugins #7247

Closed
wants to merge 5 commits into from

Conversation

messmerd
Copy link
Member

@messmerd messmerd commented May 8, 2024

Mono VST plugins in LMMS are not handled correctly. They only output audio in the left channel rather than upmixing their mono output to stereo. (See #6558)

I wanted to solve this problem but also allow more flexibility in how mono audio is handled, such as using one channel while bypassing the other. To do this, I've added a PluginPortConfig class which allows users to select a method of routing LMMS's stereo audio in and out of a mono-in, mono-out, or mono-in/out plugin. This is another feature from #7199 which I am moving to its own PR.

With PluginPortConfig, all mono VSTs have an automatable combo box in their parameters window to allow user control over how the mono plugin is integrated into the stereo DAW. The design is generic and will allow LV2 and possibly LADSPA to use it in the future.

By default, audio is down-mixed to mono for mono-input plugins and up-mixed to stereo for mono-output plugins.
There is also the option to only use one channel for input/output and bypass the other. This will be useful for mono effects, since users will be able to chain two effect instances together to create what is essentially a true stereo plugin if they are unsatisfied with up-mixing mono to stereo.

I also removed the "Close" button widget from the VST parameter windows since they are useless and were making it difficult for me to add the port configuration combo boxes.

Here's a chart of all possible routing configurations for each plugin type:
lr_routing_configurations

TODO:

  • Rename PluginPortConfig or keep the name?
  • Test with other mono VSTs - especially effect VSTs
  • Test loading and saving configurations
  • Add images to the ComboBox to visualize each configuration?
  • Add a helper class for routing audio based on the current configuration?
  • Audio bypass?
  • More stereo routing options?

Fixes #6558

@JohannesLorenz
Copy link
Contributor

It should be noted (also in the headline of this PR) that this only affects RemotePlugin based mono plugins (at least, LADSPA and Lv2 are currently not affected).

@JohannesLorenz JohannesLorenz self-requested a review June 19, 2024 20:05
@JohannesLorenz
Copy link
Contributor

It should be noted (also in the headline of this PR) that this only affects RemotePlugin based mono plugins

Well, if you plan to do it for all, the headline is correct, though 😃

@messmerd messmerd marked this pull request as draft June 20, 2024 04:44
@messmerd
Copy link
Member Author

Marking this as a draft because there's some refactoring I want to do, and a couple minor features from the TODO list that I want to try adding.

I expect to complete this work within the next few days.

@messmerd messmerd changed the title Add L/R channel routing for mono plugins Add L/R channel routing for VST plugins Jun 20, 2024
@messmerd
Copy link
Member Author

I'm closing this PR because while L/R routing offers a simple control over L/R plugin channels for common scenarios, there's a lot it's missing.

We want a solution that:

  • Will work with future audio routing
  • Supports plugins with >2 input channels or output channels
  • Is maximally flexible, allowing for example, swapping L and R channels
  • Provides an easy-to-use UI

REAPER has such a solution in its "Plug-in Pin Connector" which consists of two 2D boolean matrices (one for plugin input and one for plugin output) that specify how each audio channel is routed in and out of a plugin.

I've been working on a similar Pin Connector for LMMS, and will open a Pin Connector PR in the coming days to replace this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mono VST plugins output only to the left channel
2 participants