Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove old comment about RPN messages sent by Logic, clean up the explanation #7264

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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