-
Notifications
You must be signed in to change notification settings - Fork 404
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
Slightly improve our borked Program Change implementation #6987
Comments
so I think you change this to
that traversal is a bit painful but this is an infrequent operation basically you travers categories in order starting at the first user vcategory ugh i will write this up more properly if you get stuck. look at the Patch Selector for the data structures |
Big brain thinking: shall we store a list of patches found in "MIDI Programs" folder in a list when we refresh patch browser instead? Cache it so then it's O(1)? Then if folder not found just fill it with first 128 ordered patches to keep things O(1). |
Who really cares about the order - this is an infrequent thing. But I like the idea of looking for a midi category |
Dunno I think caching is a good idea just to be on the safe side... Also, u-he does it too. Haha. 😛 Can never know if somebody creates a garbled mess of incoming MIDI. Or realtime editing a program change event in a host can be sent in realtime too (esp on mousewheel gesture etc)... |
so the traversal is the same one we do on every menu build and mouse wheel alternately we could, in the surge storage scan, build the cache if you want. that's fine too! Just rebuild it in refresh_patch_list and make it a member on storage. midi number to patch id. |
Link to #576 |
So the way it works currently it just goes from first factory patch if Program Change 0 is sent, onwards, alphabetically as sorted in the patch browser menu.
Let's change this so that it first searches for a user category called "MIDI Programs", if that is not found start from first user patch instead.
The text was updated successfully, but these errors were encountered: