Skip to content

Commit

Permalink
Remove old comment about RPN messages sent by Logic, clean up the exp…
Browse files Browse the repository at this point in the history
  • Loading branch information
mkruselj authored Oct 20, 2023
1 parent e48b841 commit d5439c8
Showing 1 changed file with 9 additions and 29 deletions.
38 changes: 9 additions & 29 deletions src/common/SurgeSynthesizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2012,38 +2012,18 @@ 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
Bn 06 mm
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)
{
Expand All @@ -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;
}
}
Expand Down

0 comments on commit d5439c8

Please sign in to comment.