Skip to content

Commit

Permalink
Merge pull request #75 from VASTDynamics/beta
Browse files Browse the repository at this point in the history
348 changes
  • Loading branch information
VASTDynamics authored Feb 10, 2024
2 parents 48130c7 + 4ab8369 commit 4815055
Show file tree
Hide file tree
Showing 32 changed files with 1,582 additions and 529 deletions.
475 changes: 304 additions & 171 deletions VASTvaporizer/Presets/AR Trance Gate Arp.vvp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion VASTvaporizer/Source/Engine/FX/VASTEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ void CVASTEffect::createAndAddParameter(std::atomic<float>** parameterVar, Audio
isAutomatableParameter, isDiscreteParameter, AudioProcessorParameter::Category::genericParameter));

my_parameters.insert(std::make_pair(uiSequence, p));

my_processor->m_mapModdestToParameterName.insert(std::make_pair(modMatrixDestination, newId));
my_processor->m_mapParameterNameToModdest.insert(std::make_pair(newId, modMatrixDestination));
my_processor->addModMatrixLookupTable(modMatrixDestination, r.start, r.end, r.skew, newId, p);

std::atomic<float>* par = stateTree.getRawParameterValue(newId);

*parameterVar = par;
Expand Down
4 changes: 3 additions & 1 deletion VASTvaporizer/Source/Engine/FX/VASTReverb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,10 @@ void CVASTReverb::initCompatibilityParameters() {

void CVASTReverb::parameterChanged(const String& parameterID, float newValue) {
if (parameterID.startsWith("m_bReverbOnOff")) {
if (newValue == static_cast<int>(SWITCH::SWITCH_ON))
if (newValue == static_cast<int>(SWITCH::SWITCH_ON)) {
reset();
switchOn();
}
else
switchOff();
}
Expand Down
4 changes: 3 additions & 1 deletion VASTvaporizer/Source/Engine/FX/VASTStereoDelay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ void CVASTStereoDelay::initCompatibilityParameters() {

void CVASTStereoDelay::parameterChanged(const String& parameterID, float newValue) {
if (parameterID.startsWith("m_bDelayOnOff")) {
if (newValue == static_cast<int>(SWITCH::SWITCH_ON))
if (newValue == static_cast<int>(SWITCH::SWITCH_ON)) {
reset();
switchOn();
}
else
switchOff();
return;
Expand Down
1 change: 1 addition & 0 deletions VASTvaporizer/Source/Engine/VASTSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,7 @@ float CVASTSettings::getParameterValueWithMatrixModulation(std::atomic<float> *p

jassert((multiplier0to1 >= 0.f) && (multiplier0to1 <= 1.f));
double resultVal = my_processor->m_modMatrixLookupTable[destination].rangeStart + modStartPercentage * length + modLength * multiplier0to1;
resultVal = jlimit<double>(my_processor->m_modMatrixLookupTable[destination].rangeStart, my_processor->m_modMatrixLookupTable[destination].rangeEnd, resultVal);
jassert((resultVal >= my_processor->m_modMatrixLookupTable[destination].rangeStart) && (resultVal <= my_processor->m_modMatrixLookupTable[destination].rangeEnd));
return resultVal;
}
Expand Down
4 changes: 2 additions & 2 deletions VASTvaporizer/Source/Engine/VASTSingleNote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,8 +729,8 @@ void CVASTSingleNote::samplerRenderNextBlock(AudioSampleBuffer* outputBuffer, in
{
lOutL += (l + r) * 0.5f;
}
jassert((lOutL >= -6.f) && (lOutL <= 6.f));
jassert((lOutR >= -6.f) && (lOutR <= 6.f));
//jassert((lOutL >= -6.f) && (lOutL <= 6.f));
//jassert((lOutR >= -6.f) && (lOutR <= 6.f));

//do loop fade in out
//if (bSwitchSamplerLoop || bSwitchSamplerLoopOnly || bSwitchSamplerLoopPingpong) {
Expand Down
54 changes: 26 additions & 28 deletions VASTvaporizer/Source/Plugin/VASTAudioProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,28 +525,6 @@ void VASTAudioProcessor::initializeToDefaults() {
m_parameterState.undoManager->beginNewTransaction(); //start new transcation only here?
}

void VASTAudioProcessor::randomizePatch() {
return; //TODO

/*
struct timeval tp;
m_pVASTXperience.m_Set._gettimeofday(&tp);
juce::Random rand(tp.tv_sec); //seed
VASTPresetElement element;
m_curPatchData = element;
m_curPatchData.freetag = TRANS("Random");
const ScopedWriteLock myScopedLock(m_pVASTXperience.m_Set.m_RoutingBuffers.mReadWriteLock);
int numparam = getNumParameters();
for (int parameterIndex = 0; parameterIndex < numparam; parameterIndex++) {
auto* param = getParameters()[parameterIndex];
float rand01 = rand.nextFloat(); //0..1
param->setValue(rand01);
}
*/
}

void VASTAudioProcessor::setCurrentProgram(int index)
{
if (index >= getNumPrograms()) {
Expand Down Expand Up @@ -610,14 +588,12 @@ int VASTAudioProcessor::getNumPrograms()

int VASTAudioProcessor::getCurrentProgram()
{
// int l_prog = m_curPatchData.presetarrayindex; // this is set lazy in thread
int l_prog = m_curPatchDataLoadRequestedIndex;
return l_prog;
}

int VASTAudioProcessor::getCurrentPresetProgram() const
{
//int l_prog = m_curPatchData.presetarrayindex; // this is set lazy in thread
int l_prog = m_curPatchDataLoadRequestedIndex;
return l_prog;
}
Expand Down Expand Up @@ -1593,6 +1569,17 @@ void VASTAudioProcessor::toggleKeyboardHoldMode() {
m_pVASTXperience.m_Poly.setKeyboardHoldMode(m_keyboardHoldMode.load());
}

/*
AudioProcessorParameterWithID* VASTAudioProcessor::getParameterWithID(String paramID) {
std::map<String, AudioProcessorParameterWithID*>::iterator l_iter = m_mapParameterToID.find(paramID);
if (l_iter->first == paramID) {
if (l_iter->second != nullptr)
return l_iter->second;
}
return nullptr;
}
*/

void VASTAudioProcessor::addModMatrixLookupTable(int modMatrixDestination, float rangeStart, float rangeEnd, float rangeSkew, StringRef paramID, AudioProcessorParameterWithID* param) {
m_modMatrixLookupTable[modMatrixDestination].rangeStart = rangeStart;
m_modMatrixLookupTable[modMatrixDestination].rangeEnd = rangeEnd;
Expand Down Expand Up @@ -1739,7 +1726,19 @@ String VASTAudioProcessor::autoDestinationGetParam(int modmatdest) {
return it->second;
};

//unused now
void VASTAudioProcessor::setParameterFloat01(StringRef parName, float nvalue, bool bSilent) {
vassert((nvalue >= 0.f) && (nvalue <= 1.f));
AudioProcessorParameterWithID* param = m_parameterState.getParameter(parName);
if (param != nullptr) {
if (bSilent)
param->setValue(nvalue);
else
param->setValueNotifyingHost(nvalue);
}
else
vassertfalse;
}

void VASTAudioProcessor::setParameterText(StringRef parName, StringRef textVal, bool bSilent) {
AudioProcessorParameterWithID* param = m_parameterState.getParameter(parName);
if (param != nullptr) {
Expand All @@ -1751,9 +1750,8 @@ void VASTAudioProcessor::setParameterText(StringRef parName, StringRef textVal,
else
param->setValueNotifyingHost(nvalue);
}
//else {
//jassert(false); //ignore - unused param in preset xml file
//}
else
vassertfalse;
}

AudioProcessorValueTreeState& VASTAudioProcessor::getParameterTree() {
Expand Down
2 changes: 1 addition & 1 deletion VASTvaporizer/Source/Plugin/VASTAudioProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ class VASTAudioProcessor : public AudioProcessor
const String getName() const override;

void setParameterText(StringRef parName, StringRef textVal, bool bSilent);
void setParameterFloat01(StringRef parName, float nvalue, bool bSilent);
AudioProcessorValueTreeState& getParameterTree();
VASTVUMeterSource* getMeterSource();
char* _strncpy(char* dst, const char* src, size_t maxLen);
Expand Down Expand Up @@ -243,7 +244,6 @@ class VASTAudioProcessor : public AudioProcessor
static String getVSTPathAlternative();
static String getSettingsFilePath(bool read, bool& migrate_legacy);
bool loadUserPatchMetaData(File file, VASTPresetElement& lPreset);
void randomizePatch(); //not yet implemented

String getVersionString();
static void crashHandler(void*);
Expand Down
Loading

0 comments on commit 4815055

Please sign in to comment.