## Yet another question about graphics elements

Scope and XITE Development

Original topic on PlanetZ: https://forums.scopeusers.com/viewtopic.php?t=24648

#### Yet another question about graphics elements

Posted: Sun Mar 09, 2008 7:51 am
by Warp69
Hi All,
I have yet another question about graphics in SDK:
How do I create "-" and "+" buttons with the following range [0;6]. When you press the "+" button the value increases with one and the "-" decreases the value with one..
I choose 2 button.mdl modules with the following parameters :
Plus button :
Min: 0
Max: 6
Step: 1
Function: 1
Disable: 0
CtrlNr: -1 (?!?! - have no idea what this means)
Minus button :
Min: 0
Max: 6
Step: 1
Function: 1
Disable: 0
CtrlNr: -1
I connect the both the val parameter and I get the behaviour Im looking for, except that the system wraps back to Minimum if you press the plus button one more time at Maximum value. Thats not the case the other way around - wraps to Maximum?!?!?!
I would appreciate some help with this one.
Kind regards

#### Re: Yet another question about graphics elements

Posted: Mon Mar 10, 2008 4:38 am
by Shroomz~>

> Warp69 wrote:CtrlNr: -1 (?!?! - have no idea what this means)

That's for setting a continuous controller number on the fly for that particular control, in this case a button.
As for your main problem, I had the same issue with the up/down buttons on the HighTimes VU meter & didn't resolve it back then. I'm quite sure there's a simple solution to this, but I'm not back to working in the studio for another day or 2 so can't take another look at the issue tell then. I guess you'll have figured it out by then anyway.
M

####

Posted: Mon Mar 10, 2008 10:29 am
by astroman
I just tried it out with a handful of devices and it's the regular behaviour of about every contol examined.
Using the mouse-dial to increment-decrement it stops at minimum, but jumps from maximum to minimum
looks like a small function is needed to nail it to the final value...
cheers, Tom

####

Posted: Mon Mar 10, 2008 12:16 pm
by hifiboom
I`ve come across the same problem some time ago, but I know of no solution at the moment.
I think CW simply didn`t built in such features because there was no need till now (also regarding you knob alligment problem you had)
It would be somehow useful if the sdk gets a feature update in the future also.(maybe some new atoms regarding circuit design too)
lets see what happens once SC has finsihed their hardware developments.
Maybe they will put some attention to improve the sdk also.
IMO the best is to sent this feature request or problems to Ralf.
I`ve done this already.
even better:
would be a small database where we collect the little problems and SC can have an easy look into that database and fix them in a rush.
I don`t know if they have intrest but it would be in the favour of the platform.
That was the worfklow when I worked for a local bigger sized OEM computer manufacturer. All little problems were collected in some sort of database and fixed continiously.
If we can setup a little database, I think that would help alot.
An Excel sheet would be sufficiant already, but cannot be accessed that nicely from different sdk guys at the same time through the internet.

####

Posted: Tue Mar 11, 2008 3:28 am
by Warp69
Hi All,
Thank you for your responses.
Unfortunately the STM mixes doesn't have this behaviour when you scroll through the channels in the right corner?! So you should be able to fix it.
Cheers

####

Posted: Tue Mar 11, 2008 5:09 am
by Shroomz~>
Yeh, it should definately be possible. Did you already try the existing +/- button that's in the surface design folder? Still not in the studio, so I can't check it myself.

####

Posted: Tue Mar 11, 2008 5:16 am
by Warp69

> <~Shroomz~> wrote:Yeh, it should definately be possible. Did you already try the existing +/- button that's in the surface design folder? Still not in the studio, so I can't check it myself.

Unfortunately - no. I dont have those modules in my surface design folder.

####

Posted: Tue Mar 11, 2008 6:13 am
by hifiboom
I checked both up and down and + and - buttons, all have this same behaviour...
You could even try to mess around with incremental increase and feedback.
When you switch function to a higher value , and max/min to 0/1 you can make the button go to value 1 once you hit and 0 when you release the button.
now make a feedback add/subtract chain, and connect + button to add and - to subtract atom.
It works but then you still need a min/max(0/6) limitation inside this circuit...

#### Re: Yet another question about graphics elements

Posted: Wed Mar 12, 2008 5:52 am
by Shroomz~>

> Warp69 wrote:How do I create "-" and "+" buttons with the following range [0;6]. When you press the "+" button the value increases with one and the "-" decreases the value with one..
> I choose 2 button.mdl modules with the following parameters :
> Plus button :
> Min: 0
> Max: 6
> Step: 1
> Function: 1
> Disable: 0
> CtrlNr: -1 (?!?! - have no idea what this means)
> Minus button :
> Min: 0
> Max: 6
> Step: 1
> Function: 1
> Disable: 0
> CtrlNr: -1

Hi Martin,
I'm back in the studio today & figured out a very simple solution to this problem. Basically all you need to do is set the max value of the minus button to one higher than you need, so your two sets of button parameter values should look like this:-
Plus button :
Min: 0
Max: 6
Step: 1
Function: 1
Disable: 0
CtrlNr: -1
Minus button :
Min: 0
Max: 7
Step: -1
Function: 1
Disable: 0
CtrlNr: -1
Note that the Minus button's step value should be -1, not 1.
So, this will now work as you want it to & without using any unnessesary logic. A connection example (for anyone new to sdk) would be to simply connect both +&- buttons to a text fader val & also connect the text fader val to your destination such as a switch val selector, midi channel selector or whatever.
There you go Warp..
cheers,
Shroomz

####

Posted: Wed Mar 12, 2008 6:09 am
by Shroomz~>
bw, that solution doesn't fix the wrap around back to zero issue. It fixes the issue whereby when you're on the max value & press the minus button it jumps back to 0. Instead it will now behave normally in that case & go from say 6 back to 5 instead of jumping to 0 when the minus button is pressed. Hope that makes sense.

####

Posted: Wed Mar 12, 2008 7:57 am
by Shroomz~>
Warp... Solved that wrap around from max to min issue as well. Just connect the plus button val pad to a logic IF module IN. Set the IF value to the same as your plus button's max value, ValYes = 1, ValNo = 0, then connect the IF module OUT to the Disabled pad of your plus button. Now it will stop at the max value & it won't wrap around. Phew, done.
cheers
Shroomz

####

Posted: Wed Mar 12, 2008 8:10 am
by katano
this is cool!! it should be done on all old devices, too, because i hate it so much when it jumps to 0.

####

Posted: Wed Mar 12, 2008 9:53 am
by Warp69
Hi Shroomz,
This is just awesome - I'll try it when I get home from the Messe. There's so much to tell
Thank you very much for your help.
Kind regards
Martin

####

Posted: Wed Mar 12, 2008 11:42 am
by Shroomz~>
No problem at all. I wanted to figure this out for my own devices which have virtual graphic lcd displays or surface sections/areas with up & down page buttons. So, figuring it out now sort of killed at least 2 birds with one stone.

####

Posted: Mon Mar 17, 2008 4:56 am
by Warp69
Hi Shroomz and tgstgs,
Thank you for the solution, but as tgstgs pointed out : the animation stops before going back to normal state and therefore the button stays ON. Tgstgs did come with a solution for that problem, but I chose another approach :
Still using the IF module in the example from Shroomz, but connected the OUT to the "Step" pad and changed the "Max" values to Max+1 on the plus button. Problem solved.
IF module :
ValIF : Max-1
ValYes : 0
ValNo : 1
In : (connected to the "Val" pad of the plus button)
Out: (connected to the "Step" pad of the plus button)
Condition : >
Thank for all your help.
Cheers

####

Posted: Thu Mar 20, 2008 6:07 am
by tgstgs
a lot of way dont work some do;
theres never only one -> thats the fun;
choose which fits most for you;
good vibes

####

Posted: Thu Mar 20, 2008 9:29 am
by Shroomz~>
Yes, there's normally many ways to skin a cat.
Glad you found a solution Warp.