Setting Bargraph Hi/Lo
vining
Posts: 4,368
Does anyone know if the commands for setting bargraph hi/lo (^GLL-/^GLH- or ^BMF %GLx%GHx) works on multi-state bargraph or just bargraphs.
I thought I'd be slick and create generic multi-state bargraph buttons and pre-define them in TPD4 with 21 states and a range lo of 0 and hi of 20 which would have more states then any button needed. Then in code I would set the lo/hi based on length of the array I use to populate the individual states. I often use sending levels instead of sending variable text when ever the states are known and can be pre-defined. I leave VT for "variable" text, duh.
In the past I would just defined the button parameters in TPD4 and then just send the button text from code but since it's such a pain in the butt to change in TPD4 if you want to shift states around or say add another state to the begining so I figure using the hi-lo commands would work but the various attempts I made yesterday didn't.
Anyone know for sure these work on multi-state bargraphs? Once I defined the correct counts and hi/lo the states populated correctly but what's the point of hi/lo commands if you have to pre-define in TPD4. I know the commands do work for plain old bargraphs as I've used them for displaying the play time of tracks which obviously change from trk to trk but I don't know about the multi-state bargraphs. Any one been here, done that?
I thought I'd be slick and create generic multi-state bargraph buttons and pre-define them in TPD4 with 21 states and a range lo of 0 and hi of 20 which would have more states then any button needed. Then in code I would set the lo/hi based on length of the array I use to populate the individual states. I often use sending levels instead of sending variable text when ever the states are known and can be pre-defined. I leave VT for "variable" text, duh.
In the past I would just defined the button parameters in TPD4 and then just send the button text from code but since it's such a pain in the butt to change in TPD4 if you want to shift states around or say add another state to the begining so I figure using the hi-lo commands would work but the various attempts I made yesterday didn't.
Anyone know for sure these work on multi-state bargraphs? Once I defined the correct counts and hi/lo the states populated correctly but what's the point of hi/lo commands if you have to pre-define in TPD4. I know the commands do work for plain old bargraphs as I've used them for displaying the play time of tracks which obviously change from trk to trk but I don't know about the multi-state bargraphs. Any one been here, done that?
0
Comments
Those commands should work for bargraphs and multi-state bargraphs. ms bargraphs are derived from bargraphs.
Here's the code I was using. I switched to ^BMF commands after the older commented out commands didn't seem to work. Originally I sent an array index for the TP coming online to 130 to allow 30 seconds after a master reboot but have since blocked that from running at all if the master coming online is the cause for the TP later coming online. Basically now when a TP comes online (not if iniated by the master's online) I would set a counter to 130 and start a timeline running at 1000ms to count this counter down. When the counter hit 100 I send the bargraph values and at 99 (highest state count) on down I send that state's VT that matches the counter. I have general numeric buttons 0-99, time buttons 0-59 and then a dozen or so VT buttons with a max of 16 states so I never send more than a dozen commands to any one TP in a pass (second count down).
I think this should have worked but didn't.
When I ramp the level value from 1 to 20 and back to 1, the states show up as expected. (I.e. level=1->state=1, level=2-> state=2, level=3->state=3,...level=20->state=20).
Then I change the upper limit to 10. When I ramp the level from 1 to 10, the states are scaled to display 1 to 20. (I.e. level=1->state=1, level=2-> state=3, level=3->state=5,...level=10->state=20).
The upper and lower limits set the level range limits, and the number of states are scaled to fit into that range. The number of states are not changed according to the range of the level limits.
This becomes more obvious when you look at it in the other direction. If there is a greater level range than there are states, the active level range for a state is scaled to level_range/num_states. The same state will be displayed for a range of level values. However, if there is a smaller level range than the number of states, there will be some states that are skipped when the number of states are scaled into the level range.
Maybe I'm reading into what your are trying to do something that is incorrect, but this is how the commands work on the ms bargraphs.
I just saw your post and I pretty much came to the same conclusion, thanks.
It might have work the way I wanted if I also had a command to set the number of states a button had. Then using these commands might have made sense since I wanted it to start at 0-x (x = num states -1) as opposed to 1-x (x = states). Then I could set the number of state and then the lo/hi depending if I needed 0 base or a 1 base (normal).