-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 Phaser effect to LMMS #5168
Conversation
Prevent LMMS VisualizationWidget from showing clipping color at exact…
I think the changes in the flanger plugin should be decoupled before merging this. Also, I think |
@PhysSong Alright, I fixed all of those. |
🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩
Linux
Windows
🤖{"platform_name_to_artifacts": {"Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://13193-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.116%2Bg18e4803-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/13193?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "Windows": [{"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://13194-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.116%2Bg18e4803bf-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/13194?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://13195-15778896-gh.circle-artifacts.com/0/lmms-1.3.0-alpha.1.116%2Bg18e4803bf-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/13195?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/xfcx71chqlpov5c2/artifacts/build/lmms-1.3.0-alpha-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/38404371"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/9xf1893l5rgei9b8/artifacts/build/lmms-1.3.0-alpha-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/38404371"}]}, "commit_sha": "f67954282dfc68f384501c77be51fa47fb7cb559"} |
All merge conflicts and bugs have been removed. Feel free to test now. |
I just added some major enhancements to this Phaser effect, including both QOL tweaks and some new features. Here are some of the changes, though I'm sure I won't remember them all...
This is 100% ready for review, then merge. I do not intend to make any other changes to it feature-wise, unless you guys have any suggestions. |
@douglasdgi Your last commit changed the permission of some files from |
@PhysSong Oh, that got messed up when I made a backup of my files before reinstalling my OS. I didn't realize changing permissions mattered with this stuff. I might have a few questions about fixing that, I'll message you about it on Discord if I need help (later when I have time). |
Welp, that was a mess... somehow all of the files in my backup got set to 755 and I have no idea how. I managed to copy all of the file permissions over from an older backup (older by like two days), I think that fixed everything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the code looks good; I haven't checked that the DSP code does what it ought to - I believe you know what that is better than I do.
I think there ought to be a nicer way to share code between plugins than the ugly #include "../other_plugin/header.h"
, but that's out of scope here.
Testing it and it's brilliant! I think the Envelope Follower should have an enable button like the LFO. |
Alright, I think that covers everything.
@zonkmachine +1 octave means the input follower detecting an input volume of 0 dbFs (taking attack/release into account) will increase the Phaser frequency by 1 octave.
Done. Good suggestion, I never bothered adding one since setting the Input Follower amount to 0 does the same thing, but that's rather inconvenient. |
I got a ton of uninitialized variable errors while testing with Valgrind because |
@PhysSong Just changed it so m_frequency and m_phase are set to 0 in the constructor, I assume that fixes the issue. |
This is a really nice update, the old flanger has a new lease of life and sounds much better, it's not often that 3Osc can make me smile on the default patch, but with your upgrades to the flanger I did. I have to be honest, testing this PR has made me somewhat embarrassed at the horrid sound made when adjusting the delay knob, something I shall be looking into. The Phaser, nice work, the UI look clean and well laid out, sounds good, and is fun to play with. This will be a nice new addition to LMMS.
I think this is very important, we have 2 very distinct updates in this one pull request. This makes reviewing, testing, maintenance and commits logs very messy. I don't think it will take too much effort to separate these into individual pull requests, I am happy to provide any assistance you want. My proposal would be to start a new PR with the Flanger updates, due to the phaser being dependant on these changes. I would take the opportunity to refactor any DPS classes that are used in both plugins and relocate them within the core codebase, in preparation for the Phaser. I feel this would mainly be a copy-paste exercise, so all the previous work put into reviews will remain valid, I may have a few code comments but let's get the code separated first. Progression onto the Phasor will then be a lot simpler, as I am hoping the number of files changes drops from the current significant 29 to a more manageable level. We can look at the details as soon as the flanger PR is complete. |
@curlymorphic I extracted the Flanger changes to #5873. |
The review comments are addressed.
Due to the changes in #5873, this PR needs to be updated. |
@curlymorphic Do you want to re-review this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My previous comment about spitting this pull request, the flanger changes being separated from this new plugin, but more active devs may have a different opinion.
} | ||
if (analog) | ||
{ | ||
firstAdd[0] = tanh(s[0] * analogDist) / analogDist + tanh(tempAdd[0] * analogDist) / analogDist; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is the aliasing being limited, non linear processing such as tanh
always produces content higher in the frequency spectrum, and measures are required to reduce this, commonly oversampling / decimation are used but are expensive.
I feel if an analog distortion is added it should be done properly, not produce a digital-only sound such as, Aliasing. An alternative could be to implement this feature once lmms has adopted an oversampling / decimation library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't called "analog" because the distortion is analog, it's called "analog" because having distortion inside of the feedback loop is a characteristic of analog audio hardware. Like how Moog filters work by adding nonlinearities (distortion) into the filter feedback loops.
That being said, I do agree that aliasing should be avoided... but I am of the opinion that oversampling should be handled by LMMS itself rather than individual plugins, and that's out-of-scope for this plugin. I think every plugin should come with oversampling options, just like how every plugin comes with a Wet/Dry knob.
So, unless you disagree, I don't think we should bother with putting oversampling into here. I didn't put it into any of my other plugins for the same reason. If we implement oversampling as an LMMS feature rather than a per-plugin feature, we'll never have to worry about it ever again... because, in reality, over 90% of the plugins in the entire catalog could benefit from oversampling, so adding it in on a per-plugin basis seems quite unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aliasing is a very important fundamental concept in DSP, and has many reasons to be avoided, harmonic sounds become inharmonic, sound out of tune when played with other notes, fill the audio spectrum with unwanted content that makes final mixdowns muddy, and are an indicator of the quality of the product. I am aware that historically aliasing has not been of a high priority in LMMS, but I am not convinced adding to the problem would be constructive.
It is good practice to only oversample where necessary, due to the increased processing, If LMMS were to have a user option to oversample by plugin, this would be very inefficient due to the whole signal path in the plugin being processed multiple times, and expecting the artist to have an understanding of DSP and the consequences of setting the oversample rate. This is why I am not aware of any reputable DAW that takes this approach. It is always up to the plugin developer to handle anti-aliasing in an efficient manner.
That leaves the issue of how to progress with this plugin, specifically the "Analog distortion", I have a few suggestions, any one of these alone would solve this issue.
- Oversample and decimate the non linear processing (tanh).
- Rename the option from "Analog" to better describe the outcome, I would suggest a name that makes it clear that the aliasing is intended, as you have done elsewhere.
- Leave it as is, and hope no one notices or cares.
I shall leave the decision up to yourself, and shall not raise this issue again on this PR, unless asked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we should try to reduce aliasing, but there are some issues.
Oversample and decimate the non linear processing (tanh).
AFAIK, that add some delays around the non-linear processing. Wouldn't that affect the outcome in a way other than reducing aliasing?
Slightly out of scope, but I think filters may also leverage from oversampling for better frequency/phase response.
Rename the option from "Analog" to better describe the outcome
That might be a good choice, but I have no ideas on better names.
decreased the volume too much for my liking. | ||
*/ | ||
tempAdd[0] = tanh(tempAdd[0] * 0.5) * 2; | ||
tempAdd[1] = tanh(tempAdd[1] * 0.5) * 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has the aliasing been considered? although I feel this tanh
needs to remain, as it is much preferable to the infinite signal rise that could happen if removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is just for protection, how about bumping up the limit to 4 or so?
This PR has been replaced by #6540. |
(Awesome GUI designed by Roxas)
Introducing the Phaser, the ultimate Flanger companion! :)
Here are the changes made to the Flanger:
All three changes are 100% backwards-compatible.
Here's a screenshot of the new Phaser:
Here's an overview of its features (EDIT: This is out of date, I make some updates in some comments below):
I should also mention that because so many filters need to be used, I very aggressively optimized the allpass filters to the point that they only need an impressive two additions, two subtractions, and two multiplications each(!!). Most Phaser controls are also sample-exact, which is a fun bonus.
I'm excited for everybody to get their hands on this tool. It sounds very cool, and can easily add some deliciously vocal characteristics to your sounds.