Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
My first attempt at implementating NRPN into HISE
INFO:
I am working on a project that primarily uses NRPNs to control anything I want the user to customize. I realized that I would need to use the OnControll scripting callback with a switch case of the CC number for numnbers 98,99,38, and 06. I felt like it would be too cluttered to do it in scripting so I tried my hand at introducing NRPN parsing to the source code of HISE.
The immediate red flag in this code would be changing the allignment of the HiseEvent calss to 32 as I added a few parameters and functions in that class whcih increased the class size. I think that creating a child HiseEvent class may solve the issue but I haven't gotten around to tried that. I can see how the change in allignment would be detrimental to the speed and memory usage of HISE. The new variables added to the class are parameterNumber and NRPNValue with their appropriate setters and getters. Again I realize this definitely messes with the compactness of the original allignment of the class but its what I have right now.
I looking at the JUCE modules and found a lot of their NRPN handling methods but I ended up just using a switch case in the MidiProcessorChain::renderNextHiseEventBuffer function in MidiProcessor.cpp. The NRPN messages stay in the buffer like normal until they are processed by the scripting processor, when they are only processed as a single event with a parameterNumber and NRPN Value. I also added a new scripting callback call onNRPNController.
I added a single method into JUCE's MidiMessage class to detect if a MidiMessage is an NRPN message (isNRPNController()) which is intented to be used with isController which would first determine if its a CC Controller message.
I am posting this here in hopes that someone can find a much more efficient way to parse NRPNs or helping to actually utilize the JUCE NRPN parsing methods. The event allignment change is the biggest issue in my opinion.
Scripting Callback handing of NRPN: