commit 218c03fd6ec0c06bedbc6cf116ee0e131067e001
parent 9f0ea773a49938f9759bb7cc4a894a26a216760e
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Wed, 17 Apr 2024 22:01:11 +0200
fix master volume change breaking all integration tests
Diffstat:
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/source/virusConsoleLib/consoleApp.cpp b/source/virusConsoleLib/consoleApp.cpp
@@ -175,7 +175,7 @@ void ConsoleApp::audioCallback(const uint32_t _audioCallbackCount)
case 1:
m_dsp1->drainESSI1();
LOG("Sending Init Control Commands");
- m_uc->sendInitControlCommands();
+ m_uc->sendInitControlCommands(127); // set Master Volume to max
break;
case 256:
m_dsp1->drainESSI1();
diff --git a/source/virusLib/microcontroller.cpp b/source/virusLib/microcontroller.cpp
@@ -102,19 +102,19 @@ Microcontroller::Microcontroller(DspSingle& _dsp, const ROMFile& _romFile, bool
m_pendingSysexInput.reserve(64);
}
-void Microcontroller::sendInitControlCommands()
+void Microcontroller::sendInitControlCommands(uint8_t _masterVolume)
{
writeHostBitsWithWait(0, 1);
LOG("Sending Init Control Commands");
- sendControlCommand(MIDI_CLOCK_RX, 0x1); // Enable MIDI clock receive
- sendControlCommand(GLOBAL_CHANNEL, 0x0); // Set global midi channel to 0
- sendControlCommand(MIDI_CONTROL_LOW_PAGE, 0x1); // Enable midi CC to edit parameters on page A
- sendControlCommand(MIDI_CONTROL_HIGH_PAGE, 0x0); // Disable poly pressure to edit parameters on page B
- sendControlCommand(MASTER_VOLUME, 92); // Set master volume to 92, this matches the Virus TI in USB mode
- sendControlCommand(MASTER_TUNE, 64); // Set master tune to 0
- sendControlCommand(DEVICE_ID, OMNI_DEVICE_ID); // Set device ID to Omni
+ sendControlCommand(MIDI_CLOCK_RX, 0x1); // Enable MIDI clock receive
+ sendControlCommand(GLOBAL_CHANNEL, 0x0); // Set global midi channel to 0
+ sendControlCommand(MIDI_CONTROL_LOW_PAGE, 0x1); // Enable midi CC to edit parameters on page A
+ sendControlCommand(MIDI_CONTROL_HIGH_PAGE, 0x0); // Disable poly pressure to edit parameters on page B
+ sendControlCommand(MASTER_VOLUME, _masterVolume <= 127 ? _masterVolume : 92); // Set master volume to 92, this matches the Virus TI in USB mode
+ sendControlCommand(MASTER_TUNE, 64); // Set master tune to 0
+ sendControlCommand(DEVICE_ID, OMNI_DEVICE_ID); // Set device ID to Omni
}
void Microcontroller::createDefaultState()
diff --git a/source/virusLib/microcontroller.h b/source/virusLib/microcontroller.h
@@ -36,7 +36,7 @@ public:
bool requestMulti(BankNumber _bank, uint8_t _program, TPreset& _data);
bool requestSingle(BankNumber _bank, uint8_t _program, TPreset& _data);
- void sendInitControlCommands();
+ void sendInitControlCommands(uint8_t _masterVolume = 0xff);
void createDefaultState();
void process();