There seems to be some confusion between a "Sequence" and a "Script"
First off I am no expert on C# or the internal coding of Vixen, what I present is my view and current understanding of how and why things are occurring given a set of circumstances.
Feel free to correct any misconceptions.
Sequence is a matched music to lights,ledtricks,rds,etc file all in one. you make several sequences to create a "Program" this is your Show you present to the public.
A Script is a C# set of programming commands that can be run when a sequence or Program are not on. I'm sure there is a way, but no one has ventured that far into programing the the Script to include anything but simple and medium level light commands.
Player feature, the audio player can be loaded with songs that play when NO Sequences or Programs are running. HOWEVER, the Player music can run at the same time as a Script but they are in no way synchronized and nor should they be considered so.
A Script , Sequence or Program all demand the exclusive ownership of the Controller and its Plugin, you cannot have a script running and fire up a Sequence without them fighting over the controller, we see this as the "Null" or "Port already in use" error.
If you get this error, its best to close Vixen and restart it.
I've found that once it occurs once especially with a scheduled Program, Vixen does not release the condition until the program is stopped.
Without a Fade, its a crap shoot as to whether your mouse finger can execute another command before the BGS script triggers.
Turn off the BGS and Player while your creating or editing sequences.
Remember GIGO.. Garbage In, Garbage Out.. what your telling Vixen to do via the Script is not necessarily what you want it to do.
/MOVIE analogy;
In a different approach to this, think of this as going to the MOVIES
First you don't watch 2 Movies at the same time (1 Sequence, 1 Program) so don't have a sequence running/editing/testing when a Program runs or try it vice-versa.
While waiting for the show to start your listening to some softer background music while watching video trivia on the screen.
The Player = the soft background music
The Script is running the trivia presentation
The Movie is your Sequence or Program
Prior to the MOVIE starting, your listening to music and watching mainly unrelated images. This is your BGS and PLAYER.
There is a fade in lights, the music fades and the screen fades to black.
This is your FADE you need BOTH PLAYER and BGS to fade at the same time or you may invoke the error.
(Set Vixen's Fades to the same time if your running both Player and BGS.)
And the MOVIE begins....
/End MOVIE analogy;
If your Program or Show is only 20min 45 sec long;
You set your PROGRAM to BEGIN the sequence or SHOW at 5:00pm each night and it plays only once.
You have this setup if you already have BGS and Player set up as well.
prior to 5:00pm = BGS + Player
at 5:00pm = fade
after the fade = SHOW
after the show = fade
after the fade = BGS+ Player
Now the important thing to remember is the SHOW has to END before the BGS + Player will begin.
If your sequence is 20minutes and 45 seconds long then it will not END until is plays the entire 20 minutes and 45 seconds.
If you tell your Program to start at 5:00pm you need to add in your FADE time + total Program or Sequence time to determine when it actually ENDS.
example;
Its 4:59pm and your BGS + Player are running
at 5:00pm the Scheduled Program begins and instructs the FADE to occur( lets set Fade to 5 seconds) (add 1 second to allow the plugins or controllers to release)
at 5:00:06 the actual program starts and runs for 20 minutes and 45 seconds.
so at 5:20:51 the Program ends , controllers and plugins are released and Fade begins
Now your BGS+Player begins at 5:20:56
5:00.00 +00:00:05 +00:00:01 +00:20:45 +00:00:05
The above is for a single playing of your 20min 45sec sequence.
If you schedule your sequences in the Program to REPEAT until 7PM this is what will occur.
Its 4:59pm and your BGS + Player are running
at 5:00pm the Scheduled Program begins and instructs the FADE to occur( lets set Fade to 5 seconds) (add 1 second to allow the plugins or controllers to release)
at 5:00.06 the actual program starts and runs for 20 minutes and 45 seconds.
Vixen checks the Time(NOW) and its not 7:00pm so it repeats
at 5:20.46 the Program has completed
Vixen checks the Time(NOW) and its not 7:00pm so it repeats
at 5:41.31 the Program has completed
Vixen checks the Time(NOW) and its not 7:00pm so it repeats
at 6:02.16 the Program has completed
Vixen checks the Time(NOW) and its not 7:00pm so it repeats
at 6:22.01 the program has completed
Vixen checks the Time(NOW) and its not 7:00pm so it repeats
at 6:42.46 the program has completed
Vixen checks the Time(NOW) and its not 7:00pm so it repeats
at 7:03.31 the program has completed
Vixen checks the Time(NOW) and its equal to or greater than 7:00pm so ENDS
The Scheduled Program now ends at 7:03:31
Fades for 5 seconds as it switches back to the BGS + Player
The Plugins and controllers are owned until 7:03:31. as the Program has already issued the END command which then triggers the Fade into the BGS after the current program completes at 7:03:31
So telling a Script or trying to execute another program at 7:00:00pm will result in an Error.
You will also encounter Scheduled Programs (my 2009 was this way) where my entire Program played for 5 hours from 5pm to 10pm each night. The accumulated times had the Program end at 9:57 so it began again and played through until 10:38pm each night even though I scheduled a 10pm halt to the scheduled Program.
In my case the Plugins and Controllers are still owned by the Program until 10:38pm even though one might believe that at 10pm I can execute a script or other sequence..
Im my case the ownership of the plugins and controllers last MUCH longer than one would expect or anticipate without understanding what is occurring.
Now the most frequent issues seem to be with START/END timers coded into the SCRIPTS
If you have your BGS with timers built in coded to begin at 4:30pm and run some simple lights, the tell it to stop showing those lights at 5:00pm (to allow the Program to run) and begin again at 7pm (after the Program is over).
You will get an error
Why?
The SCRIPT HAS NOT STOPPED.
Its cycling a loop watching the time to see when it can execute its next command.
Its retaining ownership of the Plugin and controllers and you ALSO instructed the Program Scheduler to begin at 5pm.
This will also occur if you Schedule the Program to stop repeating at 10pm but the sequences will still play through to completion BUT you also coded your SCRIPT to begin at 10pm as well. This depends on where in the script you coded the START/END timers.
The differences between the scripts, sequences and Programs and how they affect each other would be the main root problem to issues many encounter.
One way to prevent this is to NOT use the Script as a scheduled Program or as a sequence.
Use each part as they are intended.
1. Sequence a song to the lights
2. Combine many Sequences into a Program using the Program Manager.
3. Use the Program Scheduler to set up the timings for your Program.
4. Use the Script Editor and execution to handle the "intermission" periods between Scheduled Shows (Programs)
Unless you really need to Start/End timers in your script. there is no need for them and they only cause errors if not coded correctly or understand how they will get implemented.
If your unsure of exactly how to do something you want to happen and in which order then post a message and use a step by step example of what your expecting. Use real times whenever possible.
There are many here that can help, we just need to know exactly what the question is..
With Blinky Flashy, the most typical flow is this..
How Do I.... ?
I have created...
Try
Fix or find another way to
followed by
actually works!
Hey everyone, watch !!!
Owwww that hurt my head trying to follow along.
Just follow the bouncing ball. pay no attention to the pickpocket standing beside you.....
I didn't realize that the music player runs at the same time as a background script. That's what I really want to happen after my show. I've currently been using a "Night Time" sequence repeated all night long, but I'd like to have the music player running at the same time. I guess I'll have to look into using scripts for next year.
Thanks for the info Aurbo99.
I followed along and agreed with everything up to the BGS start/end timer part...
I ran my BGS script in a loop and was running 24/7. The script has a while loop to turn on lights and so simple transitions between a start and end time. I had lights turn on at a point before my program and then off later in the evening. The start and end times have nothing to to do with when the BGS scripts runs - it is always running - they just control which portions of the script will execute at specific times. Vixen would cause the BGS script to exit on it's own before a scheduled event would start. (or if I forgot to disable it when testing - even before I would run a sequence via the GUI.) And it would just start back up aftetr the timeout period had past.
You did say timers though, which has my brain spinning on what my problem may have been with complicated scripts with many ramps and chases. Going to go test some stuff and post my findings. You may have just triggered my brain into understanding and exploring further the jscript timers internal to the ramps and chases. This may take several days as I have had to return to my non-holiday work schedule... 🙁
rokkett wrote:I followed along and agreed with everything up to the BGS start/end timer part...I ran my BGS script in a loop and was running 24/7. The script has a while loop to turn on lights and so simple transitions between a start and end time. I had lights turn on at a point before my program and then off later in the evening. The start and end times have nothing to to do with when the BGS scripts runs - it is always running - they just control which portions of the script will execute at specific times. Vixen would cause the BGS script to exit on it's own before a scheduled event would start. (or if I forgot to disable it when testing - even before I would run a sequence via the GUI.) And it would just start back up aftetr the timeout period had past.
You did say timers though, which has my brain spinning on what my problem may have been with complicated scripts with many ramps and chases. Going to go test some stuff and post my findings. You may have just triggered my brain into understanding and exploring further the jscript timers internal to the ramps and chases. This may take several days as I have had to return to my non-holiday work schedule... 🙁
Its depends WHERE within the script you place your START/END code. Last year I had mine embedded inside a nested loop that prevented the script from proceeding until it meet the conditions. This cause my script to lock up everything.
This year I placed my Start/End timer code (I even think I copied your initial loop on this) and all ran fine as it was not nested.
What exactly is a background sequence? I haven't figured it out nor how to use them.
kiowamike wrote:What exactly is a background sequence? I haven't figured it out nor how to use them.
Think of a background sequence as a way to control lights without synchronizing to music (which is not to say that music can't play -- just that the lights are synchronized).
Many people use a background sequence to have their lights doing something in twilight just before dark before their show and something after the show.
For example, my next-door neighbors turned on their lights most nights at 4:45, but my show didn't start until 5:30. So I was dark for about 45 minutes when they were illuminated. Also, they turned off their lights about 11 or so, while my show ended at 10. So I was dark for an hour while they had some lights on.
If I could master background sequencing (and the C# part is what has kept me from trying), I would have one that ran from 4:45 until 11. When the show starts at 5:30 (a "program"), the background sequence literally falls into the background (that is, it's turned off) and when the show ends, it's brought back from the background (turned on) until 11.
HTH.
\dmc
AHHH, now it makes since.
Wow. A lot of info! My head hurts!!
OK, I'm prepping to use a BGS with BGMusic next year and here is what I would like to do. First, I'll say my Program is going to be 15 minutes for kicks. Also, for my desired script complexity, I'll mention example channels/groups as Blue, Red, Green, and White to be mentioned later.
I would like to schedule a task to start Vixen at 5:45 PM
I want a BGS with BGMusic to start at 6 PM with a configuration of Red and Green Channels.
I'll schedule my Program to run at 6:15, 6:45, 7:15, 7:45, 8:15, 8:45, 9:15, 9:45.
So, the BGS should pick up again at these approximate times (not taking fades into account): 6:30, 7:00, 7:30, 8:00, 8:30, 9:00, 9:30, 10:00.
All should go dark or the BGS should fade/end at 10:30 PM.
Vixen would close at 10:45 or thereabouts.
Is the idea of the BGS in my scenario that it actually runs from 6 - 10:30 PM? Does Vixen automatically handle the fades and resumption (shouldn't really say that I guess if the script continually runs in my mentioned time span) of the BGS when each scheduled ocurrence of my Program starts/ends?
For the complexity of the script, when the BGS runs at or after 7 PM for example, I want the configuration to be the Blue and White channels instead of the aforementioned Green & Red. Can this be accomplished? Is there more danger of error in doing this.
The other consideration I have to make is that the fades are set the same for both BGS and BGMusic, correct?
I should also add that I am running 2.1.4.0 so I don't know if that makes it harder or easier for anyone to help, give pointers, etc.
Any bare-bones sample scripts with my running version in mind would be more than appreciated.
I've been reading up on BGSs and it does seem there is a lot of confusion with timing, errors, etc, which scares me a little. The coding doesn't seem all that bad but I'm not a C# guy so it will be a good learning experience that I'm looking forward to. I don't know the range of on/off methods/functions either but I guess I'll learn some as I crawl along.
