|
|
|
@ -58,7 +58,7 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt, |
|
|
|
|
{ |
|
|
|
|
assert (m_pConfig); |
|
|
|
|
|
|
|
|
|
m_bPerformanceProgramChange = m_pConfig->GetPerformanceProgramChange(); |
|
|
|
|
SetPerformanceSelectChannel(m_pConfig->GetPerformanceSelectChannel()); |
|
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < CConfig::ToneGenerators; i++) |
|
|
|
|
{ |
|
|
|
@ -182,6 +182,20 @@ bool CMiniDexed::Initialize (void) |
|
|
|
|
m_bUseSerial = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (m_pConfig->GetMIDIRXProgramChange()) |
|
|
|
|
{ |
|
|
|
|
int nPerfCh = GetParameter(ParameterPerformanceSelectChannel); |
|
|
|
|
if (nPerfCh == CMIDIDevice::Disabled) { |
|
|
|
|
LOGNOTE("Program Change: Enabled for Voices"); |
|
|
|
|
} else if (nPerfCh == CMIDIDevice::OmniMode) { |
|
|
|
|
LOGNOTE("Program Change: Enabled for Performances (Omni)"); |
|
|
|
|
} else { |
|
|
|
|
LOGNOTE("Program Change: Enabled for Performances (CH %d)", nPerfCh+1); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
LOGNOTE("Program Change: Disabled"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (unsigned i = 0; i < CConfig::ToneGenerators; i++) |
|
|
|
|
{ |
|
|
|
|
assert (m_pTG[i]); |
|
|
|
@ -461,22 +475,11 @@ void CMiniDexed::ProgramChange (unsigned nProgram, unsigned nTG) |
|
|
|
|
m_UI.ParameterChanged (); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CMiniDexed::ProgramChangePerformance (unsigned nProgram, unsigned nTG) |
|
|
|
|
void CMiniDexed::ProgramChangePerformance (unsigned nProgram) |
|
|
|
|
{ |
|
|
|
|
assert (m_pConfig); |
|
|
|
|
|
|
|
|
|
if (m_bPerformanceProgramChange) |
|
|
|
|
if (m_nParameter[ParameterPerformanceSelectChannel] != CMIDIDevice::Disabled) |
|
|
|
|
{ |
|
|
|
|
// Program Change messages change Performances.
|
|
|
|
|
//
|
|
|
|
|
// Only pay attention to PCs received on the MIDI channel
|
|
|
|
|
// associated with TG1.
|
|
|
|
|
//
|
|
|
|
|
// Note: as performances store the MIDI channnel, if
|
|
|
|
|
// the MIDI channel for TG1 changes, then further
|
|
|
|
|
// PCs will only be actioned on the new channel number...
|
|
|
|
|
if (nTG == 0) |
|
|
|
|
{ |
|
|
|
|
unsigned nLastPerformance = m_PerformanceConfig.GetLastPerformance(); |
|
|
|
|
|
|
|
|
|
// GetLastPerformance actually returns 1-indexed, number of performances
|
|
|
|
@ -484,15 +487,8 @@ void CMiniDexed::ProgramChangePerformance (unsigned nProgram, unsigned nTG) |
|
|
|
|
{ |
|
|
|
|
SetNewPerformance(nProgram); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// Program Change messages change voice on specified TG
|
|
|
|
|
ProgramChange(nProgram, nTG); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
m_UI.ParameterChanged (); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CMiniDexed::SetVolume (unsigned nVolume, unsigned nTG) |
|
|
|
@ -791,6 +787,10 @@ void CMiniDexed::SetParameter (TParameter Parameter, int nValue) |
|
|
|
|
m_ReverbSpinLock.Release (); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case ParameterPerformanceSelectChannel: |
|
|
|
|
// Nothing more to do
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
assert (0); |
|
|
|
|
break; |
|
|
|
@ -1146,6 +1146,30 @@ void CMiniDexed::ProcessSound (void) |
|
|
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
unsigned CMiniDexed::GetPerformanceSelectChannel (void) |
|
|
|
|
{ |
|
|
|
|
// Stores and returns Select Channel using MIDI Device Channel definitions
|
|
|
|
|
return (unsigned) GetParameter (ParameterPerformanceSelectChannel); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CMiniDexed::SetPerformanceSelectChannel (unsigned uCh) |
|
|
|
|
{ |
|
|
|
|
// Turns a configuration setting to MIDI Device Channel definitions
|
|
|
|
|
// Mirrors the logic in Performance Config for handling MIDI channel configuration
|
|
|
|
|
if (uCh == 0) |
|
|
|
|
{ |
|
|
|
|
SetParameter (ParameterPerformanceSelectChannel, CMIDIDevice::Disabled); |
|
|
|
|
} |
|
|
|
|
else if (uCh < CMIDIDevice::Channels) |
|
|
|
|
{ |
|
|
|
|
SetParameter (ParameterPerformanceSelectChannel, uCh - 1); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
SetParameter (ParameterPerformanceSelectChannel, CMIDIDevice::OmniMode); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool CMiniDexed::SavePerformance (bool bSaveAsDeault) |
|
|
|
|
{ |
|
|
|
|
m_bSavePerformance = true; |
|
|
|
@ -1468,16 +1492,6 @@ unsigned CMiniDexed::GetLastPerformance() |
|
|
|
|
return m_PerformanceConfig.GetLastPerformance(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool CMiniDexed::GetPerformanceProgramChange (void) |
|
|
|
|
{ |
|
|
|
|
return m_bPerformanceProgramChange; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void CMiniDexed::SetPerformanceProgramChange (bool bPerfPC) |
|
|
|
|
{ |
|
|
|
|
m_bPerformanceProgramChange = bPerfPC; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unsigned CMiniDexed::GetActualPerformanceID() |
|
|
|
|
{ |
|
|
|
|
return m_PerformanceConfig.GetActualPerformanceID(); |
|
|
|
|