Save Tempo into Performance

pull/764/head
Javier Nonis 6 months ago
parent 652db3e05f
commit d7336ee180
  1. 5
      src/minidexed.cpp
  2. 15
      src/performanceconfig.cpp
  3. 3
      src/performanceconfig.h

@ -1016,6 +1016,7 @@ void CMiniDexed::SetParameter (TParameter Parameter, int nValue)
break; break;
case ParameterTempo: case ParameterTempo:
nValue=constrain((int)nValue,30,250);
this->setTempo(nValue); this->setTempo(nValue);
break; break;
@ -1562,6 +1563,8 @@ bool CMiniDexed::DoSavePerformance (void)
m_PerformanceConfig.SetReverbDiffusion (m_nParameter[ParameterReverbDiffusion]); m_PerformanceConfig.SetReverbDiffusion (m_nParameter[ParameterReverbDiffusion]);
m_PerformanceConfig.SetReverbLevel (m_nParameter[ParameterReverbLevel]); m_PerformanceConfig.SetReverbLevel (m_nParameter[ParameterReverbLevel]);
m_PerformanceConfig.SetTempo (m_nTempo);
if(m_bSaveAsDeault) if(m_bSaveAsDeault)
{ {
m_PerformanceConfig.SetNewPerformance(0); m_PerformanceConfig.SetNewPerformance(0);
@ -2021,6 +2024,8 @@ void CMiniDexed::LoadPerformanceParameters(void)
SetParameter (ParameterReverbLowPass, m_PerformanceConfig.GetReverbLowPass ()); SetParameter (ParameterReverbLowPass, m_PerformanceConfig.GetReverbLowPass ());
SetParameter (ParameterReverbDiffusion, m_PerformanceConfig.GetReverbDiffusion ()); SetParameter (ParameterReverbDiffusion, m_PerformanceConfig.GetReverbDiffusion ());
SetParameter (ParameterReverbLevel, m_PerformanceConfig.GetReverbLevel ()); SetParameter (ParameterReverbLevel, m_PerformanceConfig.GetReverbLevel ());
SetParameter (ParameterTempo, m_PerformanceConfig.GetTempo ());
} }
std::string CMiniDexed::GetNewPerformanceDefaultName(void) std::string CMiniDexed::GetNewPerformanceDefaultName(void)

@ -223,6 +223,8 @@ bool CPerformanceConfig::Load (void)
m_nReverbDiffusion = m_Properties.GetNumber ("ReverbDiffusion", 65); m_nReverbDiffusion = m_Properties.GetNumber ("ReverbDiffusion", 65);
m_nReverbLevel = m_Properties.GetNumber ("ReverbLevel", 100); m_nReverbLevel = m_Properties.GetNumber ("ReverbLevel", 100);
m_nTempo = m_Properties.GetNumber ("Tempo", 120);
// Set EFFECT_REVERB as Default for backward compatibility // Set EFFECT_REVERB as Default for backward compatibility
// EFFECT_REVERB 7 // EFFECT_REVERB 7
m_nSendFX = m_Properties.GetNumber ("SendFX", 7); m_nSendFX = m_Properties.GetNumber ("SendFX", 7);
@ -407,6 +409,8 @@ bool CPerformanceConfig::Save (void)
tokens.shrink_to_fit(); tokens.shrink_to_fit();
} }
m_Properties.SetNumber ("Tempo", m_nTempo);
return m_Properties.Save (); return m_Properties.Save ();
} }
@ -658,6 +662,11 @@ unsigned CPerformanceConfig::GetReverbLevel (void) const
return m_nReverbLevel; return m_nReverbLevel;
} }
unsigned CPerformanceConfig::GetTempo (void) const
{
return m_nTempo;
}
void CPerformanceConfig::SetCompressorEnable (bool bValue) void CPerformanceConfig::SetCompressorEnable (bool bValue)
{ {
m_bCompressorEnable = bValue; m_bCompressorEnable = bValue;
@ -712,6 +721,12 @@ void CPerformanceConfig::SetReverbLevel (unsigned nValue)
{ {
m_nReverbLevel = nValue; m_nReverbLevel = nValue;
} }
void CPerformanceConfig::SetTempo (unsigned nValue)
{
m_nTempo = nValue;
}
// Pitch bender and portamento: // Pitch bender and portamento:
void CPerformanceConfig::SetPitchBendRange (unsigned nValue, unsigned nTG) void CPerformanceConfig::SetPitchBendRange (unsigned nValue, unsigned nTG)
{ {

@ -122,6 +122,7 @@ public:
unsigned GetReverbLowPass (void) const; // 0 .. 99 unsigned GetReverbLowPass (void) const; // 0 .. 99
unsigned GetReverbDiffusion (void) const; // 0 .. 99 unsigned GetReverbDiffusion (void) const; // 0 .. 99
unsigned GetReverbLevel (void) const; // 0 .. 99 unsigned GetReverbLevel (void) const; // 0 .. 99
unsigned GetTempo (void) const;
void SetCompressorEnable (bool bValue); void SetCompressorEnable (bool bValue);
void SetSendFX (unsigned nValue); void SetSendFX (unsigned nValue);
@ -134,6 +135,7 @@ public:
void SetReverbLowPass (unsigned nValue); void SetReverbLowPass (unsigned nValue);
void SetReverbDiffusion (unsigned nValue); void SetReverbDiffusion (unsigned nValue);
void SetReverbLevel (unsigned nValue); void SetReverbLevel (unsigned nValue);
void SetTempo (unsigned nValue);
bool VoiceDataFilled(unsigned nTG); bool VoiceDataFilled(unsigned nTG);
bool ListPerformances(); bool ListPerformances();
@ -224,6 +226,7 @@ private:
unsigned m_nReverbLowPass; unsigned m_nReverbLowPass;
unsigned m_nReverbDiffusion; unsigned m_nReverbDiffusion;
unsigned m_nReverbLevel; unsigned m_nReverbLevel;
unsigned m_nTempo;
std::string VectorToString (std::vector<unsigned> pParams); std::string VectorToString (std::vector<unsigned> pParams);
std::vector<unsigned> StringToVector (std::string sParams) const; std::vector<unsigned> StringToVector (std::string sParams) const;

Loading…
Cancel
Save