Quick Sign In:  

Forum: VirtualDJ Plugins

Topic: Button-Colors depends on the key-changes

This topic is old and might contain outdated or incorrect information.

SveninoPRO InfinityMember since 2009
Hi folks

I´m trying something with my Launchpad S Controller.
This is probably about the "get key_modifier" Command:

I want a button to light up as followed:
green if the key is set to +1
yellow if the key is set to +2
red if it is +3

I treid following:

(Green lamp) deck 1 key 1 ? on : off
(Green lamp) deck 1 key +1 ? on : off
(Green lamp) deck 1 get key_modifier 1 ? on : off

None of them has any effect.
Does anybody know the perfect use of the "key_modifier"-Command?
Do I have to set it to a "VAR" or something like this?

Thank You all
 

Posted Wed 23 Apr 14 @ 10:35 am
try something like:

get key_modifier & param_cast 'integer' & param_equal 0 ? get_constant value for green : param_equal 1 ? get_constant value for yellow : get_constant value for red

get constant will use a floating point "decimal" number to set the color of the led eg. get constant 0.5

not sure if it will work as I am at Uni and can't test. What you would really need to do is modify any textzone on a skin to see what 'get key_modifier' is giving you. apart from that you could use Phantoms watchdog plugin as that will give you the original key of a song, but that would be a hell of a lot of if statements, something like 144 and I don't think that will fit into the available space for mapping which is around 4000 characters per control.
 

Posted Wed 23 Apr 14 @ 6:47 pm
SveninoPRO InfinityMember since 2009
Thank You synthet1c

The "param_..."-thing gives me a small success.
it differs if the key is smaller or greater then zero.

So I can light the Button GREEN if the key is + something.
If it es in the - area the button lights RED.

GREEN LIGHT: get key_modifier & param_greater 0 ? on : off
RED LIGHT: get key_modifier & param_smaler 0 ? on : off

BUT! The difference between Key +1 (green) Key +2 (Yellow) and Key +3 (Red) is not to find.
The Skin gives me no answers about the value of "key_modifier", cause everything is made with text columns.
Or am I just to stupid?

If I transpose the key to +1 why the "key_modifier" doesn´t bring 1?
I even tried 58.33% as the value for transpose +1
NO WAY?

What is the "Key-modifier"´s use except smaller or bigger than 0?

I´m frustrated about this stupid script...
But again, thank You for Your Help

Any other ideas?



(Anyone?)
 

Posted Thu 24 Apr 14 @ 6:40 pm
with the skin just change the "format" attribute of any textzone to "get key_modifier & param_cast 'integer'" and it should print out the result on the screen, so you can see if it gives negative values.

try setting all the values:

get key_modifier & param_cast 'integer' & 
param_equal 0 ? get_constant green :
param_equal 1 ? get_constant yellow : param_equal -1 ? get_constant yellow :
param_equal 2 ? get_constant red : param_equal -2 ? get_constant red :
get_constant 0


the above script needs to have the spaces between the lines removed. It should make the led green if the key's are matched, yellow if they are off by one, red if they are off by 2, else off. Not sure if the integers go into negative numbers though. My last guess if that doesn't work is this:

get key_modifier & param_cast 'integer' & 
param_equal 1 ? get_constant yellow : param_equal -1 ? get_constant yellow :
param_equal 2 ? get_constant red : param_equal -2 ? get_constant red :
param_greater 2 ? get_constant 0 : param_smaller -2 ? get_constant 0 :
get_constant green
 

Posted Fri 25 Apr 14 @ 12:02 am
SveninoPRO InfinityMember since 2009
Sorry the skin-changes are not possible in this way.
There seems to be no "&" in the skin-programming.
This is unfortunately no way to find out the output of "get key_modifier"

My Test: <text font="arial" color="black" size="22" format="get key_modifier" scroll="yes" color="white"/>
gives me the following text on the screen:

get key_modifier

The Syntax for Skins seems to be slightly different

<text font="arial" color="black" size="22" format="%PKey" scroll="yes" color="white"/>

gives me the Key like "Em" or "F#m"...


By the way:
I think "get key_modifier" does´nt show the key-difference between 2 Songs, but the distance from the original key of one Song.
And my Intention is to see if I changed the Key +1 (green=very good Sound quality) +2 (yellow=good quality) +3 (to much mickey mouse)


Thank You again
 

Posted Fri 25 Apr 14 @ 3:07 pm
<text font="arial" color="black" size="22" format="`get key_modifier`" scroll="yes" color="white"/>

Please not the info in red :-) - all be it very small
 

Posted Fri 25 Apr 14 @ 3:12 pm
SveninoPRO InfinityMember since 2009
Thank You djtouchdan.
Now I see it!
It shows 1,2,3 etc!
I don´t need no "param_cast"...
I will write if I made my thing...
 

Posted Fri 25 Apr 14 @ 3:24 pm
SveninoPRO InfinityMember since 2009
We made it !!!

greenled: get key_modifier & param_equal 1 ? on : off
yellowled: get key_modifier & param_equal 2 ? on : off
redled: get key_modifier & param_equal 3 ? on : param_greater 3 ? blink : off

It´s that easy !!!
Now my lamp is a traffic light to my transpose.
And if the red light blinks, the key change is too much!

I am happy and want to thank You both
djtouchdan
and especially synthetic1c

And I even stopped all because of the little red " ` "
Is´nt this funny?
 

Posted Fri 25 Apr 14 @ 3:45 pm
sorry I haven't done any skinning for a while.. you need to use &amp; instead of &. and I didn't realise that the controller had different messages for each color, The code I gave you would work for a differently defined controller that changes the color with the value modifier that midi sends. Glad you got it sorted though.
 

Posted Sat 26 Apr 14 @ 12:12 am
& or &amp; should work. 😉
 

Posted Sat 26 Apr 14 @ 12:25 am


(Old topics and forums are automatically closed)