Add L/R channel routing for VST plugins #7247
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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](https://private-user-images.githubusercontent.com/33463986/340061525-1e298c08-e730-4996-9629-e3fe81072b93.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE4NDIwMTgsIm5iZiI6MTcyMTg0MTcxOCwicGF0aCI6Ii8zMzQ2Mzk4Ni8zNDAwNjE1MjUtMWUyOThjMDgtZTczMC00OTk2LTk2MjktZTNmZTgxMDcyYjkzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI0VDE3MjE1OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIxZTBjOWZkMzdjMGYzYzllOTk3MmMyM2ZjMmFiMjJhMjdjNDNkZjI2MmE4NWNlNGUzMDE0YmFhNGEwZDFlMDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.vDe8LMVUUuPaIosCEfF1zW0VPyq8tnw8_03kMwTv5XU)
TODO:
PluginPortConfig
or keep the name?Fixes #6558