Skip to content

Commit

Permalink
Merge branch 'main' into nam_toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
sdatkinson authored Nov 17, 2024
2 parents 1ad68ff + dd3ad7a commit bce4a6b
Show file tree
Hide file tree
Showing 28 changed files with 307 additions and 93 deletions.
27 changes: 18 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,39 @@ assignees: ''

**Thanks for taking the time to write a bug report!** Use the following prompts to help you describe what's going on. The more info you provide, the easier it'll be to understand how to fix it for you without having to come back and ask you questions.

**Describe the bug**
A clear and concise description of what the bug is.
## Before you make a new bug report:
- [ ] Have you searched the Issues to see if your problem has already been reported? If it has, please follow that Issue instead of opening a duplicate!
- [ ] Have you checked the [Rough edges](https://github.com/sdatkinson/NeuralAmpModelerPlugin/tree/main?tab=readme-ov-file#rough-edges) for help?

**To Reproduce**
## Description
Provide a clear and concise description of what the bug is.

## To reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.
## Expected behavior
Provide a clear and concise description of what you expected to happen.

**Screenshots**
## Screenshots
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
## Computer & other info
**(please provide the following information):**
- OS [e.g. Windows 10, macOS 10.15]
- Plugin version [e.g. 0.6.1]
- Onboard graphics & version
- Plugin version [e.g. 0.7.10]
- Standalone, VST3, or AU
- DAW (if applicable)
- Audio interface [e.g. Focusrite Scarlett Solo 3rd Gen]
- Sample rate [e.g. 44.1 kHz]
- Buffer size [e.g. 256 samples]
- Provide a model that the bug happens with (_except_ if the bug happens _without_ a model loaded)
- Provide an IR that the bug happens with (_except_ if the bug happens _without_ an IR loaded)
- **Does the bug _not_ happen under some other conditions?** If you can find what _one_ thing makes the difference between the bug appearing and not, this _drastically_ improves the chances I can fix it.

**Additional context**
## Additional context
Add any other context about the problem here.
14 changes: 14 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**Thanks for making a Pull Request!**
Please fill out this template so that you can be sure that your PR does everything it needs to be accepted.

## Description
What does your PR do?
Include [Closing words](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue) to link this PR to the Issue(s) that it relates to.

## PR Checklist
- [ ] Does the VST3 plugin pass all of the unit tests in the [VST3PluginTestHost](https://steinbergmedia.github.io/vst3_dev_portal/pages/What+is+the+VST+3+SDK/Plug-in+Test+Host.html)? (Download it as part of the VST3 SDK [here](https://www.steinberg.net/developers/).)
- [ ] Windows
- [ ] macOS
- [ ] Does your PR add, remove, or rename any plugin parameters?
- [ ] If yes, then have you ensured that older versions of the plug-in load correctly? (Usually, this means writing a new legacy unserialization function like [`_UnserializeStateLegacy_0_7_9`](https://github.com/sdatkinson/NeuralAmpModelerPlugin/blob/f755918e3f325f28658700ca954f8a47ec58d021/NeuralAmpModeler/NeuralAmpModeler.cpp#L823).)

32 changes: 26 additions & 6 deletions NeuralAmpModeler/NeuralAmpModeler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "Colors.h"
#include "NeuralAmpModelerCore/NAM/activations.h"
#include "NeuralAmpModelerCore/NAM/get_dsp.h"
// clang-format off
// These includes need to happen in this order or else the latter won't know
// a bunch of stuff.
Expand Down Expand Up @@ -164,7 +165,7 @@ NeuralAmpModeler::NeuralAmpModeler(const InstanceInfo& info)
const auto outputMeterArea = contentArea.GetFromRight(30).GetHShifted(20).GetMidVPadded(100).GetVShifted(-25);

// Misc Areas
const auto settingsButtonArea = mainArea.GetFromTRHC(50, 50).GetCentredInside(20, 20);
const auto settingsButtonArea = CornerButtonArea(b);

// Model loader button
auto loadModelCompletionHandler = [&](const WDL_String& fileName, const WDL_String& path) {
Expand Down Expand Up @@ -246,11 +247,12 @@ NeuralAmpModeler::NeuralAmpModeler(const InstanceInfo& info)
pGraphics->AttachControl(new NAMCircleButtonControl(
settingsButtonArea,
[pGraphics](IControl* pCaller) {
pGraphics->GetControlWithTag(kCtrlTagSettingsBox)->As<NAMAboutBoxControl>()->HideAnimated(false);
pGraphics->GetControlWithTag(kCtrlTagSettingsBox)->As<NAMSettingsPageControl>()->HideAnimated(false);
},
gearSVG));

pGraphics->AttachControl(new NAMAboutBoxControl(b, backgroundBitmap, style), kCtrlTagSettingsBox)->Hide(true);
pGraphics->AttachControl(new NAMSettingsPageControl(b, backgroundBitmap, crossSVG, style), kCtrlTagSettingsBox)
->Hide(true);

pGraphics->ForAllControlsFunc([](IControl* pControl) {
pControl->SetMouseEventsWhenDisabled(true);
Expand Down Expand Up @@ -390,9 +392,21 @@ void NeuralAmpModeler::OnIdle()
{
pGraphics->GetControlWithTag(kCtrlTagOutNorm)
->SetDisabled(!mModel->HasLoudness() || !GetParam(kNamToggle)->Value());
ModelInfo modelInfo;
modelInfo.sampleRate = mModel->GetEncapsulatedSampleRate();
modelInfo.knownSampleRate = true;
static_cast<NAMSettingsPageControl*>(pGraphics->GetControlWithTag(kCtrlTagSettingsBox))->SetModelInfo(modelInfo);
mNewModelLoadedInDSP = false;
}
}
if (mModelCleared)
{
if (auto* pGraphics = GetUI())
{
pGraphics->GetControlWithTag(kCtrlTagOutNorm)->SetDisabled(false);
static_cast<NAMSettingsPageControl*>(pGraphics->GetControlWithTag(kCtrlTagSettingsBox))->ClearModelInfo();
mModelCleared = false;
}

mNewModelLoadedInDSP = false;
}
}

Expand Down Expand Up @@ -559,6 +573,7 @@ void NeuralAmpModeler::_ApplyDSPStaging()
mModel = nullptr;
mNAMPath.Set("");
mShouldRemoveModel = false;
mModelCleared = true;
_UpdateLatency();
}
if (mShouldRemoveIR)
Expand Down Expand Up @@ -913,7 +928,12 @@ void NeuralAmpModeler::_UpdateLatency()
latency += mModel->GetLatency();
}
// Other things that add latency here...
SetLatency(latency);

// Feels weird to have to do this.
if (GetLatency() != latency)
{
SetLatency(latency);
}
}

void NeuralAmpModeler::_UpdateMeters(sample** inputPointer, sample** outputPointer, const size_t nFrames,
Expand Down
1 change: 1 addition & 0 deletions NeuralAmpModeler/NeuralAmpModeler.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ class NeuralAmpModeler final : public iplug::Plugin
std::atomic<bool> mShouldRemoveIR = false;

std::atomic<bool> mNewModelLoadedInDSP = false;
std::atomic<bool> mModelCleared = false;

// Tone stack modules
std::unique_ptr<dsp::tone_stack::AbstractToneStack> mToneStack;
Expand Down
Loading

0 comments on commit bce4a6b

Please sign in to comment.