AnalogTapeModel

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

commit efd27aebc809343989b1def831c24fefd3edf208
parent eb05465de9630c65f2580816ad5c531d359642fe
Author: jatinchowdhury18 <[email protected]>
Date:   Tue, 29 Sep 2020 08:57:03 -0700

Prep for release 2.6 (#89)

* Prep for release 2.6

* Make Listener destructor virtual

* Update Mac builds

Co-authored-by: jatinchowdhury18 <[email protected]>
Co-authored-by: Travis CI <[email protected]>
Diffstat:
MCHANGELOG.md | 2+-
MPlugin/CHOWTapeModel.jucer | 10+++++-----
MPlugin/Source/MixGroups/MixGroupsController.h | 2+-
DPlugin/Source/MixGroups/MixGroupsParamReceiver.cpp | 64----------------------------------------------------------------
DPlugin/Source/MixGroups/MixGroupsParamReceiver.h | 46----------------------------------------------
APlugin/Source/MixGroups/MixGroupsSharedData.cpp | 64++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
APlugin/Source/MixGroups/MixGroupsSharedData.h | 46++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 117 insertions(+), 117 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## [Unreleased] +## [2.6.0] - 2020-09-29 - Added Pre/post emphasis filters for the hysteresis stage. - Added "mix groups" to allow instances of the plugin to be synced across a mix. - Added Chew variance parameter to control the randomness of the chew dropouts. diff --git a/Plugin/CHOWTapeModel.jucer b/Plugin/CHOWTapeModel.jucer @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<JUCERPROJECT id="jDoXPz" name="CHOWTapeModel" projectType="audioplug" version="2.5.99" +<JUCERPROJECT id="jDoXPz" name="CHOWTapeModel" projectType="audioplug" version="2.6.0" pluginFormats="buildAU,buildStandalone,buildVST,buildVST3" cppLanguageStandard="17" companyName="chowdsp" companyEmail="[email protected]" defines="SAVE_PRESETS=0" pluginManufacturerCode="Chow" reportAppUsage="0" jucerFormatVersion="1"> @@ -36,10 +36,10 @@ file="Source/MixGroups/MixGroupsController.cpp"/> <FILE id="vwS6BX" name="MixGroupsController.h" compile="0" resource="0" file="Source/MixGroups/MixGroupsController.h"/> - <FILE id="yc5D3k" name="MixGroupsParamReceiver.cpp" compile="1" resource="0" - file="Source/MixGroups/MixGroupsParamReceiver.cpp"/> - <FILE id="hGI0mn" name="MixGroupsParamReceiver.h" compile="0" resource="0" - file="Source/MixGroups/MixGroupsParamReceiver.h"/> + <FILE id="yc5D3k" name="MixGroupsSharedData.cpp" compile="1" resource="0" + file="Source/MixGroups/MixGroupsSharedData.cpp"/> + <FILE id="hGI0mn" name="MixGroupsSharedData.h" compile="0" resource="0" + file="Source/MixGroups/MixGroupsSharedData.h"/> </GROUP> <GROUP id="{71C1FCA8-E7B0-3B66-1340-F140C452FF6F}" name="Presets"> <GROUP id="{AB6F221D-98B5-9782-2241-321BA5DFB83C}" name="PresetConfigs"> diff --git a/Plugin/Source/MixGroups/MixGroupsController.h b/Plugin/Source/MixGroups/MixGroupsController.h @@ -1,7 +1,7 @@ #ifndef MIXGROUPSCONTROLLER_H_INCLUDED #define MIXGROUPSCONTROLLER_H_INCLUDED -#include "MixGroupsParamReceiver.h" +#include "MixGroupsSharedData.h" namespace MixGroupsConstants { diff --git a/Plugin/Source/MixGroups/MixGroupsParamReceiver.cpp b/Plugin/Source/MixGroups/MixGroupsParamReceiver.cpp @@ -1,64 +0,0 @@ -#include "MixGroupsParamReceiver.h" -#include "MixGroupsController.h" - -MixGroupsSharedData::MixGroupsSharedData() -{ - for (int i = 0; i < MixGroupsConstants::numMixGroups; ++i) - pluginsInGroup.add (std::make_unique<StringArray>()); -} - -void MixGroupsSharedData::loadParameterList (Array<String>& paramList) -{ - if (! paramMaps.empty()) // already loaded - return; - - for (int i = 0; i < MixGroupsConstants::numMixGroups; ++i) - { - auto paramMap = std::make_unique<ParamMap>(); - - for (const auto& paramID : paramList) - paramMap->set (paramID, 0.0f); - - paramMaps.push_back(std::move (paramMap)); - } -} - -void MixGroupsSharedData::pluginGroupChanged (const String& pluginID, int mixGroup) -{ - // remove plugin from any group it's currently in - for (auto& group : pluginsInGroup) - group->removeString (pluginID); - - if (mixGroup == 0) - return; - - // add plugin to new group - pluginsInGroup[mixGroup - 1]->addIfNotAlreadyThere (pluginID); -} - -int MixGroupsSharedData::getNumPluginsInGroup (int mixGroup) const -{ - return pluginsInGroup[mixGroup - 1]->size(); -} - -void MixGroupsSharedData::copyPluginState (int mixGroup, AudioProcessorValueTreeState& vts) -{ - auto paramMap = paramMaps[mixGroup - 1].get(); - auto mapIter = paramMap->begin(); - while (mapIter.next()) - { - const auto param = vts.getRawParameterValue (mapIter.getKey()); - paramMap->set (mapIter.getKey(), param->load()); - } -} - -void MixGroupsSharedData::setParameter (const String& paramID, int mixGroup, float value, String uuid) -{ - paramMaps[mixGroup - 1]->set (paramID, value); - listeners.call (&Listener::mixGroupParamChanged, paramID, mixGroup, value, uuid); -} - -float MixGroupsSharedData::getParameter (const String& paramID, int mixGroup) const -{ - return paramMaps[mixGroup - 1]->operator[] (paramID); -} diff --git a/Plugin/Source/MixGroups/MixGroupsParamReceiver.h b/Plugin/Source/MixGroups/MixGroupsParamReceiver.h @@ -1,46 +0,0 @@ -#ifndef MIXGROUPSPARAMRECEIVER -#define MIXGROUPSPARAMRECEIVER - -#include <JuceHeader.h> - -class MixGroupsSharedData -{ -public: - MixGroupsSharedData(); - - /** Create parameter maps from list of parameters */ - void loadParameterList (Array<String>& paramList); - - /** A plugin has changed mix group. */ - void pluginGroupChanged (const String& pluginID, int mixGroup); - - /** Get the number of plugins already in this mix group */ - int getNumPluginsInGroup (int mixGroup) const; - - /** Copy the plugin state into the parameter map for a given mix group */ - void copyPluginState (int mixGroup, AudioProcessorValueTreeState& vts); - - void setParameter (const String& paramID, int mixGroup, float value, String uuid); - float getParameter (const String& paramID, int mixGroup) const; - - struct Listener - { - ~Listener() {} - virtual void mixGroupParamChanged (const String& /*paramID*/, int /*mixGroup*/, float /*value*/, String /*uuid*/) {} - }; - - void addListener (Listener* l) { listeners.add (l); } - void removeListener (Listener* l) { listeners.remove (l); } - -private: - using ParamMap = HashMap<String, float>; - std::vector<std::unique_ptr<ParamMap>> paramMaps; - - OwnedArray<StringArray> pluginsInGroup; // list of plugin IDs of all the plugins in each mix group - - ListenerList<Listener> listeners; - - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MixGroupsSharedData) -}; - -#endif // MIXGROUPSPARAMRECEIVER diff --git a/Plugin/Source/MixGroups/MixGroupsSharedData.cpp b/Plugin/Source/MixGroups/MixGroupsSharedData.cpp @@ -0,0 +1,64 @@ +#include "MixGroupsSharedData.h" +#include "MixGroupsController.h" + +MixGroupsSharedData::MixGroupsSharedData() +{ + for (int i = 0; i < MixGroupsConstants::numMixGroups; ++i) + pluginsInGroup.add (std::make_unique<StringArray>()); +} + +void MixGroupsSharedData::loadParameterList (Array<String>& paramList) +{ + if (! paramMaps.empty()) // already loaded + return; + + for (int i = 0; i < MixGroupsConstants::numMixGroups; ++i) + { + auto paramMap = std::make_unique<ParamMap>(); + + for (const auto& paramID : paramList) + paramMap->set (paramID, 0.0f); + + paramMaps.push_back(std::move (paramMap)); + } +} + +void MixGroupsSharedData::pluginGroupChanged (const String& pluginID, int mixGroup) +{ + // remove plugin from any group it's currently in + for (auto& group : pluginsInGroup) + group->removeString (pluginID); + + if (mixGroup == 0) + return; + + // add plugin to new group + pluginsInGroup[mixGroup - 1]->addIfNotAlreadyThere (pluginID); +} + +int MixGroupsSharedData::getNumPluginsInGroup (int mixGroup) const +{ + return pluginsInGroup[mixGroup - 1]->size(); +} + +void MixGroupsSharedData::copyPluginState (int mixGroup, AudioProcessorValueTreeState& vts) +{ + auto paramMap = paramMaps[mixGroup - 1].get(); + auto mapIter = paramMap->begin(); + while (mapIter.next()) + { + const auto param = vts.getRawParameterValue (mapIter.getKey()); + paramMap->set (mapIter.getKey(), param->load()); + } +} + +void MixGroupsSharedData::setParameter (const String& paramID, int mixGroup, float value, String uuid) +{ + paramMaps[mixGroup - 1]->set (paramID, value); + listeners.call (&Listener::mixGroupParamChanged, paramID, mixGroup, value, uuid); +} + +float MixGroupsSharedData::getParameter (const String& paramID, int mixGroup) const +{ + return paramMaps[mixGroup - 1]->operator[] (paramID); +} diff --git a/Plugin/Source/MixGroups/MixGroupsSharedData.h b/Plugin/Source/MixGroups/MixGroupsSharedData.h @@ -0,0 +1,46 @@ +#ifndef MIXGROUPSPARAMRECEIVER +#define MIXGROUPSPARAMRECEIVER + +#include <JuceHeader.h> + +class MixGroupsSharedData +{ +public: + MixGroupsSharedData(); + + /** Create parameter maps from list of parameters */ + void loadParameterList (Array<String>& paramList); + + /** A plugin has changed mix group. */ + void pluginGroupChanged (const String& pluginID, int mixGroup); + + /** Get the number of plugins already in this mix group */ + int getNumPluginsInGroup (int mixGroup) const; + + /** Copy the plugin state into the parameter map for a given mix group */ + void copyPluginState (int mixGroup, AudioProcessorValueTreeState& vts); + + void setParameter (const String& paramID, int mixGroup, float value, String uuid); + float getParameter (const String& paramID, int mixGroup) const; + + struct Listener + { + virtual ~Listener() {} + virtual void mixGroupParamChanged (const String& /*paramID*/, int /*mixGroup*/, float /*value*/, String /*uuid*/) {} + }; + + void addListener (Listener* l) { listeners.add (l); } + void removeListener (Listener* l) { listeners.remove (l); } + +private: + using ParamMap = HashMap<String, float>; + std::vector<std::unique_ptr<ParamMap>> paramMaps; + + OwnedArray<StringArray> pluginsInGroup; // list of plugin IDs of all the plugins in each mix group + + ListenerList<Listener> listeners; + + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MixGroupsSharedData) +}; + +#endif // MIXGROUPSPARAMRECEIVER