Accesso rapido:  

Forum: VirtualDJ Technical Support

Topic: Scripting help for Scratchbank load and unload
So i have a button that i want to map to get the first sample for the scratchbank to load and unload when i press it on the controller, for the life of my i can't get the script to work. can someone please help out on this one. basically if no scratchbank sample is loaded then when i press the button the first sample should load to the deck, and on the second press it should unload. tks in advance
 

Inviato Thu 28 Oct 21 @ 1:51 pm
AdionPRO InfinityCTOMember since 2006
scratchbank_load_to_deck 1 ? scratchbank_unload : scratchbank_load_to_deck 1
 

Inviato Thu 28 Oct 21 @ 2:05 pm
Adion wrote :
scratchbank_load_to_deck 1 ? scratchbank_unload : scratchbank_load_to_deck 1


tks sir, now if u have the same button on both decks on the controller how would this work, coz right now it only works for deck 1.

 

Inviato Thu 28 Oct 21 @ 4:07 pm
NicotuxHome userMember since 2014
as usual action apply to deck which the button belongs to

but free to specify deck the action must apply to

deck left scratchbank_load_to_deck 1 ? scratchbank_unload : scratchbank_load_to_deck 1
deck right scratchbank_load_to_deck 1 ? scratchbank_unload : scratchbank_load_to_deck 1
deck active scratchbank_load_to_deck 1 ? scratchbank_unload : scratchbank_load_to_deck 1
...
 

Inviato Thu 28 Oct 21 @ 4:14 pm
Nicotux wrote :
as usual action apply to deck which the button belongs to

but free to specify deck the action must apply to

deck left scratchbank_load_to_deck 1 ? scratchbank_unload : scratchbank_load_to_deck 1
deck right scratchbank_load_to_deck 1 ? scratchbank_unload : scratchbank_load_to_deck 1
deck active scratchbank_load_to_deck 1 ? scratchbank_unload : scratchbank_load_to_deck 1
...


so this one works scratchbank_load_to_deck 1 ? scratchbank_unload : scratchbank_load_to_deck 1

the decks are set to automatic (left,right) but when i press the same button on the blue deck or the left deck in VDJ, it doesnt load and unload the scratch sample. any idea.
 

Inviato Thu 28 Oct 21 @ 10:36 pm
scratch that, i made it work with this script. tks for all the help guys.

device_side 'left' ? scratchbank_load_to_deck 1 ? scratchbank_unload : scratchbank_load_to_deck 1 : device_side 'right' ? scratchbank_load_to_deck 1 ? scratchbank_unload : scratchbank_load_to_deck 1
 

Inviato Thu 28 Oct 21 @ 10:40 pm
NicotuxHome userMember since 2014
Well strange, but affected to device not to deck ^^
 

Inviato Thu 28 Oct 21 @ 10:48 pm
Nicotux wrote :
Well strange, but affected to device not to deck ^^


yeah i found it a bit strange too that a simple script didn't work since the button is identical on both sides.

 

Inviato Fri 29 Oct 21 @ 1:12 pm
So i thought the script worked but i found out that with the below it still only works for the right deck, the same button on the left side doesn't do anything :( help appriciated.what i need is for the same button which is on either side of the controller to load and unload the scratch bank samples.

device_side 'left' ? scratchbank_load_to_deck 1 ? scratchbank_unload : scratchbank_load_to_deck 1 : device_side 'right' ? scratchbank_load_to_deck 1 ? scratchbank_unload : scratchbank_load_to_deck 1
 

Inviato Fri 05 Nov 21 @ 10:06 pm
NicotuxHome userMember since 2014
strange you said only deck 1 was working and now only right deck is working
knowing only 3124 1234 and 1342 modes are supported by VDJ that's simply not possible
deck 1 is always a left deck and deck 4 only a right deck
only deck 2 and deck 3 can change side

unless you have a very strange multiple device config you have to expose to

also remember scratchbanks are deck specific, not global
thus a scratch sample have to be loaded in the slot before scratchbank can load the sample to the deck
every deck can have its own scratchbank enabled
 

Inviato Sat 06 Nov 21 @ 12:13 am
Nicotux wrote :
strange you said only deck 1 was working and now only right deck is working
knowing only 3124 1234 and 1342 modes are supported by VDJ that's simply not possible
deck 1 is always a left deck and deck 4 only a right deck
only deck 2 and deck 3 can change side

unless you have a very strange multiple device config you have to expose to

also remember scratchbanks are deck specific, not global
thus a scratch sample have to be loaded in the slot before scratchbank can load the sample to the deck
every deck can have its own scratchbank enabled


correct, when i said deck one i meant the deck in red, and i am on 2 deck mode. and a scratch sample is loaded on both scratch sample banks, my controller here is american audio versadeck

 

Inviato Sat 06 Nov 21 @ 12:47 am
NicotuxHome userMember since 2014
make sure SOURCE SELECTOR SWITCHes are both to PC and setting mixerMode is 3124 or 1342

Source map as
device_side 'left' ? deck 1 leftdeck ? deck 3 leftdeck : deck 1 leftdeck : deck 2 rightdeck ? deck 4 rightdeck : deck 2 rightdeck

this wanna say device is always in 4 decks switch mode
maybe the source is wrong and scratch sample is send to deck 3

in every cases
deck 1 scratchbank_load_to_deck 1 must send sample to deck 1
deck 2 scratchbank_load_to_deck 1 must send sample to deck 2

deck left scratchbank_load_to_deck 1 must send sample to deck 1 or deck 3
deck right scratchbank_load_to_deck 1 must send sample to deck 2 or deck 4

to force deck1 and deck 2 whatever the set of deck is :
device_side 'left' ? deck 1 scratchbank_load_to_deck 1 : deck 2 scratchbank_load_to_deck 1

 

Inviato Sat 06 Nov 21 @ 1:55 am
Ok found the problem. if the scratchpad page is not chosen on the skin the script doesn't work, if its visible on both decks then the script works. any modification we can make since i am either sampler or something else most of the time.

so this works perfectly when the scratchpad page is selected and visible on both decks scratchbank_load_to_deck 1 ? scratchbank_unload : scratchbank_load_to_deck 1

 

Inviato Sun 07 Nov 21 @ 2:54 pm
NicotuxHome userMember since 2014
I do not think this is how it may work, but that can effectively help

But the fact it is appearing once make it load the selected scratchbank in scratchpad
after that there is no need the pad to be visible

"scratchbank_load" needs to apply at least once per deck before scratch samples to be usable
 

Inviato Sun 07 Nov 21 @ 3:23 pm
Nicotux wrote :
I do not think this is how it may work, but that can effectively help

But the fact it is appearing once make it load the selected scratchbank in scratchpad
after that there is no need the pad to be visible

"scratchbank_load" needs to apply at least once per deck before scratch samples to be usable


I thought so too, but once u use the scratchpad and then i switch to samples, the button no longer works unless i go the pc and select the scratchpad page again, that defeats the purpose as i want to keep off the laptop as much as possible.

 

Inviato Sun 07 Nov 21 @ 3:38 pm
NicotuxHome userMember since 2014
I'm pretty sure there is a way to make it work for you (it's working here, but not with this controller )

but the fact you switch to samples or any other pad may perhaps modify some controller mode or device side, but this does not unload the scratchbank

maybe try to map "scratchbank_edit" in a way to see what is loaded
(badly the editor does not report the deck it is showing :\)
 

Inviato Sun 07 Nov 21 @ 4:13 pm