-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add Phaser effect to LMMS #5168
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
Closed
Closed
Changes from 8 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
7f1c954
Merge pull request #8 from LMMS/master
LostRobotMusic 0bb50a8
Merge pull request #11 from LMMS/master
LostRobotMusic a332d47
Merge pull request #12 from LMMS/master
LostRobotMusic 5f0aacc
Merge pull request #13 from LMMS/master
LostRobotMusic 6f4afb1
Add Phaser effect, upgrade Flanger effect
LostRobotMusic b41a6a9
Resolve code/style reviews
LostRobotMusic b9d1b45
Resolve code/style reviews, don't calulate LFO rate every loop
LostRobotMusic 9a8fdfa
Rename Phaser.cpp and Phaser.h to PhaserEffect.cpp and PhaserEffect.h
LostRobotMusic 4e1ba1d
Remove unnecessary Phaser disconnection
LostRobotMusic b7dd6d1
Fix Phaser artwork LFO font
LostRobotMusic 779d1b5
Merge branch 'master' into phaser
LostRobotMusic bd9ee92
Add Phaser to plugin list
LostRobotMusic 8534cab
Add many enhancements for the Phaser effect
LostRobotMusic 34221f3
Fix stuff
LostRobotMusic ed7c1b2
Fix stuff 2: Electric Boogaloo
LostRobotMusic b467652
Fix stuff 3: No joke here
LostRobotMusic 47e6f6a
Resolve code and style reviews
LostRobotMusic 185ce06
Resolve more code and style reviews
LostRobotMusic fbd62a6
Input follower range buff
LostRobotMusic 81bbf89
Make LFO Rate logarithmic by default
LostRobotMusic df143d1
Remove RMS from input follower
LostRobotMusic c5ce560
Fix compilation complaints
LostRobotMusic 6b97fb5
Major update
LostRobotMusic 9e9a824
Fix stuffs
LostRobotMusic 9cd0ecf
Fix more stuffs
LostRobotMusic 801acf4
Add Input Follower enable button
LostRobotMusic 3211fe6
Initialize QuadratureLfo's frequency and phase in constructor
LostRobotMusic ab2dee9
Why is it called oven when you of in the cold food of out hot eat the…
LostRobotMusic b4bac58
Revert one of the modes to its original naming, due to very high demand.
LostRobotMusic e597a2c
Fix merge conflicts with Flanger upgrade PR
LostRobotMusic f436816
Continue running Phaser while LFO is disabled
LostRobotMusic f679542
Fix inaccurate comment
LostRobotMusic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| INCLUDE(BuildPlugin) | ||
|
|
||
| BUILD_PLUGIN(flanger FlangerEffect.cpp FlangerControls.cpp FlangerControlsDialog.cpp Noise.cpp QuadratureLfo.cpp MonoDelay.cpp MOCFILES FlangerControls.h FlangerControlsDialog.h EMBEDDED_RESOURCES artwork.png logo.png) | ||
| BUILD_PLUGIN(flanger FlangerEffect.cpp FlangerControls.cpp FlangerControlsDialog.cpp Noise.cpp MonoDelay.cpp MOCFILES FlangerControls.h FlangerControlsDialog.h EMBEDDED_RESOURCES artwork.png logo.png) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| INCLUDE(BuildPlugin) | ||
|
|
||
| BUILD_PLUGIN(phaser PhaserEffect.cpp PhaserControls.cpp PhaserControlDialog.cpp MOCFILES PhaserControls.h PhaserControlDialog.h ../Eq/EqFader.h EMBEDDED_RESOURCES artwork.png logo.png cutoffDotLeft.png cutoffDotRight.png) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| /* | ||
| * PhaserControlDialog.cpp | ||
| * | ||
| * Copyright (c) 2019 Lost Robot <[email protected]> | ||
| * | ||
| * This file is part of LMMS - https://lmms.io | ||
| * | ||
| * This program is free software; you can redistribute it and/or | ||
| * modify it under the terms of the GNU General Public | ||
| * License as published by the Free Software Foundation; either | ||
| * version 2 of the License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| * General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public | ||
| * License along with this program (see COPYING); if not, write to the | ||
| * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
| * Boston, MA 02110-1301 USA. | ||
| * | ||
| */ | ||
|
|
||
| #include <QLayout> | ||
|
|
||
| #include "PhaserEffect.h" | ||
| #include "PhaserControlDialog.h" | ||
| #include "PhaserControls.h" | ||
| #include "embed.h" | ||
| #include "LedCheckbox.h" | ||
| #include "TempoSyncKnob.h" | ||
| #include "../Eq/EqFader.h" | ||
| #include "lmms_math.h" | ||
|
|
||
|
|
||
| const int PHA_DOT_SLIDER_LENGTH = 338; | ||
| const float PHA_MIN_FREQ = 20; | ||
| const float PHA_MAX_FREQ = 20000; | ||
DomClark marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| PhaserControlDialog::PhaserControlDialog(PhaserControls* controls) : | ||
| EffectControlDialog(controls) | ||
| { | ||
| m_controls = controls; | ||
DomClark marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| setAutoFillBackground(true); | ||
| QPalette pal; | ||
| pal.setBrush(backgroundRole(), PLUGIN_NAME::getIconPixmap("artwork")); | ||
| setPalette(pal); | ||
| setFixedSize(371, 155); | ||
|
|
||
| Knob * cutoffKnob = new Knob(knobBright_26, this); | ||
| cutoffKnob -> move(65, 13); | ||
| cutoffKnob->setModel(&controls->m_cutoffModel); | ||
| cutoffKnob->setHintText(tr("Cutoff:"), " Hz"); | ||
|
|
||
| Knob * resonanceKnob = new Knob(knobBright_26, this); | ||
| resonanceKnob -> move(103, 13); | ||
| resonanceKnob->setModel(&controls->m_resonanceModel); | ||
| resonanceKnob->setHintText(tr("Resonance:"), ""); | ||
|
|
||
| Knob * feedbackKnob = new Knob(knobBright_26, this); | ||
| feedbackKnob -> move(159, 13); | ||
| feedbackKnob->setModel(&controls->m_feedbackModel); | ||
| feedbackKnob->setHintText(tr("Feedback:"), "%"); | ||
|
|
||
| LcdSpinBox * m_orderBox = new LcdSpinBox(2, this, "Order"); | ||
| m_orderBox->setModel(&controls->m_orderModel); | ||
| m_orderBox->move(245, 17); | ||
|
|
||
| Knob * delayKnob = new Knob(knobBright_26, this); | ||
| delayKnob -> move(197, 13); | ||
| delayKnob->setModel(&controls->m_delayModel); | ||
| delayKnob->setHintText(tr("Delay:"), " samples"); | ||
|
|
||
| TempoSyncKnob * rateKnob = new TempoSyncKnob(knobBright_26, this); | ||
| rateKnob -> move(104, 84); | ||
| rateKnob->setModel(&controls->m_rateModel); | ||
| rateKnob->setHintText(tr("Rate:"), " Sec"); | ||
|
|
||
| Knob * amountKnob = new Knob(knobBright_26, this); | ||
| amountKnob -> move(66, 84); | ||
| amountKnob->setModel(&controls->m_amountModel); | ||
| amountKnob->setHintText(tr("Amount:"), " octaves"); | ||
|
|
||
| Knob * phaseKnob = new Knob(knobBright_26, this); | ||
| phaseKnob -> move(142, 84); | ||
| phaseKnob->setModel(&controls->m_phaseModel); | ||
| phaseKnob->setHintText(tr("Phase:"), " degrees"); | ||
|
|
||
| Knob * wetDryKnob = new Knob(knobBright_26, this); | ||
| wetDryKnob -> move(285, 13); | ||
| wetDryKnob->setModel(&controls->m_wetDryModel); | ||
| wetDryKnob->setHintText(tr("Wet/Dry:"), ""); | ||
|
|
||
| Knob * inFollowKnob = new Knob(knobBright_26, this); | ||
| inFollowKnob -> move(203, 84); | ||
| inFollowKnob->setModel(&controls->m_inFollowModel); | ||
| inFollowKnob->setHintText(tr("Input Following:"), " octaves"); | ||
|
|
||
| Knob * attackKnob = new Knob(knobBright_26, this); | ||
| attackKnob -> move(241, 84); | ||
| attackKnob->setModel(&controls->m_attackModel); | ||
| attackKnob->setHintText(tr("Attack:"), " ms"); | ||
|
|
||
| Knob * releaseKnob = new Knob(knobBright_26, this); | ||
| releaseKnob -> move(279, 84); | ||
| releaseKnob->setModel(&controls->m_releaseModel); | ||
| releaseKnob->setHintText(tr("Release:"), " ms"); | ||
|
|
||
| QPixmap m_cutoffDotLeftImg = PLUGIN_NAME::getIconPixmap("cutoffDotLeft"); | ||
| m_cutoffDotLeftLabel = new QLabel(this); | ||
| m_cutoffDotLeftLabel->setPixmap(m_cutoffDotLeftImg); | ||
| m_cutoffDotLeftLabel->setAttribute(Qt::WA_TransparentForMouseEvents); | ||
| m_cutoffDotLeftLabel->move(182, 139); | ||
|
|
||
| QPixmap m_cutoffDotRightImg = PLUGIN_NAME::getIconPixmap("cutoffDotRight"); | ||
| m_cutoffDotRightLabel = new QLabel(this); | ||
| m_cutoffDotRightLabel->setPixmap(m_cutoffDotRightImg); | ||
| m_cutoffDotRightLabel->setAttribute(Qt::WA_TransparentForMouseEvents); | ||
| m_cutoffDotRightLabel->move(182, 139); | ||
|
|
||
| LedCheckBox * enableLFO = new LedCheckBox("", this, tr("Enable LFO"), LedCheckBox::Green); | ||
| enableLFO->setModel(&controls->m_enableLFOModel); | ||
| enableLFO->move(160, 63); | ||
|
|
||
| EqFader * outFader = new EqFader(&controls->m_outGainModel,tr("Output gain"), | ||
| this, &controls->m_outPeakL, &controls->m_outPeakR); | ||
| outFader->setMinimumHeight(84); | ||
| outFader->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); | ||
| outFader->resize(23, 84); | ||
| outFader->move(336, 33); | ||
| outFader->setDisplayConversion(false); | ||
| outFader->setHintText(tr("Gain"), "dBFS"); | ||
|
|
||
| EqFader * inFader = new EqFader(&controls->m_inGainModel,tr("Input gain"), | ||
| this, &controls->m_inPeakL, &controls->m_inPeakR); | ||
| inFader->setMinimumHeight(84); | ||
| inFader->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); | ||
| inFader->resize(23, 84); | ||
| inFader->move(13, 33); | ||
| inFader->setDisplayConversion(false); | ||
| inFader->setHintText(tr("Gain"), "dBFS"); | ||
|
|
||
| connect( gui->mainWindow(), SIGNAL( periodicUpdate() ), this, SLOT( updateSliders() ) ); | ||
| } | ||
|
|
||
|
|
||
| void PhaserControlDialog::updateSliders() | ||
| { | ||
| // Magic. Do not touch. | ||
| m_cutoffDotLeftLabel->move((int((log2(model()->m_effect->m_realCutoff[0]) - log2(PHA_MIN_FREQ)) / | ||
| log2(PHA_MAX_FREQ / PHA_MIN_FREQ) * PHA_DOT_SLIDER_LENGTH)) + 12, 139); | ||
| m_cutoffDotRightLabel->move((int((log2(model()->m_effect->m_realCutoff[1]) - log2(PHA_MIN_FREQ)) / | ||
| log2(PHA_MAX_FREQ / PHA_MIN_FREQ) * PHA_DOT_SLIDER_LENGTH)) + 12, 139); | ||
| } | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.