Skip to content

Commit

Permalink
Merge pull request #62 from jerryuhoo/develop
Browse files Browse the repository at this point in the history
Version 1.0.1
  • Loading branch information
jerryuhoo authored May 23, 2024
2 parents 725b701 + 14d42f3 commit 75656d7
Show file tree
Hide file tree
Showing 19 changed files with 482 additions and 280 deletions.
6 changes: 5 additions & 1 deletion Fire.jucer
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<JUCERPROJECT id="NykRD7" name="Fire" projectType="audioplug" pluginManufacturer="Wings"
aaxIdentifier="com.WingsDSP.Fire" bundleIdentifier="com.WingsDSP.Fire"
version="1.0.0.3" displaySplashScreen="1" pluginFormats="buildAU,buildVST3"
version="1.0.1" displaySplashScreen="1" pluginFormats="buildAU,buildVST3"
jucerFormatVersion="1" pluginAUMainType="'aufx'" pluginVST3Category="Distortion"
addUsingNamespaceToJuceHeader="0" cppLanguageStandard="17" defines="JUCE_MODAL_LOOPS_PERMITTED=1">
<MAINGROUP id="X9e8F0" name="Fire">
Expand Down Expand Up @@ -33,6 +33,10 @@
<FILE id="Cv5kLm" name="Multiband.h" compile="0" resource="0" file="Source/Panels/SpectrogramPanel/Multiband.h"/>
<FILE id="n4qez7" name="SoloButton.cpp" compile="1" resource="0" file="Source/Panels/SpectrogramPanel/SoloButton.cpp"/>
<FILE id="Pb8jAz" name="SoloButton.h" compile="0" resource="0" file="Source/Panels/SpectrogramPanel/SoloButton.h"/>
<FILE id="CeM277" name="SpectrumBackground.cpp" compile="1" resource="0"
file="Source/Panels/SpectrogramPanel/SpectrumBackground.cpp"/>
<FILE id="tuW7Zm" name="SpectrumBackground.h" compile="0" resource="0"
file="Source/Panels/SpectrogramPanel/SpectrumBackground.h"/>
<FILE id="hDi6B8" name="SpectrumComponent.cpp" compile="1" resource="0"
file="Source/Panels/SpectrogramPanel/SpectrumComponent.cpp"/>
<FILE id="DBAh4o" name="SpectrumComponent.h" compile="0" resource="0"
Expand Down
2 changes: 1 addition & 1 deletion JUCE
Submodule JUCE updated 1857 files
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Fire (Version 1.0.0) [![](https://travis-ci.com/jerryuhoo/Fire.svg?branch=master)](https://travis-ci.com/jerryuhoo/Fire) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/8c68fa4c8da04cb8abca88e2dfceb280)](https://www.codacy.com/gh/jerryuhoo/Fire/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=jerryuhoo/Fire&amp;utm_campaign=Badge_Grade)[![CMake Build Matrix](https://github.com/jerryuhoo/Fire/actions/workflows/fire.yml/badge.svg)](https://github.com/jerryuhoo/Fire/actions/workflows/fire.yml)
# Fire (Version 1.0.1) [![](https://travis-ci.com/jerryuhoo/Fire.svg?branch=master)](https://travis-ci.com/jerryuhoo/Fire) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/8c68fa4c8da04cb8abca88e2dfceb280)](https://www.codacy.com/gh/jerryuhoo/Fire/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=jerryuhoo/Fire&amp;utm_campaign=Badge_Grade)[![CMake Build Matrix](https://github.com/jerryuhoo/Fire/actions/workflows/fire.yml/badge.svg)](https://github.com/jerryuhoo/Fire/actions/workflows/fire.yml)

![Alt text](Fire1.png?raw=true "Title")

Expand Down Expand Up @@ -106,6 +106,13 @@ SoundCloud: [Wings](https://soundcloud.com/jerry-876742699)

## 6. Update Notes

### 2024-5-22 (version 1.0.1)

1. Add a button for more Drive gain (E-Extreme).
2. Fix a bug of compression settings and width settings can not be set for each band independently.
3. Add original spectrum (white).
4. Improve GUI of VU meters.

### 2022-7-29 (version 1.0.0)

1. Refactor the code of frequency lines and close buttons.
Expand Down
2 changes: 1 addition & 1 deletion Source/GUI/InterfaceDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,4 +368,4 @@
#define LIMITER_COLOUR juce::Colours::mediumpurple

// VU meters
#define SMOOTH_COEFF 0.2
#define SMOOTH_COEFF 0.5
186 changes: 93 additions & 93 deletions Source/Panels/ControlPanel/GlobalPanel.cpp

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions Source/Panels/ControlPanel/GlobalPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ class GlobalPanel : public juce::Component,
peakFreqKnob,
peakQKnob,
peakGainKnob,
limiterThreshKnob,
limiterReleaseKnob,
// limiterThreshKnob,
// limiterReleaseKnob,
mixKnob,
outputKnob;

Expand All @@ -101,12 +101,12 @@ class GlobalPanel : public juce::Component,
filterTypeLabel,
lowcutSlopeLabel,
highcutSlopeLabel,
limiterThreshLabel,
limiterReleaseLabel,
// limiterThreshLabel,
// limiterReleaseLabel,

postFilterPanelLabel,
downSamplePanelLabel,
limiterPanelLabel;
downSamplePanelLabel;
// limiterPanelLabel;

// Buttons
juce::TextButton
Expand All @@ -120,19 +120,19 @@ class GlobalPanel : public juce::Component,
// switches
juce::ToggleButton
filterSwitch,
downsampleSwitch,
limiterSwitch;
downsampleSwitch;
// limiterSwitch;

// vectors for sliders
juce::Array<juce::Component*>
filterVector,
downsampleVector,
limiterVector;
downsampleVector;
// limiterVector;

std::unique_ptr<juce::ToggleButton>
filterBypassButton,
downsampleBypassButton,
limiterBypassButton;
downsampleBypassButton;
// limiterBypassButton;

// create own knob style
OtherLookAndFeel otherLookAndFeel;
Expand All @@ -159,9 +159,9 @@ class GlobalPanel : public juce::Component,
highcutGainAttachment,
peakFreqAttachment,
peakQAttachment,
peakGainAttachment,
limiterThreshAttachment,
limiterReleaseAttachment;
peakGainAttachment;
// limiterThreshAttachment,
// limiterReleaseAttachment;

// Button attachment
std::unique_ptr<juce::AudioProcessorValueTreeState::ButtonAttachment>
Expand All @@ -173,8 +173,8 @@ class GlobalPanel : public juce::Component,
filterHighAttachment,

filterBypassAttachment,
downsampleBypassAttachment,
limiterBypassAttachment;
downsampleBypassAttachment;
// limiterBypassAttachment;

// ComboBox
juce::ComboBox
Expand Down
48 changes: 43 additions & 5 deletions Source/Panels/ControlPanel/Graph Components/VUMeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ VUMeter::VUMeter(FireAudioProcessor* inProcessor)
: mProcessor(inProcessor),
mIsInput(true),
mCh0Level(0),
mCh1Level(0)
mCh1Level(0),
mMaxCh0Level(-96.0f),
mMaxCh1Level(-96.0f),
mMaxValueDecayCounter(0)
{
setInterceptsMouseClicks(false, false);
startTimerHz(60);
}

VUMeter::~VUMeter()
Expand Down Expand Up @@ -57,6 +61,7 @@ void VUMeter::paint (juce::Graphics& g)
ch1fill = 0;
}

// draw VU meter values
g.setColour(juce::Colours::yellowgreen.withBrightness(0.9));

if (mProcessor->getTotalNumInputChannels() == 2)
Expand All @@ -69,6 +74,21 @@ void VUMeter::paint (juce::Graphics& g)
g.fillRect(meterWidth, ch0fill, meterWidth, getHeight());
}

// draw max VU meter values
g.setColour(juce::Colours::yellowgreen.withBrightness(0.5));
int maxCh0fill = getHeight() - (getHeight() * mMaxCh0Level);
int maxCh1fill = getHeight() - (getHeight() * mMaxCh1Level);

if (mProcessor->getTotalNumInputChannels() == 2)
{
g.drawLine(0, maxCh0fill, meterWidth, maxCh0fill, 2.0f);
g.drawLine(meterWidth * 2, maxCh1fill, meterWidth * 3, maxCh1fill, 2.0f);
}
else
{
g.drawLine(meterWidth, maxCh0fill, meterWidth * 2, maxCh0fill, 2.0f);
}

}

void VUMeter::resized()
Expand All @@ -79,7 +99,6 @@ void VUMeter::setParameters(bool isInput, juce::String meterName)
{
mIsInput = isInput;
mMeterName = meterName;
startTimerHz(30);
}

void VUMeter::timerCallback()
Expand All @@ -98,6 +117,10 @@ void VUMeter::timerCallback()
updatedCh1Level = mProcessor->getOutputMeterRMSLevel(1, mMeterName);
}

// update max values
mMaxCh0Level = juce::jmax(mMaxCh0Level, updatedCh0Level);
mMaxCh1Level = juce::jmax(mMaxCh1Level, updatedCh1Level);

if (updatedCh0Level > mCh0Level)
{
mCh0Level = updatedCh0Level;
Expand All @@ -119,11 +142,26 @@ void VUMeter::timerCallback()
mCh0Level = helper_denormalize(mCh0Level);
mCh1Level = helper_denormalize(mCh1Level);

// repaint if not equal to 0
if (mCh0Level && mCh1Level)
// decay max values
if (mMaxCh0Level > mCh0Level || mMaxCh1Level > mCh1Level)
{
repaint();
if (mMaxValueDecayCounter < MAX_VALUE_HOLD_FRAMES)
{
++mMaxValueDecayCounter;
}
else
{
mMaxCh0Level -= 0.01f;
mMaxCh1Level -= 0.01f;
}
}
else
{
mMaxValueDecayCounter = 0;
}

repaint();

}

float VUMeter::getLeftChannelLevel()
Expand Down
4 changes: 4 additions & 0 deletions Source/Panels/ControlPanel/Graph Components/VUMeter.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,9 @@ class VUMeter : public juce::Component, juce::Timer
juce::String mMeterName;
float mCh0Level;
float mCh1Level;
float mMaxCh0Level;
float mMaxCh1Level;
int mMaxValueDecayCounter;
const int MAX_VALUE_HOLD_FRAMES = 60;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VUMeter)
};
48 changes: 33 additions & 15 deletions Source/Panels/ControlPanel/Graph Components/VUPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,35 @@ void VUPanel::paint (juce::Graphics& g)

// draw compressor threshold line
g.setColour(KNOB_SUBFONT_COLOUR);

juce::String threshID = "";


bool isGlobal = false;
if (focusBandNum == 0)
{
vuMeterIn.setParameters(true, "Band1");
vuMeterOut.setParameters(false, "Band1");
threshID = COMP_THRESH_ID1;
compBypassID = COMP_BYPASS_ID1;
}
else if (focusBandNum == 1)
{
vuMeterIn.setParameters(true, "Band2");
vuMeterOut.setParameters(false, "Band2");
threshID = COMP_THRESH_ID2;
compBypassID = COMP_BYPASS_ID2;
}
else if (focusBandNum == 2)
{
vuMeterIn.setParameters(true, "Band3");
vuMeterOut.setParameters(false, "Band3");
threshID = COMP_THRESH_ID3;
compBypassID = COMP_BYPASS_ID3;
}
else if (focusBandNum == 3)
{
vuMeterIn.setParameters(true, "Band4");
vuMeterOut.setParameters(false, "Band4");
threshID = COMP_THRESH_ID4;
compBypassID = COMP_BYPASS_ID4;
}
else if (focusBandNum == -1)
{
Expand All @@ -77,7 +79,7 @@ void VUPanel::paint (juce::Graphics& g)
if (!isGlobal)
{
float threshValue = *(processor.treeState.getRawParameterValue(threshID));
float compressorLineY = VU_METER_Y + VU_METER_HEIGHT * -threshValue / 96.0f; // 96 is VU meter range
float compressorLineY = VU_METER_Y + VU_METER_HEIGHT * -threshValue / VU_METER_RANGE;
float pointerX;
if (processor.getTotalNumInputChannels() == 2)
{
Expand All @@ -87,19 +89,23 @@ void VUPanel::paint (juce::Graphics& g)
{
pointerX = VU_METER_X_1 + vuMeterIn.getWidth() / 3.0f;
}
g.drawLine(pointerX, compressorLineY, pointerX - getWidth() / 20, compressorLineY - getHeight() / 20, 1);
g.drawLine(pointerX - getWidth() / 20, compressorLineY - getHeight() / 20, pointerX - getWidth() / 20, compressorLineY + getHeight() / 20, 1);
g.drawLine(pointerX, compressorLineY, pointerX - getWidth() / 20, compressorLineY + getHeight() / 20, 1);

bool compBypassState = *(processor.treeState.getRawParameterValue(compBypassID));
if (compBypassState)
{
g.setColour(juce::Colours::yellowgreen);
g.drawLine(pointerX + vuMeterIn.getWidth() / 3.0f, compressorLineY, pointerX + vuMeterIn.getWidth() / 3.0f * 2.0f, compressorLineY, 1.0f);
}
}

if (mZoomState)
{
// show db meter scale text
float textX = (VU_METER_X_1 + VU_METER_X_2 - VU_METER_WIDTH) / 2.0f;
float text20Y = VU_METER_Y + 20.0f / 96.0f * VU_METER_HEIGHT;
float text40Y = VU_METER_Y + 40.0f / 96.0f * VU_METER_HEIGHT;
float text60Y = VU_METER_Y + 60.0f / 96.0f * VU_METER_HEIGHT;
float text80Y = VU_METER_Y + 80.0f / 96.0f * VU_METER_HEIGHT;
float text20Y = VU_METER_Y + 20.0f / VU_METER_RANGE * VU_METER_HEIGHT;
float text40Y = VU_METER_Y + 40.0f / VU_METER_RANGE * VU_METER_HEIGHT;
float text60Y = VU_METER_Y + 60.0f / VU_METER_RANGE * VU_METER_HEIGHT;
float text80Y = VU_METER_Y + 80.0f / VU_METER_RANGE * VU_METER_HEIGHT;
float textWidth = getWidth() / 5;
float textHeight = getHeight() / 10;
// g.drawText(" 0", textX, VU_METER_Y - textHeight / 2.0f, textWidth, textHeight, juce::Justification::centred);
Expand All @@ -111,14 +117,26 @@ void VUPanel::paint (juce::Graphics& g)

// show input/output db
g.setColour(juce::Colours::yellowgreen);
float inputValue = ((vuMeterIn.getLeftChannelLevel() + vuMeterIn.getRightChannelLevel()) / 2.0f) * 96.0f - 96.0f;
float outputValue = ((vuMeterOut.getLeftChannelLevel() + vuMeterOut.getRightChannelLevel()) / 2.0f) * 96.0f - 96.0f;
float inputValue = ((vuMeterIn.getLeftChannelLevel() + vuMeterIn.getRightChannelLevel()) / 2.0f) * VU_METER_RANGE - VU_METER_RANGE;
float outputValue = ((vuMeterOut.getLeftChannelLevel() + vuMeterOut.getRightChannelLevel()) / 2.0f) * VU_METER_RANGE - VU_METER_RANGE;

if (updateCounter == 5)
{
displayInputValue = inputValue;
displayOutputValue = outputValue;
updateCounter = 0;
}
else
{
updateCounter++;
}

juce::Rectangle<int> localBounds = getLocalBounds();
juce::Rectangle<int> leftArea = localBounds.removeFromLeft(getWidth() / 4);
juce::Rectangle<int> rightArea = localBounds.removeFromRight(getWidth() / 3);
g.setFont(juce::Font(KNOB_FONT, 20.0f * getHeight() / 150.0f, juce::Font::bold));
g.drawText(juce::String(inputValue, 1), leftArea, juce::Justification::centred);
g.drawText(juce::String(outputValue, 1), rightArea, juce::Justification::centred);
g.drawText(juce::String(displayInputValue, 1), leftArea, juce::Justification::centred);
g.drawText(juce::String(displayOutputValue, 1), rightArea, juce::Justification::centred);

g.setColour(juce::Colours::yellowgreen.withAlpha(0.5f));
g.setFont(juce::Font(KNOB_FONT, 14.0f * getHeight() / 150.0f, juce::Font::plain));
Expand Down
7 changes: 7 additions & 0 deletions Source/Panels/ControlPanel/Graph Components/VUPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ class VUPanel : public GraphTemplate, juce::Timer
private:
FireAudioProcessor &processor;
int focusBandNum;
const float VU_METER_RANGE = 96.0f;
VUMeter vuMeterIn;
VUMeter vuMeterOut;
// for smoothing meter values
int updateCounter = 0;
float displayInputValue = 0.0f;
float displayOutputValue = 0.0f;
juce::String threshID = "";
juce::String compBypassID = "";
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (VUPanel)
};
2 changes: 1 addition & 1 deletion Source/Panels/SpectrogramPanel/Multiband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ void Multiband::setMasks (juce::Graphics& g, int index, int lineNumLimit, int x,
// set focus mask
if (lineNum > lineNumLimit && focusIndex == index)
{
juce::ColourGradient grad (COLOUR5.withAlpha (0.2f), 0, 0, COLOUR1.withAlpha (0.2f), getLocalBounds().getWidth(), 0, false);
juce::ColourGradient grad(COLOUR5.withAlpha(0.2f), 0, getLocalBounds().getHeight(), COLOUR1.withAlpha(0.0f), 0, getLocalBounds().getHeight() / 10.0f * 9.0f, false);
g.setGradientFill (grad);
g.fillRect (x, y, width, height);
}
Expand Down
Loading

0 comments on commit 75656d7

Please sign in to comment.