Great effort!
I had some ideas for my MBPV (
https://forum.arturia.com/index.php?topic=108585.0 ) to include similar features (get patches directly from MB, show button movement etc) but ran into a long break on developement after v.1 - time will show if I continue on v.2 soon or not (got inspired after testing your app!)
I suppose the data retrieved when you "get" a patch matches the data starting after this part of the serialized string (in a .mbp file) and it need to be converted from 1600 7bit to 1400 8bit values as described by mkoch.
22 serialization::archive 10 0 4 4 1600 12 FallingFifth 5 0 0 18 000000100100100000 0 0 16 1536 .....
and the header contains at least the name (here
Init) and the slot (here
0F 0E = P15)
[45] F0 00 20 6B 06 01 6A 23 52
0F 0E 00 04 40 00 02 20 7E 00 01 20
49 6E 69 74 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 F7
[10] F0 00 20 6B 06 01 6B 00 15 F7
Note that there is 2 different formats (at least in data saved from MCC, probably also in the midi-data), depending on if the patch was created in firmware 1 or FW2. If uploading a FW1 patch to a MB running FW2 it will not be updated to FW2-format until the patch is edited & saved on the MB. I have decoded most of the format for both patch & sequence (based on mkoch's starting point). It's not a lot of overlaps in the two formats, but f.ex in FW1 each matrix button "is used" flag is stored as 2 bytes (16x16x2=512 bytes) but in FW2 it is packed 28x16 "is used" into 32 bytes (1 bit per button) to free up space for other things (more matrix buttons, custom LFOs). That will probably not affect your app as long as you just use data for the knows that accepts CC. I can publish my complete decoding later, just need to clean it up.
I also did some quick testing of your app and sum it up so far as follows:
in short: a bug when output channel <> input channel blocks data from app->Mb in some cases, see below
Working:- Connects to MB and shows correct in / out midi channel (mine: 1 & 14)
- "Get patch" updates panel in app
- Knobs in app follows knob on MB
Not working (on my setup):- Turning knob in app do not affect sound/setting on the MB:
- F.ex master cutoff Sends this "BD 1B 15 --- BD 3B 0F", which is "CC on channel 14 for controller 27 MSB / LSB"
- When testing with Reaper it records & plays pack movement of the Master Cutoff fine (but I had to put midich to 1).
-
Fix? I suspect you need to adjust the channel to what the app discovers as "Midi in channel" (on mine its 1), not the Midi out channel" (mine:14) which you probably use for updating knobs in the app. I confirmed this by changing my out channel to 1 on the MB, then app->MB knobs works!- "Select patch":
- Gets the correct name in "Preset"- window
- Nothing is changed in app on panel
<-- This is same cause as above, works if midi in and out is same channel! Then a strange bug:
-Knobs updating in app suddenly stopped working
- I could not reproduce with some tries, but I was doing sth like this
- in app: selecting a few patches, then getting a few
- pressing "panel", then unpress "panel"
- Holding Preset, then turning a knob (to see value), then releasing
- To fix, I turned MB off then on, and did disconnect+connect in app (did not try disconnet/reconnect app before turning off)