Quick Sign In:  

Forum: General Discussion

Topic: Script School - Page: 9

This part of topic is old and might contain outdated or incorrect information

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
 

Posted 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.
 

Posted 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
 

Posted 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...:)
 

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

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

Posted 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?
 

Posted 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
 

Posted 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


 

Posted 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
 

Posted 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.
 

Posted 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.
 

Posted 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.
 

Posted 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.


 

Posted Fri 22 Jan 21 @ 10:27 pm
NicotuxHome userMember since 2014
Because sampler is not a real deck (dynamic); as locodog said, it is used as a slot
Internal technical limitations:
Decks are using positive numbers to identify, null being Master or Default depending on usage
To identify other decks the solution was to use negative values. This apply to sampler and mic and aux
Instead of doing things like "deck -n" the decision was taken to access them the same as a slot, such as "Release"
(now 6 slots seems to exist there may be differences)
 

Posted Sat 23 Jan 21 @ 12:28 am
Thanks Nicotux and Locodog.

But it is a shame because many more things could be done, if the sampler had more slot and to be able to handle parameters at the same time of different effects.

Nicotux wrote :
Because sampler is not a real deck (dynamic); as locodog said, it is used as a slot
Internal technical limitations:
Decks are using positive numbers to identify, null being Master or Default depending on usage
To identify other decks the solution was to use negative values. This apply to sampler and mic and aux
Instead of doing things like "deck -n" the decision was taken to access them the same as a slot, such as "Release"
(now 6 slots seems to exist there may be differences)


 

Posted Sat 23 Jan 21 @ 6:09 am
twagaPRO InfinityMember since 2009
Is it possible to specify the time for one beat as the interval instead of 1000ms?

Nicotux wrote :

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


 

Posted Mon 25 Jan 21 @ 12:36 pm
locoDogPRO InfinityModeratorMember since 2013
@twaga yes but not with dead on precision, even if you state 1000ms, it might happen in 995ms or 1005ms. It's a bit fuzzy.

off the top of my head, to get ms/b into a RS script
get_bpm & param_1_x & param_multiply 60000 & param_cast 'ms' & repeat_start 'Name' & ACTION STUFF

but since you can't include a counting param you have to manually stop the RS script
something like this is an example, however this can cause problems with an implicit being set
that is a different story

effect_active 'ducking echo' on & param_multiply "get_bpm & param_1_x" 60000 & param_cast 'ms' & repeat_start 'name' & play ? slip on & play_pause & cycle 'mCounter' 40 & var 'mCounter' 0 ? repeat_stop 'name' & effect_active 'ducking echo' off : nothing : play_pause & slip off & cycle 'mCounter' 40 & var 'mCounter' 0 ? repeat_stop 'name' & effect_active 'ducking echo' off : nothing 
 

Posted Mon 25 Jan 21 @ 1:55 pm
Good morning all,
I discover the world of djing and I have no concept in mapping.
I have a numark nv2 table and would like to modify it slightly to make it easier for me.

When I press the "sampler" button I would like to open my sample bank and assign 1 pad for each sample, but unfortunately the bank does not want to open. Once it is opened with the vdj the pads are well assigned but no function from the controller.

Second I have 2 cue menus and I would like the second menu to be a "piano" mode of my cues.
Thank you in advance to all
 

Posted Tue 26 Jan 21 @ 8:03 pm
NicotuxHome userMember since 2014
Sorry can't help with your request but I notice a bug in the mapping of the NV II
as this is in related KEY i found it important to report:
PAD_MODE_SAMPLER mapped to
pad_pages 4 ? holding ? pad_pages 19 : pad_pages 8 : pad_pages 8 : pad_pages 4
should be something else like
pad_pages 4 ? holding ? pad_pages 19 : pad_pages 8 : pad_pages 4

some tips for mapping pads and samples:

to open browser sampler tab:
sideview "sampler"
or
page sampler

to select sampler pad :
pad_page sampler

to open the bank of samples :
sampler_bank

moving a sample from browser to the sampler tab grid/list automatically affect it to the sampler padpage pad
(in grid mode the position have to be guess) and names do not always match in browser tab and pads
sideview_triggerpad
toggles (or can set on and off) between grid view and list view
 

Posted Tue 26 Jan 21 @ 10:56 pm
19%