diff --git a/src/common/SurgeSynthesizer.cpp b/src/common/SurgeSynthesizer.cpp index 28eabd3718a..43197b23fd1 100644 --- a/src/common/SurgeSynthesizer.cpp +++ b/src/common/SurgeSynthesizer.cpp @@ -2012,9 +2012,8 @@ void SurgeSynthesizer::sendParameterAutomation(long index, float value) void SurgeSynthesizer::onRPN(int channel, int lsbRPN, int msbRPN, int lsbValue, int msbValue) { - /* OK there are two things we are dealing with here. - - 1: The MPE specification v1.0 section 2.1.1 says the message format for RPN is + /* The MPE specification v1.0 section 2.1.1 says the RPN message format for MPE Configuration + Message is: Bn 64 06 Bn 65 00 @@ -2022,28 +2021,9 @@ void SurgeSynthesizer::onRPN(int channel, int lsbRPN, int msbRPN, int lsbValue, where n = 0 is lower zone, n=F is upper zone, all others are invalid mm=0 means no MPE and mm=1->F is zone. - - So you would think Roli Seaboard would send, since it is one zone - - B0 64 06 B0 65 00 B0 06 0F - - and be done with it. If it did, this code would work. - - But it doesn't. At least with Roli Seaboard Firmware 1.1.7. - - Instead on *each* channel it sends: - - Bn 64 04 Bn 64 0 Bn 06 00 - Bn 64 03 Bn 64 0 Bn 06 00 - - Which seems unrelated to the spec. But as a result, the original onRPN() code - means you get no MPE with Roli Seaboard. - - EDIT: Those aren't coming from Roli, they are coming from Logic, and now that we correctly - modify and stream MPE state, we should not listen to those messages! */ - if (lsbRPN == 0 && msbRPN == 0) // PITCH BEND RANGE + if (lsbRPN == 0 && msbRPN == 0) // pitch bend range { if (channel == 1) { @@ -2058,19 +2038,19 @@ void SurgeSynthesizer::onRPN(int channel, int lsbRPN, int msbRPN, int lsbValue, { mpeEnabled = msbValue > 0; mpeVoices = msbValue & 0xF; + if (storage.mpePitchBendRange < 0.0f) + { storage.mpePitchBendRange = Surge::Storage::getUserDefaultValue( &storage, Surge::Storage::MPEPitchBendRange, 48); + } + mpeGlobalPitchBendRange = 0; + return; } - else if (lsbRPN == 4 && msbRPN == 0 && channel != 0 && channel != 0xF) + else // we don't support any other RPN message at this time { - /* - ** This is code sent by Logic in all cases for some reason. In ancient times - ** we thought it came from a Roli. But since we changed the MPE state management so - ** from 1.6.5 onwards do this: - */ return; } }