Conditions in Scheduler Script

You have a question or need an advice about how to do something? Ask it here!
Post Reply
RonJV
Posts: 7
Joined: 02 Dec 2020 19:28
Conditions in Scheduler Script

Post by RonJV »

I am trying to implement a scheduler script based on the Condition options available.
At the start of the scheduler time slot I would like to first check if the DJ is live. If yes stop the automation for that time slot. If no live DJ, play a new recorded show with a specific file name and file location for that time slot. If that file does not exist, play an archived show using a filename in a different location.
Do I need to stack (script that runs another script) two "If Then Else" scripts to accomplish this decision making?
I also noted the AutoPlay condition at the bottom of the "if Then Else" script Condition setup. Can this be used in my scenario? As I understand it the AutoPlay condition being false would shut off the autoplay mode. If auto mode were off, would this allow for a live DJ preempt the schedule for that scheduler time slot?
I would like to test the script "condition" execution using a test bit. I am fairly new to Proppfrexx and I see the EXEC_VAR_SET command to establish a variable. But I am not sure where to properly run this command to define the variable as well as where and how to set the value of the variable.
Thanks!
User avatar
radio42
Site Admin
Posts: 6539
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Conditions in Scheduler Script

Post by radio42 »

The main question is, how you'd like to detect, if the DJ is physically in the studio (at the time when the new program opens - not started; i.e. consider the show in advance time)?

The most simple way is to let him open a mic channel.
If that is good enough, click on the 'Condition' button next to the script selection and enter "${onair}|Equals(1)" (without the quotes) in the 'Autoplay Condition' field. This way, the program will only switch to AutoPlay in case the input channels are down resp. muted. As a result, the program is loaded, but not started - i.e. the DJ can play his live show.

Else you might want the DJ to press e.g. a 'User Commands' button to notify the system, that he is physically present.
Here you could set a local variable via EXEC_VAR_SET, e.g. use the following assignment for Button1:

Code: Select all

EXEC_VAR_SET djpresent|1
In the program scheduler entry you now also set the Condition accordingly using for example again the 'Autoplay Condition' but use the following condition: "${VAR:djpresent}|Equals(1)".
To reset the user macro for the next program, you can for example use the program event command 'On Program Started':

Code: Select all

EXEC_VAR_SET djpresent|0
The regular Condition doesn't make much sense here, as it only selects between two alternative script - but in your case you actually don't want to start a program at all, in case the DJ is present.
The new vs. old recorded show can be handle in the script. E.g. in script-line 1 use the LoadPlaylist mode and define a dynamic file name using e.g. the macros ${start_dd}${start_HH}${start_mm} etc. (see the appendix of the user manual for a complete list).
If the macro will be resolved to a filename, which doesn't exist, this line will simply be skipped.
As a 2. script-line you could now specify the old program in almost the same way. Here you might even use macro functions (see the appendix of the user manual) to automatically calculate an old date and time from the above macros.
And finally set the 'Loop Line' parameter of the script to 3 and use a 3., 4. etc. script-lines to specify some randomized tracks from a media lib to be played in case the shows are short in time or both doesn't exist.
RonJV
Posts: 7
Joined: 02 Dec 2020 19:28
Re: Conditions in Scheduler Script

Post by RonJV »

Thank You for your excellent guidance on how to approach the decision making using conditions. I will go test it out.
Which brings me back to my second question in the post regarding testing. The "Button 1" you suggested looks like the same type of thing I would like to do to create a test bit. Where is the best place to set a variable in Proppfrexx and how do I create a User button associated with that variable? Is there a video or a place in the manual with some guidance on how to do this? Thanks!
User avatar
radio42
Site Admin
Posts: 6539
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Conditions in Scheduler Script

Post by radio42 »

Not sure what you mean by Test-Bit?
How to create and consume a variable is explained in the above post.
If you want to indicate the state of the User Button (e.g. by text or image), look at the SET_USER_COMMAND_TEXT resp. SET_USER_COMMAND_IMAGE.
You can use this together with the conditional command EXEC_COMAMND2, e.g. like this:

Code: Select all

EXEC_COMAMND2 ${VAR:djpresent}|Equals(1)|SET_USER_COMMAND_TEXT 1|DJ Present|1
EXEC_COMAMND2 ${VAR:djpresent}|Equals(0)|SET_USER_COMMAND_TEXT 1|DJ Offline|0
RonJV
Posts: 7
Joined: 02 Dec 2020 19:28
Re: Conditions in Scheduler Script

Post by RonJV »

I am starting to see how macros are implemented in Proppfrexx.
User Commands are the "buttons"! And Control Commands are available in various places depending on what I am trying to do.
Do you have any recommendations for testing a scheduler program for a specific time slot? I would expect that it involves entering a Proppfrexx system time just prior to the scheduler time slot. What is the best way to do that or any other method for executing a scheduler program to test on command? Thanks!
RonJV
Posts: 7
Joined: 02 Dec 2020 19:28
Re: Conditions in Scheduler Script

Post by RonJV »

I successfully implemented the DJ present User Commands you suggested earlier in this thread in order to activate the Auto Play Condition in each program. However I would like to use your other suggestion for checking the DJ detection... that being ${onair}|Equals(1) . However I believe that requires an integrated DJ board that Proppfrexx recognizes. Is that true or is there another way to remotely (from a standalone DJ board) turn the Proppfrexx Onair status on?
We were thinking of wiring the microphone output from the DJ board and checking the Level coming into Proppfrexx to be above a certain level. Something like ${inputmixer1levellhui} Greater(4[, string]) OR ${inputmixer1levelrhui} Greater(4[, string]) in the Auto Play condition? If you have comments or other suggestions, I am all ears.
Also if we use this method of input mixer level ( string), is there a way to display the string somewhere in Proppfrexx Thank You!
User avatar
radio42
Site Admin
Posts: 6539
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: Conditions in Scheduler Script

Post by radio42 »

The ${onair} macro is true if any input mixer channel is ON, not muted and the fader is above 0. So it requires nothing but ProppFrexx!
No external input is monitored or can directly be detected!
Purely the mixer input channel is monitored, but that is what you do as well ;-)

Post Reply