Quick Sign In:  

Forum: General Discussion

Topic: Mapping Help!!
Hi !!

I want to map the key combo Ctrl-B to :
1) take me to the start of the track
2) If the track was already playing, continue playing (from the start)
3) If the track was paused/stopped, stay paused/stopped

This is how I've mapped it:
goto_start & play_pause

However, it goes to the beginning ... but always PLAYS the track irrespective if the deck was paused or stopped.

Could any of you Guru's help? Thanks.
 

Posted Wed 27 Sep 23 @ 7:07 pm
locoDogPRO InfinityModeratorMember since 2013
 

Posted Wed 27 Sep 23 @ 7:27 pm
Thank a ton Locodog for your response & pointers. You've got some amazing tutorials and pointers here. 🙏

Although I've done some coding in the past, it took me a while to figure out the if-then-else syntax. I managed to get it to work though ... so a huge shout out to you mate.

BTW, here's my script ...

Key Mapped = Ctrl-B
deck active play ? goto_start && play : goto_start

What it accomplishes:
If the ACTIVE DECK is Playing ... Go To the Beginning of the Track & start Playing.
If the ACTIVE DECK is not playing ... Just Go To the Beginning of the Track.

P.S. I love this scripting language. Looking further into variables to which certain STATES can be polled & saved so more complex conditions can be built based on the return values of those variables.
 

Posted Thu 28 Sep 23 @ 7:22 am
As an add-on to the above mapping ...

I'd like to check if the song in the active deck has a LOAD POINT set ...
1) If so ... Go To the Load Point
2) Else ... Go To the Beginning of the Track.

Basically I want to query for the existence of a Load Point Cue and take action accordingly.
If that's possible, kindly also mention how I'd nest this 2nd IF-THEN-ELSE command within my above 1st IF-THEN-ELSE.

Once I get a Nesting example, I'll be able to utilize it further.

Thanks 🙏
 

Posted Thu 28 Sep 23 @ 8:35 am
locoDogPRO InfinityModeratorMember since 2013
Thanks, just sharing what I bugged others to learn.

deck needs a specifier, I assume it's just a typo on your part.
So I edited your post for future readers.

Pretty much anything that is part of the skin.xml or can be acted on with a key can be queried, the only gaps in script are pop up windows [they're usually mouse only]
 

Posted Thu 28 Sep 23 @ 8:35 am
locoDogPRO InfinityModeratorMember since 2013
queries are ternary operations

if a ?
__ if b ?
____ a && b == true :
____ a == true, b == false :
__ a == false, b unqueried


as for load point, I don't believe you can query if it exists by point type, you can however query & goto by point name

manually name loadpoint to "loadpointname"
then we can
[script]has_cue loadpointname ? goto_cue loadpointname : settings "mapping"/script]
if a cue with name loadpointname exists go to it : if not open mapping window for no real reason. [but if you get in to mapping a script to get there is so useful]
 

Posted Thu 28 Sep 23 @ 8:49 am