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

Clarity to RPN/NRPN #553

Closed
esaruoho opened this issue Feb 9, 2019 · 5 comments
Closed

Clarity to RPN/NRPN #553

esaruoho opened this issue Feb 9, 2019 · 5 comments
Labels
MIDI MIDI support related

Comments

@esaruoho
Copy link
Collaborator

esaruoho commented Feb 9, 2019

as per what is here

src/common/SurgeSynthesizer.cpp:   if ((cc == 6) || (cc == 38)) // handle RPN/NRPNs (untested)

would be good to set up RPN/NRPN in Surge so it is tested and works as expected. somewhat related to #552

@esaruoho
Copy link
Collaborator Author

esaruoho commented Feb 9, 2019

Related to NRPN

libs/AUPublic/SynthElement.cpp: mActiveNRPN = 0;
libs/AUPublic/SynthElement.h:   UInt16 mActiveNRPN;
src/common/SurgeStorage.h:   int nrpn[2], nrpn_v[2];
src/common/SurgeStorage.h:   bool nrpn_last;
src/common/SurgeSynthesizer.cpp:void SurgeSynthesizer::onRPN(int channel, int lsbRPN, int msbRPN, int lsbValue, int msbValue)
src/common/SurgeSynthesizer.cpp:     for each channel. Which seems unrelated to the spec. But as a result the original onRPN code
src/common/SurgeSynthesizer.cpp:void SurgeSynthesizer::onNRPN(int channel, int lsbNRPN, int msbNRPN, int lsbValue, int msbValue)
src/common/SurgeSynthesizer.cpp:   // store all possible NRPN & RPNs in a short array .. just amounts for 128kb or thereabouts
src/common/SurgeSynthesizer.cpp:      if (channelState[channel].nrpn_last)
src/common/SurgeSynthesizer.cpp:         channelState[channel].nrpn_v[1] = value;
src/common/SurgeSynthesizer.cpp:         onNRPN(channel, channelState[channel].nrpn[0], channelState[channel].nrpn[1],
src/common/SurgeSynthesizer.cpp:                channelState[channel].nrpn_v[0], channelState[channel].nrpn_v[1]);
src/common/SurgeSynthesizer.cpp:         onRPN(channel, channelState[channel].rpn[0], channelState[channel].rpn[1],
src/common/SurgeSynthesizer.cpp:      if (channelState[channel].nrpn_last)
src/common/SurgeSynthesizer.cpp:         channelState[channel].nrpn_v[0] = value;
src/common/SurgeSynthesizer.cpp:   case 98: // NRPN LSB
src/common/SurgeSynthesizer.cpp:      channelState[channel].nrpn[0] = value;
src/common/SurgeSynthesizer.cpp:      channelState[channel].nrpn_last = true;
src/common/SurgeSynthesizer.cpp:   case 99: // NRPN MSB
src/common/SurgeSynthesizer.cpp:      channelState[channel].nrpn[1] = value;
src/common/SurgeSynthesizer.cpp:      channelState[channel].nrpn_last = true;
src/common/SurgeSynthesizer.cpp:      channelState[channel].nrpn_last = false;
src/common/SurgeSynthesizer.cpp:      channelState[channel].nrpn_last = false;
src/common/SurgeSynthesizer.cpp:   if ((cc == 6) || (cc == 38)) // handle RPN/NRPNs (untested)
src/common/SurgeSynthesizer.cpp:      if (channelState[channel].nrpn_last)
src/common/SurgeSynthesizer.cpp:         tv = (channelState[channel].nrpn_v[1] << 7) + channelState[channel].nrpn_v[0];
src/common/SurgeSynthesizer.cpp:         cnum = (channelState[channel].nrpn[1] << 7) + channelState[channel].nrpn[0];
src/common/SurgeSynthesizer.cpp:      int cmode = channelState[channel].nrpn_last;
src/common/SurgeSynthesizer.h:   void onRPN(int channel, int lsbRPN, int msbRPN, int lsbValue, int msbValue);
src/common/SurgeSynthesizer.h:   void onNRPN(int channel, int lsbNRPN, int msbNRPN, int lsbValue, int msbValue);
src/common/gui/SurgeGUIEditor.cpp:      sprintf(txt, "NRPN %i", num);

@baconpaul
Copy link
Collaborator

oh there's a lot fo interaction between that and the MPE stuff.
What is it you want to change?

@esaruoho
Copy link
Collaborator Author

esaruoho commented Feb 9, 2019

@baconpaul well, am hoping to be able to update the manual with information re which CC + NRPN/RPN can be used to control Surge out-of-the-box. hence the start at https://surge-synthesizer.github.io/manual/#cc--continuous-controller-information

I could always make this more precise in wording - this isn't about wrecking MPE :)

@baconpaul
Copy link
Collaborator

Check out the comment in SurgeSynthesizer::onRPN to see why I was a little nervous! But basically the only thing we seem to use RPN for is activating MPE in current code. onNRPN is implemented as {}

@baconpaul baconpaul added the MIDI MIDI support related label Feb 20, 2019
@baconpaul baconpaul added this to the 1.6.n milestone Feb 24, 2019
@baconpaul baconpaul modified the milestones: 1.6.n, Currently Unscheduled Oct 4, 2019
@baconpaul
Copy link
Collaborator

I don't think there's anything to be done here so I'm closing this year old issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MIDI MIDI support related
Projects
None yet
Development

No branches or pull requests

3 participants