Fix for Bypass and Removed Logs

pull/764/head
jnonis 7 months ago
parent 172c651aa5
commit 2d854393a4
  1. 5
      src/effect_base.cpp
  2. 4
      src/effect_chorus.cpp
  3. 4
      src/effect_delay.cpp
  4. 4
      src/effect_lpf.h
  5. 1
      src/minidexed.cpp
  6. 14
      src/performanceconfig.cpp

@ -29,24 +29,19 @@ unsigned AudioEffect::getId()
void AudioEffect::setParameters(std::vector<unsigned> params)
{
LOGNOTE("setParameters size: %d", params.size());
for (size_t i = 0; i < params.size(); i++)
{
this->setParameter(i, params[i]);
LOGNOTE("Param %d: %d", i, params[i]);
}
}
std::vector<unsigned> AudioEffect::getParameters()
{
LOGNOTE("getParameters");
size_t len = getParametersSize();
LOGNOTE("sizeof: %d", len);
std::vector<unsigned> params;
for (size_t i = 0; i < len; i++)
{
params.push_back(getParameter(i));
LOGNOTE("Param %d: %d", i, params[i]);
}
return params;
}

@ -27,7 +27,7 @@ void AudioEffectChorus::setParameter(unsigned param, unsigned value)
switch (param)
{
case AudioEffectChorus::Param::BYPASS:
this->setBypass(value);
this->setBypass(value == 1);
break;
case AudioEffectChorus::Param::CHORUS_I_ENABLE:
this->setChorusI(value);
@ -50,6 +50,8 @@ unsigned AudioEffectChorus::getParameter(unsigned param)
{
switch (param)
{
case AudioEffectChorus::Param::BYPASS:
return this->getBypass() ? 1 : 0;
case AudioEffectChorus::Param::CHORUS_I_ENABLE:
return this->getChorusI();
case AudioEffectChorus::Param::CHORUS_II_ENABLE:

@ -39,7 +39,7 @@ void AudioEffectDelay::setParameter(unsigned param, unsigned value)
switch (param)
{
case AudioEffectDelay::Param::BYPASS:
this->setBypass(value);
this->setBypass(value == 1);
break;
case AudioEffectDelay::Param::TIME_L:
this->timeL = (float32_t) value / 1000.0f;
@ -62,6 +62,8 @@ unsigned AudioEffectDelay::getParameter(unsigned param)
{
switch (param)
{
case AudioEffectDelay::Param::BYPASS:
return this->getBypass() ? 1 : 0;
case AudioEffectDelay::Param::TIME_L:
return roundf(this->timeL * 1000);
case AudioEffectDelay::Param::TIME_R:

@ -55,7 +55,7 @@ public:
switch (param)
{
case AudioEffectLPF::Param::BYPASS:
this->setBypass(value);
this->setBypass(value == 1);
break;
case AudioEffectLPF::Param::CUTOFF:
this->setCutoff(((float32_t) value / 100.0f) * MAX_CUTOFF);
@ -72,6 +72,8 @@ public:
{
switch (param)
{
case AudioEffectLPF::Param::BYPASS:
return this->getBypass() ? 1 : 0;
case AudioEffectLPF::Param::CUTOFF:
return roundf((this->cutoff / MAX_CUTOFF) * 100);
case AudioEffectLPF::Param::RESONANCE:

@ -1310,7 +1310,6 @@ bool CMiniDexed::DoSavePerformance (void)
m_PerformanceConfig.SetPan (m_nPan[nTG], nTG);
m_PerformanceConfig.SetInsertFX (m_InsertFX[nTG]->getId(), nTG);
LOGNOTE("Saving Insert FX Paramas");
std::vector<unsigned> pParams = m_InsertFX[nTG]->getParameters();
m_PerformanceConfig.SetInsertFXParams (pParams, nTG);
pParams.clear();

@ -384,26 +384,19 @@ std::vector<unsigned> CPerformanceConfig::GetInsertFXParams (unsigned nTG) const
{
assert (nTG < CConfig::ToneGenerators);
LOGNOTE("Loading Insert FX Params");
std::vector<unsigned> tokens;
std::string params = m_nInsertFXParams[nTG];
if (params.empty()) {
LOGNOTE("Empty Insert FX Params");
std::vector<unsigned int> empty;
return empty;
return tokens;
}
char delimiter = ',';
std::stringstream ss(params);
std::string temp;
std::vector<unsigned> tokens;
while (getline(ss, temp, delimiter))
{
LOGNOTE("Insert FX Params token: %s", temp.c_str());
tokens.push_back(stoi(temp));
}
LOGNOTE("Insert FX Params tokens size: %d\n", tokens.size());
LOGNOTE("Loaded Insert FX Params\n");
return tokens;
}
@ -487,10 +480,8 @@ void CPerformanceConfig::SetInsertFX (unsigned nValue, unsigned nTG)
void CPerformanceConfig::SetInsertFXParams (std::vector<unsigned> pParams, unsigned nTG)
{
LOGNOTE("SetInsertFXParams");
assert (nTG < CConfig::ToneGenerators);
LOGNOTE("SetInsertFXParams sizeof %d", pParams.size());
std::string params = "";
for (size_t i = 0; i < pParams.size(); i++)
{
@ -499,7 +490,6 @@ void CPerformanceConfig::SetInsertFXParams (std::vector<unsigned> pParams, unsig
}
params += std::to_string(pParams[i]);
}
LOGNOTE("SetInsertFXParams %s", params.c_str());
m_nInsertFXParams[nTG] = params;
}

Loading…
Cancel
Save