Ingreso rápido:  

Forum: General Discussion

Tema: Script School - Page: 45.55
locoDogPRO InfinityModeratorMember since 2013
deck all isn't great for queries, query individuals, something like this
param_equal get_decks 4 ? param_equal `param_add "param_add 'deck 1 beatlock' 'deck 2 beatlock'" "param_add 'deck 3 beatlock' 'deck 4 beatlock'"` 4 ? deck all beatlock off : deck all beatlock on : param_equal get_decks 2 ? param_equal `param_add 'deck 1 beatlock' 'deck 2 beatlock'` 2 ? deck all beatlock off : deck all beatlock on : 


or like this
deck 1 beatlock && deck 2 beatlock && deck 3 beatlock && deck 4 beatlock ? deck all beatlock off : deck all beatlock on
 

Mensajes Sat 16 Mar 24 @ 6:23 pm
mg_1978PRO InfinityMember since 2008
solved: my right script is:
deck all beatlock & deck 1 masterdeck ? deck 2 sync & deck 3 sync & deck 4 sync : deck 2 masterdeck ? deck 1 sync & deck 3 sync & deck 4 sync : deck 3 masterdeck ? deck 1 sync & deck 2 sync & deck 4 sync : deck 4 masterdeck ? deck 1 sync & deck 2 sync & deck 3 sync : nothing
👍

 

Mensajes Sun 17 Mar 24 @ 10:46 pm
locoDogPRO InfinityModeratorMember since 2013
I've asked you to stop quoting when it's clear whom you're replying to in this thread. Now I'm telling you, I will stop replying to you if I have to edit your posts again.

What's wrong with just?
deck all beatlock
It will sync from that
 

Mensajes Sun 17 Mar 24 @ 11:56 pm
locoDogPRO InfinityModeratorMember since 2013
DECK ALL
A useful deck specifier for when you want all decks to do something but there are logical implications.

Check the var_list after pressing this button
deck all set result1 `get_deck` & set $result1 +1 & deck 1 set result2 +1

result2's value may come as a surprise, what's happened under the hood the script actually performed is this

( deck 1 set result1 `get_deck` & set $result1 +1 & deck 1 set result2 +1 ) & 
( deck 2 set result1 `get_deck` & set $result1 +1 & deck 1 set result2 +1 ) &
( deck 3 set result1 `get_deck` & set $result1 +1 & deck 1 set result2 +1 ) &
( deck 4 set result1 `get_deck` & set $result1 +1 & deck 1 set result2 +1 )


It repeated the script for each deck so result2 is incremented 4 times

Playing with the logic, you can do something like this
make every other deck [other than the calling deck] play
set $deckvar `get_deck` & deck all param_equal `get_var $deckvar` `get_deck` ? : play_pause


Short and sweet,
If you need to use deck all for simple scripts there's no problem.
If you need deck all in more complicated scripts it's probably best to contain it in ( ) [deck specified in brackets only stay true inside the brackets]
There's probably some shortcuts here for complicated multideck scripts, just be wary, things can get confusing fast.
 

Mensajes Mon 18 Mar 24 @ 12:51 am
mg_1978PRO InfinityMember since 2008
locodog wrote :
I've asked you to stop quoting when it's clear whom you're replying to in this thread. Now I'm telling you, I will stop replying to you if I have to edit your posts again.

What's wrong with just?
deck all beatlock
It will sync from that


ok, i have understand, but i rewrite correct script for all users that have same request, ok? in all these pages (supreme blog for me!) i have read many and many script that have illuminated me for my personal mapper modifiers…and i think other members could make some thing…but if you don’t want these anymore, i stop post correct script, ok!
Thanks for all support Locodog 👍

 

Mensajes Wed 20 Mar 24 @ 9:00 am
mg_1978PRO InfinityMember since 2008
locodog wrote :
I've asked you to stop quoting when it's clear whom you're replying to in this thread. Now I'm telling you, I will stop replying to you if I have to edit your posts again.

What's wrong with just?
deck all beatlock
It will sync from that


…mmm not that i would…because ‘deck all beatlock’ sync other deck to the focused deck and not to the masterdeck..i wont masterdeck 👍 but i solved..thanks a lot

 

Mensajes Wed 20 Mar 24 @ 7:27 pm
locoDogPRO InfinityModeratorMember since 2013
@mg_1978
You're wrong on several levels, but if you're not going to respect my request, I don't see why I should bother replying to correct you.
 

Mensajes Thu 21 Mar 24 @ 1:25 am
mg_1978PRO InfinityMember since 2008
Hi!
virtualfolder_add ‘Sampler/Recordings’
why don’t work? Recordings is not a folder? 🤔 thanks a lot
 

Mensajes Fri 22 Mar 24 @ 5:46 pm
locoDogPRO InfinityModeratorMember since 2013
A user requested this [make beatjump wrap round an existing loop]

Senky Dragon wrote :
Is there a way to make beatjump wrap round a loop?

If I set a 32 beat loop, am currently 28 beats through the loop, and jump forward 8 beats, I would expect to be on beat 4 of the existing loop.


I thought it kind of interesting

for jumping forward in the loop things to consider;
are we in a loop ? [if not nothing special needed]
is our jump bigger than the whole loop ? [idiot check, if true do nothing],
is our current position in the loop added to the beatjump, smaller than the loop size? [if so nothing special needed] [we get our position in the loop in beats by param_multiply get_loop loop_position]
if false do some math, our loop size * -1, added to beatjump gives us the amount we need to jump back. [wrap around]

a forward button it would be like this

loop 0 ? beatjump +1 : param_bigger get_loop beatjump ? nothing : param_bigger `param_add 'param_multiply get_loop loop_position' beatjump` get_loop ? beatjump +1 : param_add 'param_multiply get_loop -1' 'beatjump' & param_cast relative & goto


Backwards is a little different
mainly our wrap check, is beatjump value smaller than current loop position.
[if it is nothing special needed]
if false, our beatjump value * -1, added to our loop size is the amount we need to jump forward [wrap around]

a backwards button like this

loop 0 ? beatjump -1 : param_bigger get_loop beatjump ? nothing : param_smaller `param_multiply get_loop loop_position` beatjump ? beatjump -1 : param_add get_loop 'param_multiply beatjump -1' & param_cast relative & goto


Case of encoders it would be something like this.
[same as above combined, but also need to deal with the implicit of the encoder]

param_bigger 0 ? loop 0 ? beatjump +1 : param_bigger get_loop beatjump ? nothing : param_bigger `param_add 'param_multiply get_loop loop_position' beatjump` get_loop ? beatjump +1 : param_multiply 0 & param_add "param_add 'param_multiply get_loop -1' 'beatjump'" & param_cast relative & goto : loop 0 ? beatjump -1 : param_bigger get_loop beatjump ? nothing : param_smaller `param_multiply get_loop loop_position` beatjump ? beatjump -1 : param_multiply 0 & param_add "param_add get_loop 'param_multiply beatjump -1'" & param_cast relative & goto
 

Mensajes Thu 11 Apr 24 @ 6:55 pm
Hi, I can't use JOG_WHEEL to smoothly change the position of the end of the loop section. Is there any option? Thanks
 

Mensajes Sat 20 Apr 24 @ 11:19 pm
locoDogPRO InfinityModeratorMember since 2013
see the wheel_mode script
 

Mensajes Sat 20 Apr 24 @ 11:24 pm
wheel_mode 'loop_out' ? wheel_mode 'loop_out,jog' : loop ? wheel_mode 'loop_out,jog' : loop_out
Already solved. Bye.
 

Mensajes Sat 20 Apr 24 @ 11:27 pm
I'm trying to modify Touchdan's Title (Video Skin) to work for my needs.

I'd noticed that the title didn't always appear, or seemed to favour one deck over the other, so I investigated...

The original code looks like it checks the crossfader position to determine whether to show or not:
visibility="pulse 25000ms '`param_equal get_crossfader_result 0 ? deck left load_pulse : param_equal get_crossfader_result 1 ? deck right load_pulse : fadeout 1000ms 750ms`'"


I don't use the crossfader (so it sits centrally) which I guess is why the titles are inconsistent.

I found is_audible being used in another videoskin so borrowed the code:
visibility="is_audible 'or scratch' & fadeout 1000ms 500ms"


That works, but I've been trying to add a delay so that the text appears after 5 seconds of play rather than immediately, but so far have failed in all attempts.

(no idea what the 'or scratch' is doing)
 

Mensajes Sun 21 Apr 24 @ 9:43 am
locoDogPRO InfinityModeratorMember since 2013
Try load_pulse_active

visibility="load_pulse_active 2000ms 5000ms & fadeout 1000ms 500ms"
 

Mensajes Sun 21 Apr 24 @ 12:03 pm
Thank you locodog. I just did a quick mod to make it stay on screen a little longer, and we're away!
 

Mensajes Sun 21 Apr 24 @ 1:11 pm
locoDogPRO InfinityModeratorMember since 2013
Another user wish, the concept is interesting as instruction to how to scale a dial.

User wanted a fine detailed key change on a dial.
So key_smooth is the script, but key_smooth goes from -6.0 key to +6.0 key so we need to reduce the range a bit.

As is from centre [key natural] key_smooth goes -6.0 to +6.0 so 12 divisions. We only want a range of -1.0 key to +1.0 key so 1/6th of the full range. Then we want to ignore the first 5/12ths of the range.
A dial usually goes from 0.0 to 1.0, so
( dial val * 0.166666 [a 6th] ) + 0.416666 [5/12ths] = val =>0.416666 & <=0.583333

That as script you'd use on a dial
param_multiply 0.166666 & param_add 0.416666 & key_smooth

That would be ±100 cents across a whole dial

param_multiply 0.016666 & param_add 0.491666 & key_smooth

This would be ±10 cents across a whole dial
 

Mensajes Thu 02 May 24 @ 11:26 am
locoDogPRO InfinityModeratorMember since 2013
Another interesting user request that involves implicit manipulation.

User wanted a more increment kind of pitch slider, to some it might not make sense but I get it, instead of having infinity values between 2 contiguous integers you have just 10, so from 120 to 121 bpm you just have 121.0, 121.1, 121.2 ... etc

part of it is showing off, part of it is cheating, part of it is how digital sliders work when you look closely at X num of bit precision.
The dancefloor doesn't really care as long as you don't trainwreck.

A rare use case but an interesting script to learn from

So the dial implicit is 0.0 - 1.0
we need to turn implicit into ±1.0

so multiply by 2, now our implicit is 0.0 - 2.0
so add -1, now our implicit is -1.0 to +1.0

multiply implicit by pitch range, pitch range returns a value between 0.01 to 1.00 [1% pitch range to 100% pitch range]
so implicit == -pitch range to +pitch range

add 1 so our implicit is (1 - pitch range) to (1 + pitch range)

multiply implicit by bpm absolute
param_cast '0.0' to limit digits to one decimal place
param_cast as beats because we're passing a beat value to the pitch verb

pitch

param_multiply 2 & param_add -1 & param_multiply pitch_range & param_add 1 & param_multiply 'get_bpm absolute' & param_cast '0.0' & param_cast beats & pitch
 

Mensajes Thu 02 May 24 @ 12:30 pm
locoDogPRO InfinityModeratorMember since 2013
Script and the deck it acts on.
deck specified

Should have done this earlier as it's basic, but I'm doing it now and have a thing to add that is a little more advanced.

So think about this script play_pause,
now think about where you could write this script and the results you get from writing in different places.
You could write; to a custom_button, to a pad, actually into a skin, to an action poi, to a controller mapping, to a keyboard mapping.

The thing is, it knows what deck to act on, how does it know?
The first 3 are all part of a skin and in the skin you can specify the deck to act upon.
apoi are called from a track on a deck so it inherits the assigned deck there.

Controller mapping is usually deck specified in the definition file; a device may have a left play_pause & a right play_pause, those buttons do send different midi messages those different messages are assigned to different decks. You might just map 1 entry to play_pause but in the definition it's actually several buttons assigned to different decks.

Not all controllers are like this though, like a launchpad or similar auxiliary device, they don't have a deck specified in the definition. A play_pause there will act on the selected deck, also known as deck default.
A keyboard mapping, similar to an auxiliary device, has no deck assigned to so defaults to... the default deck, also known as the selected deck.

So most of the time we don't need to worry about specifying the deck,
but what if we want to get fancy?
What if we're doing stuff across several decks?
How do we check our calling deck number?
How do we specify a deck with script?
A few different scripts here.

Query against
device_side %PARAM ? 

params that can be used are left right [ or integer number for 4 deck devices]
This is just for devices,

action_deck %NUM ?

This works for all cases

deck %PARAM masterdeck ?

this query is, is this deck the active/masterdeck

Info query to get a number
get_deck - returns integer
get_defaultdeck - returns integer
get_leftdeck - returns integer
get_rightdeck - returns integer
get_decks - returns integer number of decks
get_activedeck - returns integer of masterdeck

Normal way of specifying a deck to a known value
deck %PARAM SOME_VERB
params that can be used are deck number, left, right, master, active, default

How to make a deck the default deck [presuming there's a deck specified to where this script is written.]
select
If you want to specify the deck
deck %PARAM select
params could be NUM, left, right, master, active


Specifying a deck with dynamic script.
set_deck `ACTION`

This is the newer interesting specifier, this accepts action script as a parameter meaning you can get smart with it.

Let's do an example case, we'll make our own automix/timeline with action poi.
so you'd have a couple of action poi like this

if we're on deck 1 load deck 2, if we're on deck 2 load deck 1
action_deck 1 ? deck 2 load "C://FILEPATH.mp3" : action_deck 2 ? deck 1 load "C://FILEPATH.mp3" :

similar story press play on the other deck
action_deck 1 ? deck 2 play_sync : action_deck 2 ? deck 1 play_sync :

So far so boring, how do we use set_deck with this?
We could do something like this, but it's not really much smarter
set_deck `action_deck 1 ? get_constant 2 : action_deck 2 ? get_constant 1 : ` & load C://FILEPATH.mp3"

What would be smart would be the remainder of our deck number divided by our number of decks, then add 1
We're on deck 1, we have 2 decks,
1%2 = 1
then add 1 to get 2.
other case
2%2 = 0
add 1 to get 1

As it happens we have a script that does this kind of remainder division, param_mod, [modulo operation if you haven't heard of it]

set_deck `param_mod get_decks get_deck & param_add 1` & load "C://FILEPATH.mp3"


If you have lots of "act on the other deck" type of scripts, I'd use a variable, set variables like this
set $callingDeck `get_deck` & set $otherDeck `param_mod get_decks get_deck & param_add 1`
then use the variables something like this
set_deck `get_var $otherDeck` & level +10%


After setting the variables you could do something like this that will act on both decks with different actions, [be careful using DECK ALL, see deck all lesson as to why]

deck all param_equal `get_var $callingDeck` `get_deck` ? DO THING TO CALLING DECK : DO THING TO OTHER DECK


Pretty basic, set_deck has its uses.
 

Mensajes Sun 05 May 24 @ 4:52 pm
locoDogPRO InfinityModeratorMember since 2013
Parse Values Anywhere in Script

A cross over episode with virtualfx. Since virtualfx is available on all platforms I consider it unofficially official.
If it didn't exist I'd be pestering the devs that script should do this.

Now anybody who has got into scripting has got to the point of "I want to parse script values into other scripts because... awesome idea"
and a lot of times you can cast a value to a param with a bit of work, but it's not the easiest.

So let's make it easy with an example that would be very difficult otherwise.
First grab yourself a copy of virtualfx
next outside of vdj rename the .dll or .bundle to "parser"

So let's do something with padfx to control echo out [I keep meaning to cover padfx but it's a 'busy' verb with a lot to it]
now let's set some variables to recall later. Just examples

set $fxParam1 `effect_slider echo 1` & set $fxParam2 0.75 & set $fxParam3 `filter` & set_var $fxStemState 'stemfx:Vocal'


so a mixed bag here, we saved from effect_sliders, we saved a fixed value, we saved from the filter position, and we saved a fixed string variable.

So now the magic, we build a string with literal text and parsed values, send it to parser fx as an effect_string and then have that string called as a script [that's what virtualfx does, effect_strings called as script]
make this a button
get_text "padfx 'echo out' `get_var $fxParam1` `get_var $fxParam2` `get_var $fxParam3` `effect_slider 'echo out' 4` `get_var $fxStemState`" & param_cast & effect_string parser 7 & effect_button parser 1 -1


first 3 params we get from saved variables, 4th param we grab from the fx itself at run time, and the stem state we get from a saved string variable.

Either you're intrigued and you want to test, or you don't get it.
Short and sweet, but crazy powerful.
 

Mensajes Tue 07 May 24 @ 1:20 pm
Awesome stuff Locodog..

Always wanted to wrap my head around your plugin, virtualfx, and always stuck at knowing what virtualfx expects.. or what is under its hood.

For example.. what is reason for the items (parameters) you passed to virtualfx (parcer) and how did you know which, and order to pass them?
(seems some additional info is required)

And then, there is question .. the virtualfx, button,
what is it doing and what does the button's parameters mean 1 -1... ?

Without an understanding of the above it is a black box that may be difficult to interact with, though powerful as it is..

Yes, intrigued, and would love to learn more.



PS
In the spirit of learning here at school:
when initially setting variables, you used set, set, set, & set_var
is there a reason for not using set for the 4th variable also?

 

Mensajes Tue 07 May 24 @ 7:10 pm
97%