Fix MIDI Feedback laggy/glitchiness #542
Draft
+55
−57
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.
Moves MIDI feedback to run in UI loop immediately after getting new MIDI values from audio->UI param sync.
This fixes glitchy behavior where the audio thread has sent new CC values to UI thread, but the MIDI feedback routine is using old values because it's being run before the UI has a chance to read the new values.
With this PR, the MIDI feedback output happens right after the UI receives new values. There might be more latency in the feedback (MetaModule -> controller, not controller->MetaModule) if the GUI is overwhelmed,
but the values should always be correctand this adds no additional load to the audio thread.Values sent as feedback will be correct when a patch is first loaded or refreshed. But they might be incorrect if the MIDI controller knobs are being turned at the same time the internal parameters are changing due to other reasons (knob mappings, or module is changing its own values).
Needs further testing especially with loading patches with different mappings, changing MIDI mappings, etc.
This might also fix #533 (?)