AnalogTapeModel

Physical modelling signal processing for analog tape recording
Log | Files | Refs | Submodules | README | LICENSE

commit 48675dda6ab2288c9dcfe8caf2b60bb5b3ad1e57
parent 0d272640d2a42964350762784e4643236e22fd35
Author: jatinchowdhury18 <jatinchowdhury18@gmail.com>
Date:   Wed,  3 Jun 2020 16:10:07 -0700

2.3 bug fixes (#38)

* Fix state loading bug

* Update GUI magic submodule

* Fix state loading (take 2)

* Updated Windows builds

* Add Catalina link to readme

Co-authored-by: jatinchowdhury18 <jatinchowdhury18@users.noreply.github.com>
Diffstat:
MPlugin/CHOWTapeModel.jucer | 2+-
MPlugin/Source/PluginProcessor.cpp | 14+++++++++++---
MPlugin/Source/Presets/PresetManager.cpp | 10++++++++--
MPlugin/Source/Presets/PresetManager.h | 2+-
MREADME.md | 2++
5 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/Plugin/CHOWTapeModel.jucer b/Plugin/CHOWTapeModel.jucer @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <JUCERPROJECT id="jDoXPz" name="CHOWTapeModel" projectType="audioplug" jucerVersion="5.4.7" - version="2.3.0" pluginFormats="buildAU,buildStandalone,buildVST,buildVST3" + version="2.3.1" pluginFormats="buildAU,buildStandalone,buildVST,buildVST3" cppLanguageStandard="17" companyName="chowdsp" companyEmail="chowdsp@gmail.com" defines="SAVE_PRESETS=0" pluginManufacturerCode="Chow"> <MAINGROUP id="pXbPvR" name="CHOWTapeModel"> diff --git a/Plugin/Source/PluginProcessor.cpp b/Plugin/Source/PluginProcessor.cpp @@ -45,7 +45,7 @@ AudioProcessorValueTreeState::ParameterLayout ChowtapeModelAudioProcessor::creat params.push_back (std::make_unique<AudioParameterFloat> ("ingain", "Input Gain [dB]", -30.0f, 6.0f, 0.0f)); params.push_back (std::make_unique<AudioParameterFloat> ("outgain", "Output Gain [dB]", -30.0f, 30.0f, 0.0f)); params.push_back (std::make_unique<AudioParameterFloat> ("drywet", "Dry/Wet", 0.0f, 100.0f, 100.0f)); - params.push_back (std::make_unique<AudioParameterInt> ("preset", "Preset", 0, 1, 0)); + params.push_back (std::make_unique<AudioParameterInt> ("preset", "Preset", 0, 10, 0)); HysteresisProcessor::createParameterLayout (params); LossFilter::createParameterLayout (params); @@ -106,8 +106,16 @@ int ChowtapeModelAudioProcessor::getCurrentProgram() void ChowtapeModelAudioProcessor::setCurrentProgram (int index) { - *vts.getRawParameterValue ("preset") = (float) index; - presetManager.setPreset (vts, index); + auto& presetParam = *vts.getRawParameterValue ("preset"); + if ((int) presetParam == index) + return; + + if (presetManager.setPreset (vts, index)) + { + presetParam = (float) index; + presetManager.presetUpdated(); + updateHostDisplay(); + } } const String ChowtapeModelAudioProcessor::getProgramName (int index) diff --git a/Plugin/Source/Presets/PresetManager.cpp b/Plugin/Source/Presets/PresetManager.cpp @@ -168,11 +168,17 @@ String PresetManager::getPresetName (int idx) return presetMap[idx]->name; } -void PresetManager::setPreset (AudioProcessorValueTreeState& vts, int idx) +bool PresetManager::setPreset (AudioProcessorValueTreeState& vts, int idx) { - jassert (isPositiveAndBelow (idx, presets.size())); + if (! isPositiveAndBelow (idx, presets.size())) // invalid index + { + jassertfalse; + return false; + } + auto newState = presetMap[idx]->state.createCopy(); vts.replaceState (newState); + return true; } void PresetManager::registerPresetsComponent (foleys::MagicGUIBuilder& builder, AudioProcessor* proc) diff --git a/Plugin/Source/Presets/PresetManager.h b/Plugin/Source/Presets/PresetManager.h @@ -23,7 +23,7 @@ public: int getNumPresets() const { return presets.size(); } String getPresetName (int idx); - void setPreset (AudioProcessorValueTreeState& vts, int idx); + bool setPreset (AudioProcessorValueTreeState& vts, int idx); void registerPresetsComponent (foleys::MagicGUIBuilder&, AudioProcessor* proc); void presetUpdated() { listeners.call (&Listener::presetUpdated); } diff --git a/README.md b/README.md @@ -35,6 +35,8 @@ CHOW Tape is currently available in the following formats: ## Instructions For Building If you would like to try the most recent builds (potentially unstable), see [here](https://github.com/jatinchowdhury18/AnalogTapeModel/tree/master/Plugin/Bin). +If you need a build that is compatible with Mac OS Catalina, try +[this link](https://www.dropbox.com/s/n14b1ju8kofp71v/CHOWTape.zip). If you would like to build CHOW for yourself, use the following steps. - Install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)