NOTE: BECAUSE THIS IS ALL CUSTOM SYSEX - THE D-50/D-05 NEEDS TO BE SET TO CHANNEL 16. This is hardcoded for now, sorry.
Basic structure is:
P-1: Patch Control
P-2: Upper Common
P-3: Upper Partial 1 - Waveform and TVA
P-4: Upper Partial 1 - TVF
P-5: Upper Partial 2 - Waveform and TVA
P-6: Upper Partial 2 - TVF
P-7: Lower Common
P-8: Lower Partial 1 - Waveform and TVA
P-9: Lower Partial 1 - TVF
P-10:Lower Partial 2 - Waveform and TVA
P-11:Lower Partial 2 - TVF
P-11:Lower Partial 2 - TVF
Source code is at the bottom of this post.
Functions are grouped wherever possible (especially the envelopes which are all on the bottom row). This enables simplification of labeling since there are essentially 4 different functions per knob.
A few things could be improved (when there are 4 possible values per knob it requires a fair amount of twisting, some values should be not just the "one-dot" mode, etc.