Accesso rapido:  

Forum: General Discussion

Topic: Script School - Page: 27.85
locoDogPRO InfinityModeratorMember since 2013
holding 300ms ? action if held : action if pressed
 

Inviato Thu 06 Oct 22 @ 8:17 am
mg_1978PRO InfinityMember since 2008
locodog wrote :
holding 300ms ? action if held : action if pressed


in script? thanks!!
i don’t know held or pressed in “script”

 

Inviato Thu 06 Oct 22 @ 8:58 am
locoDogPRO InfinityModeratorMember since 2013
if held or if pressed aren't actual script, just descriptive for the outcomes for a holding ? query
 

Inviato Thu 06 Oct 22 @ 9:06 am
locodog wrote :
That never worked so it can't be called broken. query the var against a value, if true select the deck in long form.

could select accept a param? [it doesn't] syntactically it could, but most cases a bracketed query is a fine solution.


I need to continuously check the ColorFX settings for all decks (the cycle is in oninit), I thought something like this.
deck master repeat_start '$RP_DJM_900nxs' 250ms &
(deck master repeat_start_instant '$RP_ColorFX' 40ms 4 &
set 'SelectDeckColorFX' +1 &
(var 'SelectDeckColorFX' 5 ? set 'SelectDeckColorFX' 1 : nothing) &
deck 'SelectDeckColorFX' &
........
........
........)
.....
.....

 

Inviato Thu 06 Oct 22 @ 9:12 am
locoDogPRO InfinityModeratorMember since 2013
I've been back for 2 minutes and I'm already getting irritated.

set varname +1 is wasteful in your circumstance, use cycle varname 4
that gets rid of your bracketed wrap round bit, after that
( var varname 0 ? deck 1 select : var varname 1 ? deck 2 select : ... ) & whatever
 

Inviato Thu 06 Oct 22 @ 9:24 am
Just wanted to say ...... So so great to have you back Locodog ! !
 

Inviato Thu 06 Oct 22 @ 9:31 am
locodog wrote :
I've been back for 2 minutes and I'm already getting irritated.

set varname +1 is wasteful in your circumstance, use cycle varname 4
that gets rid of your bracketed wrap round bit, after that
( var varname 0 ? deck 1 select : var varname 1 ? deck 2 select : ... ) & whatever


1/ I'm glad that someone who knows script is taking care of us here
2/ I apologize for any mistakes in English. I'm not a native speaker.
3/ I would rate myself as a slightly more advanced beginner in scripting.
4/ Thanks for CYCLE. I tried what you suggest first.
5/ What you suggest won't work, what I noticed is that what happens in the script between (deck X select) doesn't carry over to the script after ()
This is just a test script
This will work but unusable for the cycle
deck 1 &
cycle 'varname' 2 &
(var 'varname' 0 ?
deck 1 & play & wait 1000ms & stop :
var 'varname' 1 ?
deck 2 & play & wait 1000ms & stop :
nothing)


this always starts deck1
deck 1 &
cycle 'varname' 2 &
(var 'varname' 0 ?
deck 1 :
var 'varname' 1 ?
deck 2 :
nothing) &
wait 100ms &
play & wait 1000ms & stop
 

Inviato Thu 06 Oct 22 @ 5:56 pm
locodog wrote :
I've been back for 2 minutes and I'm already getting irritated.

set varname +1 is wasteful in your circumstance, use cycle varname 4
that gets rid of your bracketed wrap round bit, after that
( var varname 0 ? deck 1 select : var varname 1 ? deck 2 select : ... ) & whatever



so you can see what I mean:
pod USER/CUSTOM BUTTON
set '$DJM_Shift' 1 &
deck master repeat_start '$RP_MDJ_ColorFX' 250ms &
(deck master repeat_start_instant '$RP_ColorFX' 40ms 4 &
deck 2 &
cycle '$SelectDeckColorFX' 4 &
var_list &
(var '$SelectDeckColorFX' 0 ? deck 1 :
var '$SelectDeckColorFX' 1 ? deck 2 :
var '$SelectDeckColorFX' 2 ? deck 3 :
var '$SelectDeckColorFX' 3 ? deck 4) &
(var 'ColorFXSelectWindow' 1 ?
set 'ColorFXSelectWindow' 0 &
(effect_select 'colorfx' ?
nothing :
effect_select 'colorfx' &
set 'WindowColorFX' 1) &
(repeat_start 'RD_ColorFXSelect' 3000ms 1 &
effect_select 'colorfx' ?
effect_select 'colorfx' &
set 'WindowColorFX' 0 :
nothing) :
nothing) &
(var $DJM_Shift 1 ?
nothing :
var 'WindowColorFX' 1 ?
effect_select 'colorfx' ?
effect_select 'colorfx' &
set 'WindowColorFX' 0 :
nothing))


pod USER/CUSTOM SLIDER
set 'SliderColorFX' &
var '$DJM_ColorFX' 0 ?
var '$DJM_Shift' 1 ?
filter_slider 50% &
effect_select 'colorfx' &
set 'ColorFXSelectWindow' 1 :
filter_slider


This is how the deck2 popup window works when selecting a custom slider.
Then remove the "deck 2" custom button from the script.
It won't work.
How to cycle through all decks?
 

Inviato Thu 06 Oct 22 @ 6:46 pm
locoDogPRO InfinityModeratorMember since 2013
not reading, lost interest,
deck X
on its own does nothing, it needs to be followed with the select verb.
 

Inviato Thu 06 Oct 22 @ 10:30 pm
locodog wrote :
not reading, lost interest,
deck X
on its own does nothing, it needs to be followed with the select verb.


Why? Did I write something inappropriate?

deck X select - selects a deck and at the same time makes it the default working deck.

deck X - only specifies the deck with which the script will work.
Deck x is not in the LIST OF VERBS, but it works like this. However, I found it in many scripts.
Try below button
repeat_start_instant '$RP' 3000ms 3 &
deck 1 & play & wait 1000ms & stop &
deck 2 & play & wait 1000ms & stop
 

Inviato Fri 07 Oct 22 @ 7:56 am
mg_1978PRO InfinityMember since 2008
mg_1978 wrote :
hi at all! i would map a button that pushed “holding” 700ms set ‘variable’ 1 while_pressed, not holding make action1:
button= holding 700ms : set ‘variable’ 1 : var ‘variable’ 1 ? set ‘variable’ 0 : action1

but doesn’t work correctly :(
could you help me? thanks


solved:
script is: var ‘variable’ 1 ? up ? set ‘variable’ 0 : nothing : holding 700ms ? set ‘variable’ 1 : action1

 

Inviato Fri 07 Oct 22 @ 11:20 am
hrdnxPRO InfinityMember since 2011
Greetings all
I have this script whic I use to colour code my tracks according to Key Colour. Found it within this site.
It runs automatically, but the (very slight) problem is that when it reaches to a track that is 12B, it stops.
Is there a way to change this behaviour?? I tried modifying the last line with no luck,
TIA


repeat_start 'colorTracks' ? on & repeat_stop 'colorTracks' : off & browser_window "songs" & browser_scroll "top" & repeat_start 'colorTracks' 100ms & browser_scroll 'bottom' ? repeat_stop 'colorTracks' & get_browsed_song 'harmonic' & param_cast 'text' & param_equal '01A' ? browsed_song color '#70ECD4' : param_equal '01B' ? browsed_song color '#00EDC9' : param_equal '02A' ? browsed_song color '#92F0A4' : param_equal '02B' ? browsed_song color '#27EC82' : param_equal '03A' ? browsed_song color '#B1EE86' : param_equal '03B' ? browsed_song color '#85ED4E' : param_equal '04A' ? browsed_song color '#E6E0A2' : param_equal '04B' ? browsed_song color '#E0C86E' : param_equal '05A' ? browsed_song color '#FEC8AC' : param_equal '05B' ? browsed_song color '#FFA279' : param_equal '06A' ? browsed_song color '#FFB3BF' : param_equal '06B' ? browsed_song color '#FF8C93' : param_equal '07A' ? browsed_song color '#FFB4D2' : param_equal '07B' ? browsed_song color '#FF85B4' : param_equal '08A' ? browsed_song color '#EBB7F9' : param_equal '08B' ? browsed_song color '#F087D9' : param_equal '09A' ? browsed_song color '#E7B6F8' : param_equal '09B' ? browsed_song color '#CE93FF' : param_equal '10A' ? browsed_song color '#C0CEFB' : param_equal '10B' ? browsed_song color '#A1B9FF' : param_equal '11A' ? browsed_song color '#94E5F8' : param_equal '11B' ? browsed_song color '#3ED2F8' : param_equal '12A' ? browsed_song color '#50EBF0' : param_equal '12B' ? browsed_song color '#01EDED' : nothing : get_browsed_song 'harmonic' & param_cast 'text' & param_equal '01A' ? browsed_song color '#70ECD4' & browser_scroll +1 : param_equal '01B' ? browsed_song color '#00EDC9' & browser_scroll +1 : param_equal '02A' ? browsed_song color '#92F0A4' & browser_scroll +1 : param_equal '02B' ? browsed_song color '#27EC82' & browser_scroll +1 : param_equal '03A' ? browsed_song color '#B1EE86' & browser_scroll +1 : param_equal '03B' ? browsed_song color '#85ED4E' & browser_scroll +1 : param_equal '04A' ? browsed_song color '#E6E0A2' & browser_scroll +1 : param_equal '04B' ? browsed_song color '#E0C86E' & browser_scroll +1 : param_equal '05A' ? browsed_song color '#FEC8AC' & browser_scroll +1 : param_equal '05B' ? browsed_song color '#FFA279' & browser_scroll +1 : param_equal '06A' ? browsed_song color '#FFB3BF' & browser_scroll +1 : param_equal '06B' ? browsed_song color '#FF8C93' & browser_scroll +1 : param_equal '07A' ? browsed_song color '#FFB4D2' & browser_scroll +1 : param_equal '07B' ? browsed_song color '#FF85B4' & browser_scroll +1 : param_equal '08A' ? browsed_song color '#EBB7F9' & browser_scroll +1 : param_equal '08B' ? browsed_song color '#F087D9' & browser_scroll +1 : param_equal '09A' ? browsed_song color '#E7B6F8' & browser_scroll +1 : param_equal '09B' ? browsed_song color '#CE93FF' & browser_scroll +1 : param_equal '10A' ? browsed_song color '#C0CEFB' & browser_scroll +1 : param_equal '10B' ? browsed_song color '#A1B9FF' & browser_scroll +1 : param_equal '11A' ? browsed_song color '#94E5F8' & browser_scroll +1 : param_equal '11B' ? browsed_song color '#3ED2F8' & browser_scroll +1 : param_equal '12A' ? browsed_song color '#50EBF0' & browser_scroll +1 : param_equal '12B' ? browsed_song color '#01EDED' & browser_scroll +1
 

Inviato Sat 08 Oct 22 @ 12:53 am
locoDogPRO InfinityModeratorMember since 2013
looked ok, try this thinned down version

repeat_start 'colorTracks' ? on & repeat_stop 'colorTracks' : off & browser_window "songs" & browser_scroll "top" & repeat_start 'colorTracks' 100ms & ( get_browsed_song 'harmonic' & param_cast 'text' & 
param_equal '01A' ? browsed_song color '#70ECD4' :
param_equal '01B' ? browsed_song color '#00EDC9' :
param_equal '02A' ? browsed_song color '#92F0A4' :
param_equal '02B' ? browsed_song color '#27EC82' :
param_equal '03A' ? browsed_song color '#B1EE86' :
param_equal '03B' ? browsed_song color '#85ED4E' :
param_equal '04A' ? browsed_song color '#E6E0A2' :
param_equal '04B' ? browsed_song color '#E0C86E' :
param_equal '05A' ? browsed_song color '#FEC8AC' :
param_equal '05B' ? browsed_song color '#FFA279' :
param_equal '06A' ? browsed_song color '#FFB3BF' :
param_equal '06B' ? browsed_song color '#FF8C93' :
param_equal '07A' ? browsed_song color '#FFB4D2' :
param_equal '07B' ? browsed_song color '#FF85B4' :
param_equal '08A' ? browsed_song color '#EBB7F9' :
param_equal '08B' ? browsed_song color '#F087D9' :
param_equal '09A' ? browsed_song color '#E7B6F8' :
param_equal '09B' ? browsed_song color '#CE93FF' :
param_equal '10A' ? browsed_song color '#C0CEFB' :
param_equal '10B' ? browsed_song color '#A1B9FF' :
param_equal '11A' ? browsed_song color '#94E5F8' :
param_equal '11B' ? browsed_song color '#3ED2F8' :
param_equal '12A' ? browsed_song color '#50EBF0' :
param_equal '12B' ? browsed_song color '#01EDED' : )
& browser_scroll 'bottom' ? repeat_stop 'colorTracks' : browser_scroll +1
 

Inviato Sat 08 Oct 22 @ 2:17 am
locodog wrote :
looked ok, try this thinned down version


Where would I put this?
 

Inviato Sat 08 Oct 22 @ 5:42 am
On a custom button, for example.
 

Inviato Sat 08 Oct 22 @ 7:41 am
I was using the original version but, this version is way faster and doesn't hang on different bitrates or formats, cheers @locodog (and good to see you back too)
 

Inviato Sat 08 Oct 22 @ 9:41 am
hrdnxPRO InfinityMember since 2011
Great work as always man
Works perfect now
 

Inviato Sat 08 Oct 22 @ 1:01 pm
Denny DennYo wrote :
On a custom button, for example.
Doesnt seem to let me copy/paste; do I have to type this in?

 

Inviato Sat 08 Oct 22 @ 1:43 pm
Djratedxxx919 wrote :
Denny DennYo wrote :
On a custom button, for example.
Doesnt seem to let me copy/paste; do I have to type this in?



copy and paste no longer works in the new update !!!
 

Inviato Sat 08 Oct 22 @ 1:49 pm
ctrl+v works only rightclick paste doesn't work
 

Inviato Sat 08 Oct 22 @ 2:31 pm
59%