Quick Sign In:  

Forum: General Discussion

Topic: Script School - Page: 23.2
Hey Guys, I've been reading some stuff here and the stuff you all are doing is crazy.
It made me wanting to try some things on my own but the scripting is fooling me.

So, I have a Pioneer DDJ-SX2 as controller and I added a Traktor Kontrol F1.
In that traktor F1 I've programmed the buttons to work as stems and it works.

Now I'm trying to output the color of the button as I turn the stem on or off.

Red when OFF , Blue when ON for instance.

I've tried several stuff but nothing works. What is wrong in the next command? :

effect_stems vocal on ? color "red" : color "blue"

I know this sounds stupid but it keeps triggering me to find the solution and working from there on to try other things.
 

Posted Fri 17 Dec 21 @ 8:37 pm
locoDogPRO InfinityModeratorMember since 2013
that works here but it looks like the F1 uses a rare case for colouring pads
best guess,
effect_stems vocal on ? get_constant "255,0,0" : get_constant "0,0,255"
 

Posted Fri 17 Dec 21 @ 8:49 pm
locoDogPRO InfinityModeratorMember since 2013
Midnight countdown, not the important all singing all dancing important 10 - 9 - 8
one, I'm talking about the 38 minutes 24 seconds to go, lowkey countdown.

A few ways to do this, I'll show my best so far
make it a scheduled event for 23:00, script [don't forget to turn it on...]

deck master effect_string 'text' 2 "" & deck master effect_active 'text' on & set '$test' 3600 & set '$clock' `get_clock` & repeat_start_instant 'ticktock' 50ms -1 & param_equal `get_var $clock` `get_clock` ? : cycle $test -3600 & set '$clock' `get_clock` & set $sec `param_mod 60 "get_var $test" & param_cast '00'` & set $min `param_multiply 0.0166666666666 "get_var '$test'"` & set $min `get_var $min & param_cast 'int_trunc' & param_cast '00'` & set_var $counter `param_add "get_text ':'" "get_var '$min'"` &  set_var '$counter' `param_add "get_var '$sec'" "get_var '$counter'"`  & get_var '$counter' & param_cast 'text' &  deck master effect_string 'text' 2





Talk thru it
deck master effect_string 'text' 2 "" & deck master effect_active 'text' on 

clear the text plugin & switch it on

& set '$test' 3600 & set '$clock' `get_clock` 

3600 is an hour's worth of seconds make that a variable, we'll save the clock now as a variable

& repeat_start_instant 'ticktock' 50ms -1 & param_equal `get_var $clock` `get_clock` ? : cycle $test -3600 & set '$clock' `get_clock` 

start a rsi to check our clock variable against the real clock, if the same do nothing, if different reduce our test variable by 1 [one second has passed] and update our clock variable to the current clock

& set $sec `param_mod 60 "get_var $test" & param_cast '00'` & 

now we have to massage our test variable into minutes and seconds,
test mod 60 leaves us with seconds, use the 2 digit cast to give us a leading zero for the case of single digit seconds, save it as name "$sec"

set $min `param_multiply 0.0166666666666 "get_var '$test'"` & set $min `get_var $min & param_cast 'int_trunc' & param_cast '00'` 

for minutes we'll divide test by 60 [really multiply test by 1/60], cast as integer truncate to remove the stuff under the decimal point and again cast 2 digits to hold a leading zero if needed.

& set_var $counter `param_add "get_text ':'" "get_var '$min'"` &  set_var '$counter' `param_add "get_var '$sec'" "get_var '$counter'"` 

counter will be the variable we send to the text plugin so we need to build it so it shows MM:SS,
first build MM: [first param_add] save the counter var, the add sec to our counter var, MM:SS done

& get_var '$counter' & param_cast 'text' & deck master effect_string 'text' 2

take our counter var and cast it as text to the deck master text plugin.

not easy but I thought it worth sharing.
 

Posted Fri 17 Dec 21 @ 10:38 pm
locodog wrote :
that works here but it looks like the F1 uses a rare case for colouring pads
best guess,
effect_stems vocal on ? get_constant "255,0,0" : get_constant "0,0,255"


Hey, thanks for the answer but this doesn't work too. When I just give the led the command color "blue" it works so for the colors of the led it would be ok to use the command color.
It looks like it's having a problem with the command itself.

Is this possible?
 

Posted Sun 19 Dec 21 @ 10:59 am
locoDogPRO InfinityModeratorMember since 2013
as I said it worked this end, perhaps you need a deck specified

deck X SCRIPT
 

Posted Sun 19 Dec 21 @ 11:00 am
docb-djPRO InfinityMember since 2019
I'm in love with VDJ's real time STEM's.... So that brings me to my question/issue:

Can I map a dial (encoder) on a MIDI Fighter Twister to pan a STEM between two decks?

For example, if I would twist the encoder full CounterClockWise, it would make the left deck related STEM be at it's normal level and the right deck STEM at 0% (Fully muted). If encoder is at mid point, both decks have the relevant STEM at normal (Default) sound levels. If encoder at full ClockWise, left deck STEM would be 0%(muted), right deck STEM would be normal.
 

Posted Mon 20 Dec 21 @ 2:06 pm
locoDogPRO InfinityModeratorMember since 2013
param_smaller 0.5 ? deck 2 stem 'vocal' & deck 1 stem 'vocal' 0.5 : param_invert & deck 1 stem 'vocal' & deck 2 stem 'vocal' 0.5
 

Posted Mon 20 Dec 21 @ 2:24 pm
docb-djPRO InfinityMember since 2019
locodog wrote :
param_smaller 0.5 ? deck 2 stem 'vocal' & deck 1 stem 'vocal' 0.5 : param_invert & deck 1 stem 'vocal' & deck 2 stem 'vocal' 0.5


Wow... Thank you. Very nice indeed.

After using this, I now have a new wish:
How to program a button so that it inverts the above stem fade.
So, for example, when that button is toggled it would switch (invert/flip/etc) the stem from 75%/25% L/R to 25%/75% L/R. Another press/toggle would change it back again.

 

Posted Sat 15 Jan 22 @ 12:39 am
locoDogPRO InfinityModeratorMember since 2013
@docb-dj
see; set variables & cast.
 

Posted Sat 15 Jan 22 @ 2:15 am
docb-djPRO InfinityMember since 2019
locodog wrote :
@docb-dj
see; set variables & cast.


I'm still in the process of working on those.

It's probably a dumb question, but:
Why can't I just param_invert the encoder value when it's button is pressed?

Probably Answer: Because param_invert by default tries to invert the same midi encoder/button/etc CC device that called it. What I'm looking for is when param_invert is used from a button, it'll invert a different MIDI Encoder. As param_invert doesn't work like that, using SET is will be required to share state between the button and encoder. I think...


 

Posted Mon 17 Jan 22 @ 9:36 pm
mg_1978PRO InfinityMember since 2008
hi! i have a ‘Instant fx’ pad page and for example pad 1 is mapping: padfx ‘flanger’ 0.6 0.9
but if i would that slicer 1 starts from 0% to 60% in 2 second and stop at 60% until i have pad pushed, how do i map pad 1? and when i release pad 1 slicer 1 return to 0%….
thanks!!!
 

Posted Mon 24 Jan 22 @ 6:29 pm
Good way to test it
 

Posted Mon 24 Jan 22 @ 6:47 pm
locoDogPRO InfinityModeratorMember since 2013
@mg_1978 not really making sense.
 

Posted Mon 24 Jan 22 @ 7:56 pm
mg_1978PRO InfinityMember since 2008
locodog wrote :
@mg_1978 not really making sense.

thanks, i would try…can you help me?

 

Posted Mon 24 Jan 22 @ 8:09 pm
locoDogPRO InfinityModeratorMember since 2013
I literally don't understand what you want.
 

Posted Mon 24 Jan 22 @ 9:00 pm
mg_1978PRO InfinityMember since 2008
locodog wrote :
I literally don't understand what you want.

can you see flanger slider 1? i would that with pad pressure slider 1 is not 80% istantanealy, but go from 0% to 80% in 500ms and at 80% it stop and remain 80%….

 

Posted Mon 24 Jan 22 @ 10:04 pm
locoDogPRO InfinityModeratorMember since 2013
so, slider zero, fx on, rs to move the slider like 8% every 50ms, give a count of 10 or have a query to turn the rs off when % = 80
 

Posted Mon 24 Jan 22 @ 10:36 pm
mg_1978PRO InfinityMember since 2008
yes! when pad is pushed or in toggle mode, like padfx smart_pressed

 

Posted Mon 24 Jan 22 @ 10:44 pm
mg_1978PRO InfinityMember since 2008
mg_1978 wrote :
[quote=locodog]so, slider zero, fx on, rs to move the slider like 8% every 50ms, give a count of 10 or have a query to
turn the rs off when % = 80


yes! when pad is pushed or in toggle mode, like padfx smart_pressed

i have mapped: down? effect_slider ‘flanger’ 1 0% & effect_active ‘flanger’ on & repeat_start ‘add’ 10ms & effect_slider ‘flanger’ 1 +2% & effect_slider ‘flanger’ 1 80% ? repeat_stop ‘add’ : nothing : repeat_stop ‘add’ & effect_slider ‘flanger’ 1 0% & effect_active ‘flanger’ off

is work, but not in toggle mode too :(

 

Posted Mon 24 Jan 22 @ 10:49 pm
locoDogPRO InfinityModeratorMember since 2013
rs scripts don't run that fast, quickest you can have reliably is 30ms
obviously it won't work as a toggle, down ? doesn't have a toggle like state

if you want like padfx smart_pressed, use padfx.
slider zero, padfx smart_pressed, rs 50ms 10 times, query fx on ? true increase slider : false repeat_stop
 

Posted Mon 24 Jan 22 @ 11:21 pm
50%