Script Question for LED Feedback Rings

Hey,

have a question to the example script APC-40-Knob-Memory.

 

I wanted to get the LED feedback for all 16 Rings from the MK II knobs.

For the 8 above knobs, they run perfect on all channels.

Now I wanted to duplicate my LED rings from 8 to 16.

I have set for the 8 other knobs following variables:

y0-y7 - first of all tried to make them with the samw value of qq, then with a seperate value variable yy.

Gaved 8 other doppel variables like oo, pp, qq.

But nothing seems to work right.

What could be the mistake in it?

Maybe in the update rings :

gc=gc-1

pp=gc+48?

Have to be another calculation here?

In the same rules I wrote:

if gc==15 then qq=y7 if gc==14 then qq=y6 if gc==13 then qq=y5 if gc==12 then qq=y4 if gc==11 then qq=y3 if gc==10 then qq=y2 if gc==9 then qq=y1 if gc==8 then qq=y0 if gc==7 then qq=z7 if gc==6 then qq=z6 if gc==5 then qq=z5 if gc==4 then qq=z4 if gc==3 then qq=z3 if gc==2 then qq=z2 if gc==1 then qq=z1 if gc==0 then qq=z0

 

Tried out to change the gc=8 to gc=16 but this isn`t too.

In the Channel Changer I wrote per Channel 8 more (other) variables with the temp y0-y7, but this didn`t work too.

Can`t understand why the translators didn`t wanna work.

 

 

kindest regards

Mike

Hi, Mike,

Post an example project (not the big project) of what you have so far and I will take a look.

Steve

Oh and remember, changing the variable values themselves will not update the rings. You actually have to send the values to the rings as CC messages as well.

Hey Steve,

 

thanks a lot to take a look on it. I am apreciate your support so much.

I made a preset especially for the LED feedback.

And put all other translators on seperate preset for a clean overview.

Hope you understand what I´ve tried.

 

kindest regards

Mike


Attachments:
1573520145405_LED-Feedback-Knobs-from-right-side.bmtp

OK, it appears you are updating the global variables correctly but you don’t have anything that update the LED rings when you do a channel switch. The upper knobs are using the timer in 6.1 to update the LED rings of the upper knobs but you need either another timer or to extend the timer to also update the rings of the right knobs when switching channels.

qq will need to be the value of the knob and pp will need to be which cc number for that knob.

The knobs on the top go from cc 0x30 to 0x37 (48-55) and the knobs on the right go from cc 9×10 to 0x17 (16-23).

For each step in the counter, you will need to use a condition from 15 to 0 indicating both the knob number and the knob value. You will need to change the number of iterations (gc) for the timer in 6.0 from 8 to 16.

 

I don’t see any of this in the project file you sent me.

 

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

 

 

 

 

I have tried this, with gave another variable for the 8 right knobs. The Ring counter is gd=8 and the calculating for the new CCs is:
gd=gd-1
zz=gd+16

LED ring counter is gd, put all gc to gd and did 8 new double variables like: ii,jj,hh etc.
Converted the CC variable pp to zz and gave the knob value the variable yy.
So far is everything okey. Now, if I change the channels, all lights go out from the LED rings.
Tested the example project with changing the 2 knobs above from the 2 channels to the 2 first knobs on the right. All is running perfect, after changing in the 6.1 – gc=gc-1 / pp=gc+16

But of I make a double project with all other variables didn`t wanna run correct.
Could it be, that the gc=8 on the first row and the gd=8 in the second row didn`t run paralel?
I have tested gc=8 and gd=16
Gave gc variables from 0-7 and gd variables from 8-15
But this is the same problem, all LED rings go off after press a channel button.

kindest regards
Mike

Hi Mike,
As you called double variables oo-xx are local variables and their values are destroyed outside of the local translator and undefined as you enter a translator. For all of your assigned knobs, you need to use global variables which are static and do not lose their values. Global variables start with g-n or y-z and are visible to all translators.

In general you should use local variables, when you do not need them outside of a given translator or you want to use them for other purposes and don’t want to have name collision with an existing global variable.

In contrast, you want global variables to be visible, everywhere in your project.

At project start, global variables are all set to 0, so if you need to set them to something else, you would need to do so at project start in rules.

In contrast, local variables have an undefined value (could be any random) until you define them. Coming back to the same translator later, it will not be remembered from the last iteration.

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

Press F1 or go to help menu in MT Pro and you can find this information in the PDF version of the MT Pro manual.

Hey Steve,

thank you so much for your good explaining.
This is allright and I only did change first of all the variables I know I can change:
I`ve made as test a duplicate with the examples project from the above knobs which works 100% correct on all 8 channels.
And only tried to change the knobs from above to the right side. This seems like to be not the same thing.
So I find out, that I have to do this small changes for the first:

gc=gc-1
pp=gc+16

Now I got with the big project a result. I can use the 8 right knobs perfect without the 8 knobs above.
Did you remember, that we wrote the “Takeover/Crossover” project for the MIDImix with the last saved point, on the channel change?

I have decided to use these template for channel change to the MK II.
One big mistake is in it. I think, it is a difference if I use, 3 Rows and 1 Fader to 2 Rows and 1 Fader.
I have edited the big script to the MK II and find out, that this only runs, if the LED feedbacks runs correct too.
Now I have the problem, to get the knobs above with the knobs on the right side together and the faders need for correct usage with the “MIDImix” template, a “virtual” LED feedback to run clean too.
The MIDImix template use other global variables as the LED feedback because I`ve edited the variables from the LED updater….
But I can`t fusion the 3 rows together with the right LED feedback…

It would be a big help, if I could understand, how the 3 rows can work together, with the LED feedback. This is really confused….

kindest regards
Mike

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.

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

Hey Steve,

thank you so much for sharing your thoughts.
Yeah! I think it too, that would be a variable problem. That was the reason why I have tried to change some global variables in LED feedback.
The good news are. I have solved the problem why the upper knobs run and the right knobs didn`t wanted run perfect at the LED feedback.
I have used your tip with the logfile. On one I had your example on the other my logfile and I could saw the mistake. It was a line which I didn`t edited with the new global variables. Now all 16 knobs runs perfect with LED feedback from the rings. I was big confused why this didn`t want run and thought that I nothing understood. But with correct the mistake, now I looking forward to the big thing 🙂

I wanna try to do this solution:

Using the same global variable on the LED feedback as we did on the “saved last point of the value” (from the MIDImix example) to combine the same last saved points with LED. The LED feedback have to be everytime on the same place as the last saved point from the current channel. Normally this should be work.
First of all 8 Channels would be enough I think.
Let us forget the MIDImix on this big thing. If the time comes, we could try to fusion this. But for now, I am happy with perfect working of the MIDImix, with your amazing support!
Now I need a good work with the MK II.

I think I can solve this, after your big help and explaining to understand it.
Let`s have a look for it.

I am appreciate so much to taking your time and help.
Thank you Steve!

Kindest regards
Mike

OK, Mike,
Not sure from your response if you are asking for something right now but I’m glad to see you are now getting the hang of troubleshooting techniques. I often use the logging function to debug my stuff. For rules, stepping through them one at a time is usually the way to uncover rules related problems although it can be a little exhausting, especially if you have a lot going on in your project. To reduce the output, I often disable a number of translators and/or presets but that is not also possible, especially when you have a lot of interaction between different translators and presets. There are a few enhancements I’ve requested to help the troubleshooting process but these enhancement are lower in priority that some other requests. Right now, my top request would be to have the ability to have global variable arrays. For instance ga[0} through ga[127] would be WONDERFUL. It would provide more variable space and easier variable management.
I know Florian has a lot on his plate though and adding a feature like this and making things backward compatible with previous versions may be a huge undertaking.

Anyway, I will continue to be available for tips and coaching as required.

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

Hey Steve,

the second question was, (after my unseen edit mistake in the scirpt), if I could give the LED feedback from the rings the same variable as the last saved value from each knob. But after asking this and looking at my script, I found the answer by myself. Yes it runs but would be a little bit difficult, because we did in the past for 1 variable 4 different values, that would mean, I should use the same work for the LED rings as for the last saved points from the value and try to change the global variable for the faders, which don`t have LED feedback.
Or I let them run with the LED feedback too as a safe point for the other values, which would mean,

I use a similar script in the Rules like this from the “last save knobs” I solved this first of all in another way, which works amazing!

I think so too, that Florian has enough to do. But have to say, I am very happy to find out the BMT after searching for results how people solved their MIDI tricky ways. BMT is really amazing!
I think that would be not so easy to use without your fast answers and clear coaching.
It is an enrichment for so much people and me.
With your amazing support and help it is a little bit easier to find the light in this matter. Especially for people, who didn`t learn to program something in this way .
I didn`t know much about programming, but with your clear statements it`s really more easy to use BMT in good ways.
It would be really awesome, if this would be realized and we could get a chance for more unique global variables in the future. I am all for this!
We would have so many new possibiities that`s unbelievable! 🙂

kindest regards
Mike

Glad to help, Mike!

As far as faders, you should probably suppress any LED ring messages back to them. Some APC devices crash if you send them fader values (IE APC-MINI).

For faders, you might want to implement crossover points as you did with your MIDIMIX. For LED rings, just update the ring position.

As a general rule, LED ring updates should be changed at MIDI channel switch (for all knobs) and for just the knob your moving (for real time).

You might want to experiment with APC-40 Mode 1 as I think it allows local update of LED rings as well as LED feedback. If this is true, you would not need the real-time LED ring updates when you move the knob, but you would still need to capture the value for future channel switch. I really haven’t experimented with Mode 1 but if I read correctly, this may be how it works.

Steve Caldwell
Bome Q and A Moderator and
Independent Bome Consultant/Specialist
bome@sniz.biz

And yes, I know that more global variables and variables with more meaningful names are on Florian’s list for future enhancements.