From 72514e9261cac42123ebadfdad7f5740a2f9b8e4 Mon Sep 17 00:00:00 2001 From: probonopd Date: Sun, 27 Apr 2025 14:07:59 +0200 Subject: [PATCH] Audio Output Level Attenuator; change Master Tuning range --- src/mididevice.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mididevice.cpp b/src/mididevice.cpp index c523135..afc35a3 100644 --- a/src/mididevice.cpp +++ b/src/mididevice.cpp @@ -422,14 +422,15 @@ void CMIDIDevice::MIDIMessageHandler (const u8 *pMessage, size_t nLength, unsign LOGNOTE("MIDI-SYSEX: Set Breath Controller Assign %d to %d", nTG, val & 0x0F); m_pSynthesizer->setBreathControllerTarget(val, nTG); break; - case 26: // Audio Output Level Attenuator (if supported) - LOGNOTE("MIDI-SYSEX: TODO: Set Audio Output Level Attenuator %d to %d", nTG, val & 0x0F); - // m_pSynthesizer->setOutputAttenuator(val, nTG); // Uncomment if implemented + case 26: // Audio Output Level Attenuator + LOGNOTE("MIDI-SYSEX: Set Audio Output Level Attenuator %d to %d", nTG, val & 0x0F); + // Set Master volume (0-99) for the TG. Scale from 0-7 to what Synth_Dexed uses (0-99) + m_pSynthesizer->SetMasterVolume(maplong(val, 0, 7, 0, 1), nTG); break; case 64: // Master Tuning LOGNOTE("MIDI-SYSEX: Set Master Tuning"); - // Scale to -75 to +75 cents (TX816 range) - m_pSynthesizer->SetMasterTune(maplong(val, 1, 127, -75, 75), nTG); + // TX812 scales from -75 to +75 cents. + m_pSynthesizer->SetMasterTune(maplong(val, 1, 127, -37, 37), nTG); // Would need 37.5 here, due to wrong constrain on dexed_synth module? break; default: // Unknown or unsupported parameter