|
|
@ -1672,7 +1672,7 @@ void CMiniDexed::setBreathControllerTarget(uint8_t target, uint8_t nTG) |
|
|
|
|
|
|
|
|
|
|
|
assert (m_pTG[nTG]); |
|
|
|
assert (m_pTG[nTG]); |
|
|
|
|
|
|
|
|
|
|
|
m_nBreathControlTarget[nTG]=target; |
|
|
|
m_nBreathControlTarget[nTG] = target; |
|
|
|
|
|
|
|
|
|
|
|
m_pTG[nTG]->setBreathControllerTarget(constrain(target, 0, 7)); |
|
|
|
m_pTG[nTG]->setBreathControllerTarget(constrain(target, 0, 7)); |
|
|
|
m_pTG[nTG]->ControllersRefresh(); |
|
|
|
m_pTG[nTG]->ControllersRefresh(); |
|
|
@ -2185,17 +2185,28 @@ unsigned CMiniDexed::getModController (unsigned controller, unsigned parameter, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void CMiniDexed::setOperatorMute(uint8_t operatorIndex, unsigned nTG) { |
|
|
|
void CMiniDexed::setOperatorMask(uint8_t operatorMask, unsigned nTG) { |
|
|
|
if (nTG >= CConfig::AllToneGenerators || operatorIndex >= 6) { |
|
|
|
if (nTG >= CConfig::AllToneGenerators) { |
|
|
|
LOGERR("Invalid tone generator or operator index: TG=%u, Operator=%u", nTG, operatorIndex); |
|
|
|
LOGERR("Invalid tone generator: TG=%u", nTG); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Toggle the operator mask for the specified operator
|
|
|
|
// According to Yamaha DX7/TX SysEx format:
|
|
|
|
m_uchOPMask[nTG] ^= (1 << operatorIndex); |
|
|
|
// Bit 0 = OP6, Bit 1 = OP5, Bit 2 = OP4, Bit 3 = OP3, Bit 4 = OP2, Bit 5 = OP1
|
|
|
|
|
|
|
|
// For MiniDexed: Bit 0 = OP1, Bit 1 = OP2, etc. - need to reverse the bit order to match
|
|
|
|
|
|
|
|
|
|
|
|
LOGDBG("Operator %u mute toggled for TG %u. New mask: 0x%02X", operatorIndex, nTG, m_uchOPMask[nTG]); |
|
|
|
uint8_t reversedMask = 0; |
|
|
|
|
|
|
|
for (int i = 0; i < 6; i++) { |
|
|
|
|
|
|
|
if (operatorMask & (1 << i)) { |
|
|
|
|
|
|
|
reversedMask |= (1 << (5 - i)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
m_uchOPMask[nTG] = reversedMask; |
|
|
|
|
|
|
|
LOGDBG("Set operator mask for TG %u: Yamaha=0x%02X, Reversed=0x%02X", nTG, operatorMask, reversedMask); |
|
|
|
|
|
|
|
|
|
|
|
// Apply the updated operator mask to the tone generator
|
|
|
|
// Apply the updated operator mask to the tone generator
|
|
|
|
m_pTG[nTG]->setOPAll(m_uchOPMask[nTG]); |
|
|
|
if (nTG < m_nToneGenerators) { |
|
|
|
|
|
|
|
m_pTG[nTG]->setOPAll(m_uchOPMask[nTG]); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|