Quick Sign In:  

Forum: General Discussion

Topic: Script School - Page: 8.7

Dieser Teil des Themas ist veraltet und kann veraltete oder falsche Informationen enthalten

locoDogPRO InfinityModeratorMember since 2013
sure, example [I won't give you the exact code, because figuring it out is part of the fun :) ]

script action
toggle test

button name
`var test 1 ? get_text "true" : get_text "false"`
 

geposted Sat 12 Dec 20 @ 5:45 pm
locoDogPRO InfinityModeratorMember since 2013
 

geposted Sat 12 Dec 20 @ 9:10 pm
skyzo76PRO InfinityMember since 2016
locodog wrote :
sure, example [I won't give you the exact code, because figuring it out is part of the fun :) ]

script action
toggle test

button name
`var test 1 ? get_text "true" : get_text "false"`

cool i get it :;) ty (again)

 

geposted Sat 12 Dec 20 @ 10:22 pm
skyzo76PRO InfinityMember since 2016
here is my goal : manage key (different scale) with 16 custom pad (like in jpg) and simultanely can manage key with a slider or pots... I can not just use the action "key" on my slider because of the different scale that i want to use, there is some changement in the "next or previous note"...so I did a script to say when param of slider is between this and that go to Key x(separatly it works well)...the issue is when i want to use slider and pads on the same deck : the slider is master and when i hit my button ,it just make the good key a mili second (like a pitch bend...interesting by the way) and returning to the param of my slider (because of the action "repeat_start_instant 'bars' 30ms " I suppose)..so my question is..is there a method to say "when hit the pad stop repeat "and when i use my slider again the "repeat instant" start again ? i don't if it is clear but by trying to explain i probably advance for a solution ;)))
 

geposted Sun 13 Dec 20 @ 2:59 pm
locoDogPRO InfinityModeratorMember since 2013
the button is easy, just stop the rsi as part of the script.
repeat_stop 'RSIname'
the slider, nearly as easy - query if the rsi is running at the start, if it is do what you were going to do, if it's not start the rsi and do your thing

repeat_start 'RSIname' ? is running, carry on : not running, start the rsi, carry on
 

geposted Sun 13 Dec 20 @ 3:43 pm
skyzo76PRO InfinityMember since 2016
locodog wrote :
the button is easy, just stop the rsi as part of the script.
repeat_stop 'RSIname'
the slider, nearly as easy - query if the rsi is running at the start, if it is do what you were going to do, if it's not start the rsi and do your thing

repeat_start 'RSIname' ? is running, carry on : not running, start the rsi, carry on

ok i get it with this code
"var "$Scale" 0 ? repeat_start_instant 'KeyFader' 30ms & deck 1 param_smaller 1% ? repeat_stop 'KeyFader' & deck 1 key -12 : repeat_start_instant 'KeyFader' 30ms & deck 1 param_bigger 1% & param_smaller 5% ? repeat_stop 'KeyFader' & deck 1 key -11 : ....."
it works well ;) no need to change on the button :) ty
 

geposted Sun 13 Dec 20 @ 8:22 pm
skyzo76PRO InfinityMember since 2016
Hey Locodog ! I just have a question. Do you code all inside VDJ or do you use a soft for coding ? if yes, wich one? thanks
 

geposted Wed 16 Dec 20 @ 12:17 pm
locoDogPRO InfinityModeratorMember since 2013
if I was doing a big remapping I'd use np++, most of the time I'm in vdj.
 

geposted Wed 16 Dec 20 @ 12:24 pm
Hi all
re-posting from another thread http://www.virtualdj.com/forums/238420/General_Discussion/Help__with_scriptiing_a_Custom_Slider_Button.html

so can be easily found by anyone attending Script School.


USE of BACK TICKs

IIDEEJAYII wrote :
When do I do I need the back ticks on parameter? in this case level is defined by VDJ as value of a volume fader.

Is it advised to use `level` in

param_greater 50% `level` 


since the code below also works without the back ticks
param_greater 50% level 



with 2 amazing replies

locodog wrote :
param_greater is expecting 2 things, that could be an actions or values, or a mix
since it is expecting an action it can work with no spaced actions without ` ` so, level, get_level etc will be fine.
however, if there's a space in the action, lets say
effect_slider 'echo' 1
the space will mess things up so you would need to encapsulate ` ` , I believe encapsulate works with " " & ' ' too

param_equal, is slightly different, it is expecting either action, value or a string so, wrapping with " " or ' ' is reserved for strings.
Most of the time if doing a comparison on an action, wrapping the action in ` ` can't hurt there is one exception I'll try remember what it was.
*edit, I was remembering the wrong thing


Nicotux wrote :
i try again as post does not appear

`level & param_bigger 0.75 ? get_constant 0 : param_cast int`

backquote only not needed with "param_*' when action is one word only
most other verbs are needing backquotes or ignore them
as locodog said there are "exception" . trial & error only can help


All the above tests and comparisons are only working with scripts and physical sliders but not with custom_sliders
(custom sliders are not real sliders anymore for a while)

so that user slider have to be scripted in a way to make it work correctly
they need a specific variable (each) to handle value, specially using relative scroll, slide & move
(encoders, touchscreen, mouse roll)

set v[INDEX] & param_cast absolute & set v[INDEX] `get_var v[INDEX] & param_bigger 0.0 ? param_bigger 1.0 ? constant 1.0 : get_var v[INDEX] : constant 0.0` & param_add 0 `get_var v[INDEX]` & ...

set v : save the wrong absolute value (not in slider range)
param_cast absolute : convert param for future use
set v `..` : fix correct value for the slider
param_add 0.0 ... : hack to be able to overwrite parameter with correct absolute value and update slider display accordingly
& ... : now parameter is in range [0.0..1.0] and correct absolute value is passed to the script
 

geposted Sat 26 Dec 20 @ 5:42 pm
skyzo76PRO InfinityMember since 2016
HI! I need help for a script for my led...I want that it light, when an effect (what ever effect) is ON...but if I just use "effect_active" it doesn't work...I can use effect_active 1 or 2 etc..but the problem is that I use many other effect who's are not in the x slot specially...I try to don't write each effect...:) I odn't know if it is clear...:)
 

geposted Wed 13 Jan 21 @ 6:58 pm
NicotuxHome userMember since 2014
effects_used
 

geposted Wed 13 Jan 21 @ 7:39 pm
skyzo76PRO InfinityMember since 2016
thanks !
 

geposted Wed 13 Jan 21 @ 8:09 pm
twagaPRO InfinityMember since 2009
Can we write VDJscript to wait 1 second?

Also, can we write VDJscript to play(hold off, release) 1 beat and beat_juggle -1 beat?
 

geposted Mon 18 Jan 21 @ 3:12 pm
locoDogPRO InfinityModeratorMember since 2013
somewhere in this thread [page 3 or 4] I made a post starting

repeat_start
repeat_start_instant
repeat_stop
 

geposted Mon 18 Jan 21 @ 5:37 pm
twagaPRO InfinityMember since 2009
Where did you define what 'lightBPM' does?

locodog wrote :

holding ? sync : play_sync & action_deck 1 ? deck 2 beatlock on & deck 1 pitch_reset 0.5% & repeat_start 'lightBPM' 200ms 100 & get_pitch_zero ? repeat_stop 'lightBPM' & deck 2 beatlock off : nothing : deck 1 beatlock on & deck 2 pitch_reset 0.5% & repeat_start 'lightBPM' 200ms 100 & get_pitch_zero ? repeat_stop 'lightBPM' & deck 1 beatlock off : nothing


 

geposted Thu 21 Jan 21 @ 9:29 am
NicotuxHome userMember since 2014
'lightBPM' does nothing, it only names the loop (in a way to stop the right one if needed)
you can see loops currently in action by using 'var_list' tab 'repeat scripts' (and switch "auto update" box bottom left)

holding // long press is sync
_? sync
// not holding is reset pitch (depending on deck)
_: play_sync
__& action_deck 1 // action deck is deck 1
__? deck 2 beatlock on
____& deck 1 pitch_reset 0.5%
____& repeat_start 'lightBPM' 200ms 100 // create a loop named 'lightBPM'
____& get_pitch_zero // loop until pitch is zero
______? repeat_stop 'lightBPM' // stop the loop named 'lightBPM'
________& deck 2 beatlock off
______ : nothing // wait while pitch is non zero
// do the same but with decks inverted
// action deck is deck 2
__ : deck 1 beatlock on
____& deck 2 pitch_reset 0.5%
____ & repeat_start 'lightBPM' 200ms 100
____ & get_pitch_zero
______? repeat_stop 'lightBPM'
_______ & deck 1 beatlock off
______: nothing


a simple loop to wait 1 sec (1000ms) I name it 'wait1' in this example:
repeat_start 'wait1' 1000ms 1 & ...
this define a simple loop 'wait1' looping 1 time after 1000ms
 

geposted Thu 21 Jan 21 @ 10:00 am
The question is,:

- I give a button on the controller with the mapping:

effect_active sampler 'cut'

And I activate the cut effect in the slot

- I give another button with mapping:

effect_active sampler 'spiral'

And I activate the spiral effect in the slot and the cut effect disappears from the slot but is still active.

So far I have 2 active effects in the sample.

But with mapping: effect_slider sampler 1
I only move parameter 1 of the effect that is in the slot that is the CUT.

And if I want to move parameter 1 of the SPIRAL effect that is not in the slot and I have it active,
How do I do the mapping ?????

So you could apply 2 active effects to a sampler at the same time, being able to operate with 2 knobs. One knob for the CUT effect and the other for the SPIRAL effect.
 

geposted Fri 22 Jan 21 @ 7:24 pm
locoDogPRO InfinityModeratorMember since 2013
call it back in to the sampler slot

effect_select sampler 'YOURFX' & DO STUFF

My opinion, when sampler fx came out, I argued that it was a bit weird, I'd have designated sampler as a deck entity, but I'm only arguing from the point of not knowing the technical reasons why it was done like it was done.
 

geposted Fri 22 Jan 21 @ 10:01 pm
Thanks friend.

So what I want to do can't you ???

Sampler should have multiple slots for 3 effects as does each deck.
 

geposted Fri 22 Jan 21 @ 10:27 pm
Thanks friend.

So what I want to do can't you ???

Sampler should have multiple slots for 3 effects as does each deck


locodog wrote :
call it back in to the sampler slot

effect_select sampler 'YOURFX' & DO STUFF

My opinion, when sampler fx came out, I argued that it was a bit weird, I'd have designated sampler as a deck entity, but I'm only arguing from the point of not knowing the technical reasons why it was done like it was done.


 

geposted Fri 22 Jan 21 @ 10:27 pm
18%