switch between cartwall libraries

You have a question or need an advice about how to do something? Ask it here!
Post Reply
tatje
Posts: 73
Joined: 23 Feb 2013 14:10
switch between cartwall libraries

Post by tatje »

Hi,
It is also possible to switch between the cartwall lib: via a command.
For example: DJ1 cartwall lib: (command) over to DJ2 cartwall lib: (command) over to DJ3 ... etc, and Back.
This for example under a user command or via midi launchpad.
Which command line can I use for this

Tatje
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: switch between cartwall libraries

Post by radio42 »

I am not exactly sure what you mean, esp. by DJ1 and DJ2 - but yes, you can fully remotely control the cartwalls as well as the carts within the cartwall via control-commands. Take a look to the control- commands starting with either CW1_ resp. CW2_ within the user manual appendix, this lists all cartwall commands - which you might also trigger via an external midi controller.
tatje
Posts: 73
Joined: 23 Feb 2013 14:10
Re: switch between cartwall libraries

Post by tatje »

[img][/im
Naamloos.jpg
g]


Hi bernd,
what I mean is switching between what you see in the circled.
With 2 buttons on the launchpad
1 button forward
and 1 button return
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: switch between cartwall libraries

Post by radio42 »

You need to do a little coding for this.
E.g. you use variable in which you store a number (index) referenceing your cartwall lib entries.
And with the forward button you increase its value by one, and with the back button you decrease it by one.
An then depending on its value you select a cartwall lib (via CW1_PLAYLIST_SET).
Alternatively you can set four (4) cartwall libs to the 4 shortcut buttons and then use the buttons to toggle between those (via CW1_PLAYLIST_SET_SHORTCUT).

The index variable value is set via the EXEC_VAR_SET command and retrieved via the ${VAR:...} macro.
The increment or decrement of the variable can be done via the *[TOINT:{num}:{conv}:{p1}] macro function.
The conditional execution of a command can be done via EXEC_COMMAND2.
See the Appendix of the user manual for detils...

Let us start with the latter option...

Alternative 1 (using the four shortcut buttons):

When the ButtonForward is pressed:

Code: Select all

EXEC_VAR_SET cw1select|*[TOINT:{${VAR:cw1select}}:{add}:{1}]
EXEC_COMMAND2 ${VAR:cw1select}|OR(Equals(4),Equals())|EXEC_VAR_SET cw1select|0
CW1_PLAYLIST_SET_SHORTCUT ${VAR:cw1select}
When the ButtonBackward is pressed:

Code: Select all

EXEC_VAR_SET cw1select|*[TOINT:{${VAR:cw1select}}:{add}:{-1}]
EXEC_COMMAND2 ${VAR:cw1select}|OR(Equals(-1),Equals())|EXEC_VAR_SET cw1select|3
CW1_PLAYLIST_SET_SHORTCUT ${VAR:cw1select}
---
Alternative 2 (using cartwall lib names):

When the ButtonForward is pressed:

Code: Select all

EXEC_VAR_SET cw1select|*[TOINT:{${VAR:cw1select}}:{add}:{1}]
EXEC_COMMAND2 ${VAR:cw1select}|OR(Equals(3),Equals())|EXEC_VAR_SET cw1select|0
EXEC_COMMAND2 ${VAR:cw1select}|Equals(0)|CW1_PLAYLIST_SET jwnwjh
EXEC_COMMAND2 ${VAR:cw1select}|Equals(1)|CW1_PLAYLIST_SET kerst
EXEC_COMMAND2 ${VAR:cw1select}|Equals(2)|CW1_PLAYLIST_SET rijnsteek
When the ButtonBackward is pressed:

Code: Select all

EXEC_VAR_SET cw1select|*[TOINT:{${VAR:cw1select}}:{add}:{-1}]
EXEC_COMMAND2 ${VAR:cw1select}|OR(Equals(-1),Equals())|EXEC_VAR_SET cw1select|2
EXEC_COMMAND2 ${VAR:cw1select}|Equals(0)|CW1_PLAYLIST_SET jwnwjh
EXEC_COMMAND2 ${VAR:cw1select}|Equals(1)|CW1_PLAYLIST_SET kerst
EXEC_COMMAND2 ${VAR:cw1select}|Equals(2)|CW1_PLAYLIST_SET rijnsteek
tatje
Posts: 73
Joined: 23 Feb 2013 14:10
Re: switch between cartwall libraries

Post by tatje »

hi Bernd,
Thank you for your response
I used Alternative 2 (using cartwall lib names): and this works until I get to the last cartwall library and press the button again.
Then switching via the up and down buttons does nothing anymore. If I restart PF then it works again until I get back to the last cartwall library.
is there any code in this script to make it count the index variable value no further than the last cartwall lib: and then count back to the first cartwall lib. and doesn't count any further here.

EXEC_VAR_SET cw1select|*[TOINT:{${VAR:cw1select}}:{add}:{1}]
EXEC_COMMAND2 ${VAR:cw1select}|OR(Equals(5),Equals())|EXEC_VAR_SET cw1select|0
EXEC_COMMAND2 ${VAR:cw1select}|Equals(0)|CW1_PLAYLIST_SET DJ Jingels
EXEC_COMMAND2 ${VAR:cw1select}|Equals(1)|CW1_PLAYLIST_SET Een tafel voor 2/user3
EXEC_COMMAND2 ${VAR:cw1select}|Equals(2)|CW1_PLAYLIST_SET JWNWJH/user1
EXEC_COMMAND2 ${VAR:cw1select}|Equals(3)|CW1_PLAYLIST_SET Stationcall
EXEC_COMMAND2 ${VAR:cw1select}|Equals(4)|CW1_PLAYLIST_SET Weekjournaal/user2


EXEC_VAR_SET cw1select|*[TOINT:{${VAR:cw1select}}:{add}:{-1}]
EXEC_COMMAND2 ${VAR:cw1select}|OR(Equals(5),Equals())|EXEC_VAR_SET cw1select|0
EXEC_COMMAND2 ${VAR:cw1select}|Equals(0)|CW1_PLAYLIST_SET DJ Jingels
EXEC_COMMAND2 ${VAR:cw1select}|Equals(1)|CW1_PLAYLIST_SET Een tafel voor 2/user3
EXEC_COMMAND2 ${VAR:cw1select}|Equals(2)|CW1_PLAYLIST_SET JWNWJH/user1
EXEC_COMMAND2 ${VAR:cw1select}|Equals(3)|CW1_PLAYLIST_SET Stationcall
EXEC_COMMAND2 ${VAR:cw1select}|Equals(4)|CW1_PLAYLIST_SET Weekjournaal/user2
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: switch between cartwall libraries

Post by radio42 »

Uups, there was a little typo in the Button Back...

Instead of:
EXEC_COMMAND2 ${VAR:cw1select}|OR(Equals(5),Equals())|EXEC_VAR_SET cw1select|0

It must be:
EXEC_COMMAND2 ${VAR:cw1select}|OR(Equals(-1),Equals())|EXEC_VAR_SET cw1select|4
tatje
Posts: 73
Joined: 23 Feb 2013 14:10
Re: switch between cartwall libraries

Post by tatje »

Hello bernd,
It works, I am very happy with it.
many thanks for the script.
have a nice weekend of what's left.
Greetings, Tatje

Post Reply