Can the number parameter of a verbs be subsituted with variables in VDJ script?
eg.
if I wanted to set the eq_crossfader_high to the value of "$variable1" how would I acheive that?
I have tried 'eq_crossfader_high "$variable1"%' but that gives a syntax error.
Thanks for any help.
eg.
if I wanted to set the eq_crossfader_high to the value of "$variable1" how would I acheive that?
I have tried 'eq_crossfader_high "$variable1"%' but that gives a syntax error.
Thanks for any help.
Posted Sun 05 Jun 11 @ 8:16 am
this is an incredibly long variable If I understand you correctly... Did you want to set the high eq in relation to another slider? Can you explain what the "$variable" is for and how it is supposed to relate to the eq position that will make it easier to figure out.
Posted Sun 05 Jun 11 @ 8:36 am
I want to have Bomes Midi translator send midi messages to controlthe value of $variable. So it would send a message which corresponds to a button, and that button would increment $variable. Another button would decrement the value.
eq_crossfader_high is the high band crossfader of course, not a variable. Then the eq_crossfader_high position would be set by this $variable.
So the 2 buttons might look like (in analagous script)
let $variable = $variable +1 & eq_crossfader_high $variable% (increments variable and moves eq_crossfader_high to variable's value)
let $variable = $variable -1 & eq_crossfader_high $variable% (increments variable and moves eq_crossfader_high to variable's value)
eg. if $variable's value was 70, then the high crissfader would be moved to 70%
eq_crossfader_high is the high band crossfader of course, not a variable. Then the eq_crossfader_high position would be set by this $variable.
So the 2 buttons might look like (in analagous script)
let $variable = $variable +1 & eq_crossfader_high $variable% (increments variable and moves eq_crossfader_high to variable's value)
let $variable = $variable -1 & eq_crossfader_high $variable% (increments variable and moves eq_crossfader_high to variable's value)
eg. if $variable's value was 70, then the high crissfader would be moved to 70%
Posted Sun 05 Jun 11 @ 8:06 pm
Okay now I think I follow you... A variable doesn't work like that, It is basically asking a question and given two options on what to do if the question returns true or false
variable ? action if true : action if false
the variable can be anything... slider position, shift, something active, something selected etc... e.g.
eq_crossfader_high 50% ? action if eq crossfader position is at 50% : action if not
if you just want a button to incrementally increase or decrease the value of a slider or knob in the software you can just use
eq_crossfader_high +1
eq_crossfader_high -1
variable ? action if true : action if false
the variable can be anything... slider position, shift, something active, something selected etc... e.g.
eq_crossfader_high 50% ? action if eq crossfader position is at 50% : action if not
if you just want a button to incrementally increase or decrease the value of a slider or knob in the software you can just use
eq_crossfader_high +1
eq_crossfader_high -1
Posted Mon 06 Jun 11 @ 3:08 am
Thanks, for what I need to do though, I need to increment a persistent variable, like in other scripting languages. I also need to know how to move a crossfader or other control to a position given by a variable. As I describe, the variable would be a parameter of the action.
eg, instead of eq_crossfader_high 50% etc. it would be
eq_crossfader_high $variable%.
It seems this isnt possible though using VDJ script. If I am wrong I hope someone will correct me. If it isnt possiblre, I think it should be. Its a basic thing in scripting languages. Maybe I can acheive it using the cycle function. Also, if incrementing a variable is somehoe possible, I could move the crossfader to that variable value another way, by writng an extemely long action which queries the variable against every possible number it could be, then takes an action.
var $variable 1 ? eq_crossfader_high 1% : var $variable 2 ? eq_crossfader_high 2% : var $variable 3 ? eq_crossfader_high 3% etc etc etc.
Part of the the reason I cant just use eq_crossfader_high + 1 (or -1) is that when you increase the high eq crossfader, for some reason it doesnt move by exactly 1%. It moves by 0.99% or something, so it takes 103 movements of "1%" to cross from 0% to 100% . Dont know why it is like that, but try it and you can see.
eg, instead of eq_crossfader_high 50% etc. it would be
eq_crossfader_high $variable%.
It seems this isnt possible though using VDJ script. If I am wrong I hope someone will correct me. If it isnt possiblre, I think it should be. Its a basic thing in scripting languages. Maybe I can acheive it using the cycle function. Also, if incrementing a variable is somehoe possible, I could move the crossfader to that variable value another way, by writng an extemely long action which queries the variable against every possible number it could be, then takes an action.
var $variable 1 ? eq_crossfader_high 1% : var $variable 2 ? eq_crossfader_high 2% : var $variable 3 ? eq_crossfader_high 3% etc etc etc.
Part of the the reason I cant just use eq_crossfader_high + 1 (or -1) is that when you increase the high eq crossfader, for some reason it doesnt move by exactly 1%. It moves by 0.99% or something, so it takes 103 movements of "1%" to cross from 0% to 100% . Dont know why it is like that, but try it and you can see.
Posted Mon 06 Jun 11 @ 5:54 pm
Well, just had it confirmed by jpboggis that variables cannot currently be substituted into the parameters of a verb. So that settles that part of the question.
Posted Mon 06 Jun 11 @ 5:57 pm
I have just tested and found out that the value of a variable which is cycled up using the cycle verb retains its value when the same variable is cycled down using the cycle command. So if 'cycle "myvar1" 10' is actioned say 4 times, then 'cycle "myvar1" -10' is actioned say, 2 times, the value of myvar will be 2. The value does not get reset, as I thought it might. So, this problem is now solved for me. Thanks for the above help synthet1c.
Posted Mon 06 Jun 11 @ 8:31 pm