Revert "Implementationg proposition for:"

This reverts commit a69e97f61d.
pull/409/head
abscisys 2 years ago
parent 11b38851af
commit 5317265624
  1. 170
      src/minidexed.cpp
  2. 11
      src/minidexed.h
  3. 41
      src/performanceconfig.cpp
  4. 13
      src/performanceconfig.h
  5. 50
      src/uimenu.cpp
  6. 13
      src/uimenu.h

@ -37,9 +37,6 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt,
CMultiCoreSupport (CMemorySystem::Get ()),
#endif
m_pConfig (pConfig),
m_bSavePerformanceNewFile (false),
m_bSetNewPerformance (false),
m_bDeletePerformance (false),
m_UI (this, pGPIOManager, pI2CMaster, pConfig),
m_PerformanceConfig (pFileSystem),
m_PCKeyboard (this, pConfig, &m_UI),
@ -54,8 +51,10 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt,
1000000U * pConfig->GetChunkSize ()/2 / pConfig->GetSampleRate ()),
m_bProfileEnabled (m_pConfig->GetProfileEnabled ()),
m_bSavePerformance (false),
m_bLoadPerformanceBusy(false),
m_bSaveAsDefault(false)
m_bSavePerformanceNewFile (false),
m_bSetNewPerformance (false),
m_bDeletePerformance (false),
m_bLoadPerformanceBusy(false)
{
assert (m_pConfig);
@ -158,12 +157,6 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt,
// END setup reverb
SetParameter (ParameterCompressorEnable, 1);
// BEGIN Unison
SetParameter (ParameterUnisonEnable, 0);
SetParameter (ParameterUnisonPanSpread, 60);
SetParameter (ParameterUnisonDetuneSpread, 12);
// END Unison
};
bool CMiniDexed::Initialize (void)
@ -419,9 +412,8 @@ void CMiniDexed::SetPan (unsigned nPan, unsigned nTG)
assert (nTG < CConfig::ToneGenerators);
m_nPan[nTG] = nPan;
float normPan = mapfloat(nPan,0,127,0.0f,1.0f);
tg_mixer->pan(nTG,normPan);
reverb_send_mixer->pan(nTG,normPan);
tg_mixer->pan(nTG,mapfloat(nPan,0,127,0.0f,1.0f));
reverb_send_mixer->pan(nTG,mapfloat(nPan,0,127,0.0f,1.0f));
m_UI.ParameterChanged ();
}
@ -694,57 +686,6 @@ void CMiniDexed::SetParameter (TParameter Parameter, int nValue)
m_ReverbSpinLock.Release ();
break;
#ifdef ARM_ALLOW_MULTI_CORE
/* Unison START */
case ParameterUnisonEnable:
assert (CConfig::ToneGenerators > 1);
nValue=constrain((int)nValue,0,1);
if (!!nValue) {
for (unsigned nTG = 0; nTG < CConfig::ToneGenerators; nTG++)
{
SetTGParameter(TGParameterMIDIChannel, GetTGParameter(TGParameterMIDIChannel, 0), nTG);
SetTGParameter(TGParameterVoiceBank, GetTGParameter(TGParameterVoiceBank, 0), nTG);
SetTGParameter(TGParameterProgram, GetTGParameter(TGParameterProgram, 0), nTG);
SetTGParameter(TGParameterVolume, GetTGParameter(TGParameterVolume, 0), nTG);
}
// setting unison panning and detuning
SetParameter (ParameterUnisonPanSpread, m_nParameter[ParameterUnisonPanSpread]);
SetParameter (ParameterUnisonDetuneSpread, m_nParameter[ParameterUnisonDetuneSpread]);
}
break;
case ParameterUnisonPanSpread:
assert (CConfig::ToneGenerators > 1);
nValue=constrain((int)nValue,0,63);
if (!!GetParameter(ParameterUnisonEnable))
{
int step = 2 * nValue / (CConfig::ToneGenerators - 1);
int pan = 64 - nValue;
for (unsigned nTG = 0; nTG < CConfig::ToneGenerators; nTG++)
{
SetTGParameter(TGParameterPan, constrain((int)pan,0,127), nTG);
pan += step;
}
}
break;
case ParameterUnisonDetuneSpread:
assert (CConfig::ToneGenerators > 1);
nValue=constrain((int)nValue,0,99);
if (!!GetParameter(ParameterUnisonEnable))
{
int step = 2 * nValue / (CConfig::ToneGenerators - 1);
int detune = -nValue;
for (unsigned nTG = 0; nTG < CConfig::ToneGenerators; nTG++)
{
SetTGParameter(TGParameterMasterTune, constrain((int)detune,-99,99), nTG);
detune += step;
}
}
break;
/* Unison END */
#endif
default:
assert (0);
break;
@ -759,9 +700,8 @@ int CMiniDexed::GetParameter (TParameter Parameter)
void CMiniDexed::SetTGParameter (TTGParameter Parameter, int nValue, unsigned nTG)
{
if (nTG < CConfig::ToneGenerators)
{
assert (nTG < CConfig::ToneGenerators);
switch (Parameter)
{
case TGParameterVoiceBank: BankSelectLSB (nValue, nTG); break;
@ -809,26 +749,10 @@ void CMiniDexed::SetTGParameter (TTGParameter Parameter, int nValue, unsigned nT
assert (0);
break;
}
#ifdef ARM_ALLOW_MULTI_CORE
/* ALL TG START */
} else if (nTG == ALL_TG_ID) {
for (unsigned i = 0; i < CConfig::ToneGenerators; i++)
{
SetTGParameter(Parameter, nValue, i);
}
/* ALL TG END */
#endif
}
}
int CMiniDexed::GetTGParameter (TTGParameter Parameter, unsigned nTG)
{
if (nTG < CConfig::ToneGenerators)
{
assert (nTG < CConfig::ToneGenerators);
switch (Parameter)
@ -874,25 +798,10 @@ int CMiniDexed::GetTGParameter (TTGParameter Parameter, unsigned nTG)
assert (0);
return 0;
}
#ifdef ARM_ALLOW_MULTI_CORE
/* ALL TG START */
} else if (nTG == ALL_TG_ID) {
return GetTGParameter(Parameter, 0);
/* ALL TG END */
#endif
}
return 0;
}
void CMiniDexed::SetVoiceParameter (uint8_t uchOffset, uint8_t uchValue, unsigned nOP, unsigned nTG)
{
if (nTG < CConfig::ToneGenerators)
{
assert (nTG < CConfig::ToneGenerators);
assert (m_pTG[nTG]);
assert (nOP <= 6);
@ -922,26 +831,10 @@ void CMiniDexed::SetVoiceParameter (uint8_t uchOffset, uint8_t uchValue, unsigne
assert (uchOffset < 156);
m_pTG[nTG]->setVoiceDataElement (uchOffset, uchValue);
#ifdef ARM_ALLOW_MULTI_CORE
/* ALL TG START */
} else if (nTG == ALL_TG_ID) {
for (unsigned i = 0; i < CConfig::ToneGenerators; i++)
{
SetVoiceParameter(uchOffset, uchValue, nOP, i);
}
/* ALL TG END */
#endif
}
}
uint8_t CMiniDexed::GetVoiceParameter (uint8_t uchOffset, unsigned nOP, unsigned nTG)
{
if (nTG < CConfig::ToneGenerators)
{
assert (nTG < CConfig::ToneGenerators);
assert (m_pTG[nTG]);
assert (nOP <= 6);
@ -960,24 +853,10 @@ uint8_t CMiniDexed::GetVoiceParameter (uint8_t uchOffset, unsigned nOP, unsigned
assert (uchOffset < 156);
return m_pTG[nTG]->getVoiceDataElement (uchOffset);
#ifdef ARM_ALLOW_MULTI_CORE
/* ALL TG START */
} else if (nTG == ALL_TG_ID) {
return GetVoiceParameter (uchOffset, nOP, 0);
/* ALL TG END */
#endif
}
return 0;
}
std::string CMiniDexed::GetVoiceName (unsigned nTG)
{
if (nTG < CConfig::ToneGenerators)
{
char VoiceName[11];
memset (VoiceName, 0, sizeof VoiceName);
@ -988,18 +867,6 @@ std::string CMiniDexed::GetVoiceName (unsigned nTG)
std::string Result (VoiceName);
return Result;
#ifdef ARM_ALLOW_MULTI_CORE
/* ALL TG START */
} else if (nTG == ALL_TG_ID) {
return GetVoiceName (0);
/* ALL TG END */
#endif
}
return std::string("ERROR");
}
#ifndef ARM_ALLOW_MULTI_CORE
@ -1169,10 +1036,10 @@ void CMiniDexed::ProcessSound (void)
#endif
bool CMiniDexed::SavePerformance (bool bSaveAsDefault)
bool CMiniDexed::SavePerformance (bool bSaveAsDeault)
{
m_bSavePerformance = true;
m_bSaveAsDefault=bSaveAsDefault;
m_bSaveAsDeault=bSaveAsDeault;
return true;
}
@ -1223,15 +1090,7 @@ bool CMiniDexed::DoSavePerformance (void)
m_PerformanceConfig.SetReverbDiffusion (m_nParameter[ParameterReverbDiffusion]);
m_PerformanceConfig.SetReverbLevel (m_nParameter[ParameterReverbLevel]);
#ifdef ARM_ALLOW_MULTI_CORE
/* UNISON START */
m_PerformanceConfig.SetUnisonEnable (!!m_nParameter[ParameterUnisonEnable]);
m_PerformanceConfig.SetUnisonPanSpread (m_nParameter[ParameterUnisonPanSpread]);
m_PerformanceConfig.SetUnisonDetuneSpread (m_nParameter[ParameterUnisonDetuneSpread]);
/* UNISON END */
#endif
if(m_bSaveAsDefault)
if(m_bSaveAsDeault)
{
m_PerformanceConfig.SetNewPerformance(0);
@ -1619,15 +1478,6 @@ void CMiniDexed::LoadPerformanceParameters(void)
SetParameter (ParameterReverbLowPass, m_PerformanceConfig.GetReverbLowPass ());
SetParameter (ParameterReverbDiffusion, m_PerformanceConfig.GetReverbDiffusion ());
SetParameter (ParameterReverbLevel, m_PerformanceConfig.GetReverbLevel ());
#ifdef ARM_ALLOW_MULTI_CORE
/* UNISON START */
SetParameter (ParameterUnisonPanSpread, m_PerformanceConfig.GetUnisonPanSpread ());
SetParameter (ParameterUnisonDetuneSpread, m_PerformanceConfig.GetUnisonDetuneSpread ());
SetParameter (ParameterUnisonEnable, m_PerformanceConfig.GetUnisonEnable () ? 1 : 0);
/* UNISON END */
#endif
}
std::string CMiniDexed::GetNewPerformanceDefaultName(void)

@ -134,15 +134,6 @@ public:
ParameterReverbLowPass,
ParameterReverbDiffusion,
ParameterReverbLevel,
#ifdef ARM_ALLOW_MULTI_CORE
/* UNISON START */
ParameterUnisonEnable,
ParameterUnisonPanSpread,
ParameterUnisonDetuneSpread,
/* UNISON END */
#endif
ParameterUnknown
};
@ -306,7 +297,7 @@ private:
bool m_bDeletePerformance;
unsigned m_nDeletePerformanceID;
bool m_bLoadPerformanceBusy;
bool m_bSaveAsDefault;
bool m_bSaveAsDeault;
};
#endif

@ -159,11 +159,6 @@ bool CPerformanceConfig::Load (void)
m_nReverbDiffusion = m_Properties.GetNumber ("ReverbDiffusion", 65);
m_nReverbLevel = m_Properties.GetNumber ("ReverbLevel", 99);
// Unison
m_bUnisonEnable = m_Properties.GetNumber("UnisonEnable", 0) != 0;
m_nUnisonPanSpread = m_Properties.GetNumber("UnisonPanSpread", 56);
m_nUnisonDetuneSpread = m_Properties.GetNumber("UnisonDetuneSpread", 21);
return bResult;
}
@ -282,10 +277,6 @@ bool CPerformanceConfig::Save (void)
m_Properties.SetNumber ("ReverbDiffusion", m_nReverbDiffusion);
m_Properties.SetNumber ("ReverbLevel", m_nReverbLevel);
m_Properties.SetNumber ("UnisonEnable", m_bUnisonEnable ? 1 : 0);
m_Properties.SetNumber ("UnisonPanSpread", m_nUnisonPanSpread);
m_Properties.SetNumber ("UnisonDetuneSpread", m_nUnisonDetuneSpread);
return m_Properties.Save ();
}
@ -512,38 +503,6 @@ void CPerformanceConfig::SetReverbLevel (unsigned nValue)
{
m_nReverbLevel = nValue;
}
// Unison
bool CPerformanceConfig::GetUnisonEnable (void) const
{
return m_bUnisonEnable;
}
unsigned CPerformanceConfig::GetUnisonPanSpread (void) const
{
return m_nUnisonPanSpread;
}
unsigned CPerformanceConfig::GetUnisonDetuneSpread (void) const
{
return m_nUnisonDetuneSpread;
}
void CPerformanceConfig::SetUnisonEnable (bool bValue)
{
m_bUnisonEnable = bValue;
}
void CPerformanceConfig::SetUnisonPanSpread (unsigned nValue)
{
m_nUnisonPanSpread = nValue;
}
void CPerformanceConfig::SetUnisonDetuneSpread (unsigned nValue)
{
m_nUnisonDetuneSpread = nValue;
}
// Pitch bender and portamento:
void CPerformanceConfig::SetPitchBendRange (unsigned nValue, unsigned nTG)
{

@ -117,14 +117,6 @@ public:
void SetReverbDiffusion (unsigned nValue);
void SetReverbLevel (unsigned nValue);
// Unison
bool GetUnisonEnable (void) const;
unsigned GetUnisonPanSpread (void) const;
unsigned GetUnisonDetuneSpread (void) const;
void SetUnisonEnable (bool bValue);
void SetUnisonPanSpread (unsigned nValue);
void SetUnisonDetuneSpread (unsigned nValue);
bool VoiceDataFilled(unsigned nTG);
bool ListPerformances();
//std::string m_DirName;
@ -191,11 +183,6 @@ private:
unsigned m_nReverbLowPass;
unsigned m_nReverbDiffusion;
unsigned m_nReverbLevel;
// Unison
bool m_bUnisonEnable;
unsigned m_nUnisonPanSpread;
unsigned m_nUnisonDetuneSpread;
};
#endif

@ -52,11 +52,6 @@ const CUIMenu::TMenuItem CUIMenu::s_MainMenu[] =
{"TG8", MenuHandler, s_TGMenu, 7},
#endif
{"Effects", MenuHandler, s_EffectsMenu},
#ifdef ARM_ALLOW_MULTI_CORE
/* Unison START */
{"Unison", MenuHandler, s_UnisonMenu},
/* Unison END */
#endif
{"Performance", MenuHandler, s_PerformanceMenu},
{0}
};
@ -82,29 +77,6 @@ const CUIMenu::TMenuItem CUIMenu::s_TGMenu[] =
{0}
};
#ifdef ARM_ALLOW_MULTI_CORE
/* ALL TG START */
const CUIMenu::TMenuItem CUIMenu::s_AllTGMenu[] =
{
{"Voice", EditProgramNumber},
{"Bank", EditVoiceBankNumber},
{"Volume", EditTGParameter, 0, CMiniDexed::TGParameterVolume},
{"Pan Spread", EditGlobalParameter, 0, CMiniDexed::ParameterUnisonPanSpread},
{"Reverb-Send", EditTGParameter, 0, CMiniDexed::TGParameterReverbSend},
{"Detune", EditGlobalParameter, 0, CMiniDexed::ParameterUnisonDetuneSpread},
{"Cutoff", EditTGParameter, 0, CMiniDexed::TGParameterCutoff},
{"Resonance", EditTGParameter, 0, CMiniDexed::TGParameterResonance},
{"Pitch Bend", MenuHandler, s_EditPitchBendMenu},
{"Portamento", MenuHandler, s_EditPortamentoMenu},
{"Poly/Mono", EditTGParameter, 0, CMiniDexed::TGParameterMonoMode},
{"Modulation", MenuHandler, s_ModulationMenu},
{"Channel", EditTGParameter, 0, CMiniDexed::TGParameterMIDIChannel},
{"Edit Voice", MenuHandler, s_EditVoiceMenu},
{0}
};
/* ALL TG END */
#endif
const CUIMenu::TMenuItem CUIMenu::s_EffectsMenu[] =
{
{"Compress", EditGlobalParameter, 0, CMiniDexed::ParameterCompressorEnable},
@ -163,19 +135,6 @@ const CUIMenu::TMenuItem CUIMenu::s_ReverbMenu[] =
#endif
#ifdef ARM_ALLOW_MULTI_CORE
/* Unison START */
const CUIMenu::TMenuItem CUIMenu::s_UnisonMenu[] =
{
{"Enable", EditGlobalParameter, 0, CMiniDexed::ParameterUnisonEnable},
{"All TG", MenuHandler, s_AllTGMenu, ALL_TG_ID},
// {"Max Pan", EditGlobalParameter, 0, CMiniDexed::ParameterUnisonPanSpread},
// {"Max Detune", EditGlobalParameter, 0, CMiniDexed::ParameterUnisonDetuneSpread},
{0}
};
/* Unison END */
#endif
// inserting menu items before "OP1" affect OPShortcutHandler()
const CUIMenu::TMenuItem CUIMenu::s_EditVoiceMenu[] =
{
@ -254,15 +213,6 @@ const CUIMenu::TParameter CUIMenu::s_GlobalParameter[CMiniDexed::ParameterUnknow
{0, 99, 1}, // ParameterReverbLowPass
{0, 99, 1}, // ParameterReverbDiffusion
{0, 99, 1} // ParameterReverbLevel
#ifdef ARM_ALLOW_MULTI_CORE
,
/* UNISON START */
{0, 1, 1, ToOnOff}, // ParameterUnisonEnable
{0, 63, 1}, // ParameterUnisonPanSpread
{0, 99, 1} // ParameterUnisonDetuneSpread
/* UNISON END */
#endif
};
// must match CMiniDexed::TTGParameter

@ -26,8 +26,6 @@
#include <string>
#include <circle/timer.h>
#define ALL_TG_ID 100
class CMiniDexed;
class CUserInterface;
@ -139,11 +137,6 @@ private:
static const TMenuItem s_MenuRoot[];
static const TMenuItem s_MainMenu[];
static const TMenuItem s_TGMenu[];
#ifdef ARM_ALLOW_MULTI_CORE
/* ALL TG START */
static const TMenuItem s_AllTGMenu[];
/* ALL TG END */
#endif
static const TMenuItem s_EffectsMenu[];
static const TMenuItem s_ReverbMenu[];
static const TMenuItem s_EditVoiceMenu[];
@ -153,12 +146,6 @@ private:
static const TMenuItem s_EditPortamentoMenu[];
static const TMenuItem s_PerformanceMenu[];
#ifdef ARM_ALLOW_MULTI_CORE
/* Unison START */
static const TMenuItem s_UnisonMenu[];
/* Unison END */
#endif
static const TMenuItem s_ModulationMenu[];
static const TMenuItem s_ModulationMenuParameters[];

Loading…
Cancel
Save