Well since this has been created from a hodge podge of different questions, I think the key thing to work on next is a global variable map and how each are going to be used. I suspect we have some variable collision somewhere.
If I remember right on the MIDIMIX we defined the columns as g-n for columns 1-8 which are all global variables. Now we have 8 more knobs so we are out of columns for the right hand knobs unless we create another scheme for these.
We then had channels as the second portion 0-F
So g0 column 1 MIDI CH 1
mf was column 8 MIDI CH 16
(or something like this)
So the first order of business is to determine EVERY GLOBAL you want to use and its meaning so that we avoid global variable collision/re-use. If we start to run out of global variables, we can then bit map them to use 1 variable for 4 values (28 bits) as we did in a separate exercises.
The key is that the variable selection strategy has to be set in advance so we don’t trip over ourselves in the future. For this reason, I usually document all used global variables in a single translator for future reference.
So now it is time to re-look at the project and all of the variables assigned and then set up a strategy for what is left over and perhaps even redefine them if we are going to run out of room.
Once a global variable map is defined, we may just need to start over with the new map. Either that or look at the two projects and analyze every global variable used in both and re-assign those that may collide.
Now to your question – 3 rows with LED feedback. If each row has 8 knobs, then you have a total of 24 (3*8) values you need to track (per MIDI channel). If you want to control 16 channels, then it would either take 384 global variables (if not using bitmapping) or 96 (if you bit map them into 4 chunks each).
The logic for bit mapping would be to take the value coming in from your controller, stuffing the bits into the proper global variable.
For extraction (LED update) the logic would be to grab the proper global variable, extract the bits for that LED ring and the send it out.
On each iteration of the timer, you would use the iteration count to determine which global variable to use, which bits within the global variable to extract, and which CC to send the value to for controlling the LED ring.
These techniques are already used in the examples I provided you. If you need help for putting together the entire project, then reach out to me via email for paid services. Even then, I would need to know the complete requirements for the project to be able to put it together for you.
Merging different project example to create one bigger project would even be difficult for me and I would probably just start by re-mapping the entire project (which yes, can be time consuming).
Ones global variable mapping is done, we then segment the tasks/rules required for bit stuffing, bit extraction, LED updating, etc. Of course changing the variable structure would require re-writing the variable and bit manipulation routines.
Bome Q and A Moderator and
Independent Bome Consultant/Specialist