Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion NeuralAmpModeler/NeuralAmpModeler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ void NeuralAmpModeler::ProcessBlock(iplug::sample** inputs, iplug::sample** outp

if (mModel != nullptr)
{
mModel->process(triggerOutput[0], mOutputPointers[0], nFrames);
mModel->process(triggerOutput, mOutputPointers, nFrames);
}
else
{
Expand Down Expand Up @@ -693,6 +693,18 @@ std::string NeuralAmpModeler::_StageModel(const WDL_String& modelPath)
{
auto dspPath = std::filesystem::u8path(modelPath.Get());
std::unique_ptr<nam::DSP> model = nam::get_dsp(dspPath);

// Check that the model has 1 input and 1 output channel
if (model->NumInputChannels() != 1)
{
throw std::runtime_error("Model must have 1 input channel, but has " + std::to_string(model->NumInputChannels()));
}
if (model->NumOutputChannels() != 1)
{
throw std::runtime_error("Model must have 1 output channel, but has "
+ std::to_string(model->NumOutputChannels()));
}

std::unique_ptr<ResamplingNAM> temp = std::make_unique<ResamplingNAM>(std::move(model), GetSampleRate());
temp->Reset(GetSampleRate(), GetBlockSize());
mStagedModel = std::move(temp);
Expand Down
8 changes: 4 additions & 4 deletions NeuralAmpModeler/NeuralAmpModeler.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ class ResamplingNAM : public nam::DSP
public:
// Resampling wrapper around the NAM models
ResamplingNAM(std::unique_ptr<nam::DSP> encapsulated, const double expected_sample_rate)
: nam::DSP(expected_sample_rate)
: nam::DSP(encapsulated->NumInputChannels(), encapsulated->NumOutputChannels(), expected_sample_rate)
, mEncapsulated(std::move(encapsulated))
, mResampler(GetNAMSampleRate(mEncapsulated))
{
// Assign the encapsulated object's processing function to this object's member so that the resampler can use it:
auto ProcessBlockFunc = [&](NAM_SAMPLE** input, NAM_SAMPLE** output, int numFrames) {
mEncapsulated->process(input[0], output[0], numFrames);
mEncapsulated->process(input, output, numFrames);
};
mBlockProcessFunc = ProcessBlockFunc;

Expand Down Expand Up @@ -133,7 +133,7 @@ class ResamplingNAM : public nam::DSP

void prewarm() override { mEncapsulated->prewarm(); };

void process(NAM_SAMPLE* input, NAM_SAMPLE* output, const int num_frames) override
void process(NAM_SAMPLE** input, NAM_SAMPLE** output, const int num_frames) override
{
if (num_frames > mMaxExternalBlockSize)
// We can afford to be careful
Expand All @@ -145,7 +145,7 @@ class ResamplingNAM : public nam::DSP
}
else
{
mResampler.ProcessBlock(&input, &output, num_frames, mBlockProcessFunc);
mResampler.ProcessBlock(input, output, num_frames, mBlockProcessFunc);
}
};

Expand Down
2 changes: 1 addition & 1 deletion NeuralAmpModeler/config/NeuralAmpModeler-mac.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ EXTRA_LNK_FLAGS = -framework Accelerate -framework Metal -framework MetalKit //

//------------------------------
// PREPROCESSOR MACROS
EXTRA_ALL_DEFS = OBJC_PREFIX=vNeuralAmpModeler SWELL_APP_PREFIX=Swell_vNeuralAmpModeler IGRAPHICS_NANOVG IGRAPHICS_METAL GRAYED_ALPHA=0.5f
EXTRA_ALL_DEFS = OBJC_PREFIX=vNeuralAmpModeler SWELL_APP_PREFIX=Swell_vNeuralAmpModeler IGRAPHICS_NANOVG IGRAPHICS_METAL GRAYED_ALPHA=0.5f NAM_ENABLE_A2_FAST
//EXTRA_DEBUG_DEFS =
//EXTRA_RELEASE_DEFS =
//EXTRA_TRACER_DEFS =
Expand Down
4 changes: 2 additions & 2 deletions NeuralAmpModeler/config/NeuralAmpModeler-win.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup Label="UserMacros">
<IPLUG2_ROOT>$(ProjectDir)..\..\iPlug2</IPLUG2_ROOT>
<BINARY_NAME>NeuralAmpModeler</BINARY_NAME>
<EXTRA_ALL_DEFS>IGRAPHICS_NANOVG;IGRAPHICS_GL2;GRAYED_ALPHA=0.5f</EXTRA_ALL_DEFS>
<EXTRA_ALL_DEFS>IGRAPHICS_NANOVG;IGRAPHICS_GL2;GRAYED_ALPHA=0.5f;NAM_ENABLE_A2_FAST</EXTRA_ALL_DEFS>
<EXTRA_DEBUG_DEFS />
<EXTRA_RELEASE_DEFS />
<EXTRA_TRACER_DEFS />
Expand All @@ -27,7 +27,7 @@
<ProgramDatabaseFile>$(PDB_FILE)</ProgramDatabaseFile>
</Link>
<PostBuildEvent>
<Command>CALL "$(SolutionDir)scripts\postbuild-win.bat" "$(TargetExt)" "$(BINARY_NAME)" "$(Platform)" "$(COPY_VST2)" "$(TargetPath)" "$(VST2_32_PATH)" "$(VST2_64_PATH)" "$(VST3_32_PATH)" "$(VST3_64_PATH)" "$(AAX_32_PATH)" "$(AAX_64_PATH)" "$(BUILD_DIR)" "$(VST_ICON)" "$(AAX_ICON)" "$(CREATE_BUNDLE_SCRIPT)"</Command>
<Command>CALL "$(SolutionDir)scripts\postbuild-win.bat" "$(TargetExt)" "$(BINARY_NAME)" "$(Platform)" "$(TargetPath)" "$(VST3_32_PATH)" "$(VST3_64_PATH)" "$(AAX_32_PATH)" "$(AAX_64_PATH)" "$(BUILD_DIR)" "$(VST_ICON)" "$(AAX_ICON)" "$(CREATE_BUNDLE_SCRIPT)"</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>CALL "$(SolutionDir)scripts\prebuild-win.bat" "$(TargetExt)" "$(BINARY_NAME)" "$(Platform)" "$(TargetPath)" "$(OutDir)"</Command>
Expand Down
1,122 changes: 567 additions & 555 deletions NeuralAmpModeler/projects/NeuralAmpModeler-aax.vcxproj

Large diffs are not rendered by default.

870 changes: 441 additions & 429 deletions NeuralAmpModeler/projects/NeuralAmpModeler-app.vcxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,23 @@
4FBDC95B29FFF143004FF203 /* convnet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FBDC94229FFF143004FF203 /* convnet.h */; };
4FBDC95C29FFF143004FF203 /* lstm.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FBDC94329FFF143004FF203 /* lstm.h */; };
4FBDC95D29FFF143004FF203 /* convnet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FBDC94429FFF143004FF203 /* convnet.cpp */; };
4FBDC95E29FFF143004FF203 /* wavenet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FBDC94529FFF143004FF203 /* wavenet.h */; };
4FBDC95E29FFF143004FF203 /* model.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FBDC94529FFF143004FF203 /* model.h */; };
4FBDC95F29FFF143004FF203 /* lstm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FBDC94629FFF143004FF203 /* lstm.cpp */; };
4FBDC96029FFF143004FF203 /* util.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FBDC94729FFF143004FF203 /* util.h */; };
4FBDC96129FFF143004FF203 /* dsp.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FBDC94829FFF143004FF203 /* dsp.h */; };
4FBDC96229FFF143004FF203 /* activations.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FBDC94929FFF143004FF203 /* activations.h */; };
4FBDC96329FFF143004FF203 /* activations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FBDC94A29FFF143004FF203 /* activations.cpp */; };
4FBDC96429FFF143004FF203 /* wavenet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FBDC94B29FFF143004FF203 /* wavenet.cpp */; };
4FBDC96429FFF143004FF203 /* model.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FBDC94B29FFF143004FF203 /* model.cpp */; };
4FBDC98029FFF143004FF203 /* slimmable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FBDC97E29FFF143004FF203 /* slimmable.cpp */; };
4FBDC98129FFF143004FF203 /* container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FBDC97F29FFF143004FF203 /* container.cpp */; };
4FBDC96529FFF143004FF203 /* get_dsp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FBDC94C29FFF143004FF203 /* get_dsp.cpp */; };
4FBDC97729FFF143004FF203 /* conv1d.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FBDC97029FFF143004FF203 /* conv1d.cpp */; };
4FBDC97829FFF143004FF203 /* conv1d.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FBDC97129FFF143004FF203 /* conv1d.h */; };
4FBDC97929FFF143004FF203 /* ring_buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4FBDC97229FFF143004FF203 /* ring_buffer.cpp */; };
4FBDC97A29FFF143004FF203 /* ring_buffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FBDC97329FFF143004FF203 /* ring_buffer.h */; };
4FBDC97B29FFF143004FF203 /* film.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FBDC97429FFF143004FF203 /* film.h */; };
4FBDC97C29FFF143004FF203 /* gating_activations.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FBDC97529FFF143004FF203 /* gating_activations.h */; };
4FBDC97D29FFF143004FF203 /* registry.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FBDC97629FFF143004FF203 /* registry.h */; };
4FC69835293BA47F0076EC33 /* NeuralAmpModelerAU.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4FC6982F293BA47F0076EC33 /* NeuralAmpModelerAU.framework */; };
4FC69836293BA47F0076EC33 /* NeuralAmpModelerAU.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 4FC6982F293BA47F0076EC33 /* NeuralAmpModelerAU.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4FC6983A293BA4F10076EC33 /* NeuralAmpModelerAU.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FA61F7B22E89A5900A92C58 /* NeuralAmpModelerAU.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -280,13 +289,22 @@
4FBDC94229FFF143004FF203 /* convnet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = convnet.h; sourceTree = "<group>"; };
4FBDC94329FFF143004FF203 /* lstm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lstm.h; sourceTree = "<group>"; };
4FBDC94429FFF143004FF203 /* convnet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = convnet.cpp; sourceTree = "<group>"; };
4FBDC94529FFF143004FF203 /* wavenet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wavenet.h; sourceTree = "<group>"; };
4FBDC94529FFF143004FF203 /* model.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wavenet/model.h; sourceTree = "<group>"; };
4FBDC94629FFF143004FF203 /* lstm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lstm.cpp; sourceTree = "<group>"; };
4FBDC97029FFF143004FF203 /* conv1d.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = conv1d.cpp; sourceTree = "<group>"; };
4FBDC97129FFF143004FF203 /* conv1d.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conv1d.h; sourceTree = "<group>"; };
4FBDC97229FFF143004FF203 /* ring_buffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ring_buffer.cpp; sourceTree = "<group>"; };
4FBDC97329FFF143004FF203 /* ring_buffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ring_buffer.h; sourceTree = "<group>"; };
4FBDC97429FFF143004FF203 /* film.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = film.h; sourceTree = "<group>"; };
4FBDC97529FFF143004FF203 /* gating_activations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gating_activations.h; sourceTree = "<group>"; };
4FBDC97629FFF143004FF203 /* registry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = registry.h; sourceTree = "<group>"; };
4FBDC94729FFF143004FF203 /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = util.h; sourceTree = "<group>"; };
4FBDC94829FFF143004FF203 /* dsp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dsp.h; sourceTree = "<group>"; };
4FBDC94929FFF143004FF203 /* activations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = activations.h; sourceTree = "<group>"; };
4FBDC94A29FFF143004FF203 /* activations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = activations.cpp; sourceTree = "<group>"; };
4FBDC94B29FFF143004FF203 /* wavenet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wavenet.cpp; sourceTree = "<group>"; };
4FBDC94B29FFF143004FF203 /* model.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wavenet/model.cpp; sourceTree = "<group>"; };
4FBDC97E29FFF143004FF203 /* slimmable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wavenet/slimmable.cpp; sourceTree = "<group>"; };
4FBDC97F29FFF143004FF203 /* container.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = container.cpp; sourceTree = "<group>"; };
4FBDC94C29FFF143004FF203 /* get_dsp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = get_dsp.cpp; sourceTree = "<group>"; };
4FC46E58231440C8000045E7 /* web */ = {isa = PBXFileReference; lastKnownFileType = folder; name = web; path = ../resources/web; sourceTree = "<group>"; };
4FC6982F293BA47F0076EC33 /* NeuralAmpModelerAU.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NeuralAmpModelerAU.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -670,8 +688,17 @@
4FBDC93F29FFF143004FF203 /* util.cpp */,
4FBDC94729FFF143004FF203 /* util.h */,
4FBDC94029FFF143004FF203 /* version.h */,
4FBDC94B29FFF143004FF203 /* wavenet.cpp */,
4FBDC94529FFF143004FF203 /* wavenet.h */,
4FBDC94B29FFF143004FF203 /* model.cpp */,
4FBDC97E29FFF143004FF203 /* slimmable.cpp */,
4FBDC97F29FFF143004FF203 /* container.cpp */,
4FBDC94529FFF143004FF203 /* model.h */,
4FBDC97029FFF143004FF203 /* conv1d.cpp */,
4FBDC97129FFF143004FF203 /* conv1d.h */,
4FBDC97229FFF143004FF203 /* ring_buffer.cpp */,
4FBDC97329FFF143004FF203 /* ring_buffer.h */,
4FBDC97429FFF143004FF203 /* film.h */,
4FBDC97529FFF143004FF203 /* gating_activations.h */,
4FBDC97629FFF143004FF203 /* registry.h */,
);
name = NAM;
path = ../../NeuralAmpModelerCore/NAM;
Expand Down Expand Up @@ -832,7 +859,12 @@
4FBDC94D29FFF143004FF203 /* Resample.h in Headers */,
4FC6983A293BA4F10076EC33 /* NeuralAmpModelerAU.h in Headers */,
4FBDC95629FFF143004FF203 /* dsp.h in Headers */,
4FBDC95E29FFF143004FF203 /* wavenet.h in Headers */,
4FBDC95E29FFF143004FF203 /* model.h in Headers */,
4FBDC97829FFF143004FF203 /* conv1d.h in Headers */,
4FBDC97A29FFF143004FF203 /* ring_buffer.h in Headers */,
4FBDC97B29FFF143004FF203 /* film.h in Headers */,
4FBDC97C29FFF143004FF203 /* gating_activations.h in Headers */,
4FBDC97D29FFF143004FF203 /* registry.h in Headers */,
4FC6983B293BA5020076EC33 /* IPlugAUAudioUnit.h in Headers */,
AA7C860B2B43A42F00B5FB3A /* ResamplingContainer.h in Headers */,
AA341E2B2B9E5A650069C260 /* ToneStack.h in Headers */,
Expand Down Expand Up @@ -1058,7 +1090,11 @@
4FBDC94E29FFF143004FF203 /* RecursiveLinearFilter.cpp in Sources */,
4FBDC95829FFF143004FF203 /* util.cpp in Sources */,
4FC69849293BA5F90076EC33 /* ITextEntryControl.cpp in Sources */,
4FBDC96429FFF143004FF203 /* wavenet.cpp in Sources */,
4FBDC96429FFF143004FF203 /* model.cpp in Sources */,
4FBDC98029FFF143004FF203 /* slimmable.cpp in Sources */,
4FBDC98129FFF143004FF203 /* container.cpp in Sources */,
4FBDC97729FFF143004FF203 /* conv1d.cpp in Sources */,
4FBDC97929FFF143004FF203 /* ring_buffer.cpp in Sources */,
4FC6984C293BA6010076EC33 /* IGraphicsCoreText.mm in Sources */,
4FC6984F293BA6420076EC33 /* IControl.cpp in Sources */,
4FC69848293BA5F90076EC33 /* IControls.cpp in Sources */,
Expand Down
Loading
Loading