Background Sewuence...
 
Notifications
Clear all

Background Sewuence / Script - No docs WTF?

9 Posts
5 Users
0 Reactions
5,546 Views
Posts: 209
Topic starter
(@marx1)
Reputable Member
Joined: 18 years ago
[#5155]

I have spent the last 2 hours searching for some form of documentation for the Scripted Sequences. I need a background sequence that turns on all channels except 16,17, and 26 our of 48. Channels 16 and 17 need to sparkle/random.

Every time i have used ANY sequence as a references i keep getting vixen errors about "A namespace does not directly contain members such as fields or methods" Even with a BLANK script.

Where can I find a document that shows how to do stuff, what commands etc?


8 Replies
Mudsculpter
Posts: 1222
Admin
(@mudsculpter)
Member
Joined: 19 years ago

Have you seen this?

some sample code

void Start() {
Off (All);
while (true) {
int A = 1;
int B = 17;
int C = 33;
int Z = 0;
On (Channels(Candy_Canes_right_96, Candy_Canes_mid_110, Candy_Canes_left_115), At(100));
On (Channels(Snowmen_right_99, Snowmen_left_114), At(100));
On (Channels(Eave_Icicles_104, Big_Wreath_92, Entry_Garland_103), At(100));
On (Channels(Big_Bulbs_entry_right_97, Big_Bulbs_entry_left_116), At(100));
On (Channels(Wreath_CT_98, Wreath_CT_101), At(100));
int V = 100;
while (Z<6) {
On (ChannelRange(A,A + 1), At(V), For(25).Milliseconds);
Z = Z + 1;
A = A + 1;
if (A > 16)
continue;
A = 1;
B = B + 1;
C = C + 1;
V = V - 20;
if (V < 0)
continue;
Off (ChannelRange(A,A + 1));
}
}
}
Standard.dll
------------
References: None
Imports: None
--------------------------------------------------------------------------------|
| Note: |
| |
| The examples will use this example channel list: |
| Channel_1 |
| Channel_2 |
| Channel_3 |
| Channel_4 |
--------------------------------------------------------------------------------|

| Properties |
Any of the channels imported into the scripted sequence are available by name.
Also, there is an additional "All" channel, which is all of the channels.

| Methods |
All assume to operate asynchronously; the action will return unless the Wait modifier is used (below).
void On(channels, modifiers);
void Off(channels, modifiers);
void Ramp(channels, int startIntensity, int endIntensity, modifiers); // Intensities are 0-100
void Random(channels, int saturationLevel, modifiers); // Saturation level is 0-100
void Chase(channels, modifiers);

"channels" is a ChannelCollection. There are a number of ways to create a ChannelCollection:
ChannelCollection ChannelRange(startChannel, endChannel);
Example: ChannelRange(Channel_2, Channel_4)
ChannelCollection ChannelRange(startChannel, int count);
Example: ChannelRange(Channel_2, 3)
ChannelCollection ChannelRange(int startIndex, int count);
Example: ChannelRange(1, 3)
ChannelCollection Channels(...);
The parameters for Channels() is a params list of channel collections. It can be used to create a single set of disjointed channel collections.
Example: Channels( Channel_1, ChannelRange(Channel_3,2) );
Example: Channels( ChannelRange(DateTime.Now.Hour,1), ChannelRange(10,10), Channel_2 );

"modifiers" is a params list made up of 0 or more of the following:
At(int level) // Intensity level, 0-100
For(int seconds) // Applies the action for the given time period.
Over(int seconds) // Same as For(), just makes better sense in some uses.
Wait // Wait for the action to complete.
Every(int seconds) // Occurs at every time interval.
Modifier time span:
The default measure of time is seconds. So For(5) would cause the action to span 5 seconds.
The measure of time can be changed with one of the following properties on the modifer:
Millisecond
Second
Minute
Hour
The plural version of each of those is also valid.
Example:
To have a chase span 3.7 seconds over the first 10 channels synchronously...
Chase( ChannelRange(1,10), Over(3700).Milliseconds, Wait )


Reply
Posts: 209
Topic starter
(@marx1)
Reputable Member
Joined: 18 years ago

I did not find the first one - but the second I did.

I was able to make the following semi-work; but it crashes vixen. I want channels 15 & 16 to randomly blink / flash every 50ms.



void Start() {
Off (All);
while (true) {
On (Channels(Tree_1), At(100));
On (ChannelRange(1,15), At(100));
On (ChannelRange(18,7), At(100));
On (ChannelRange(27,8), At(100));

Random (ChannelRange(15,2), 50, For(50).Second);

}
}

Reply
Posts: 209
Topic starter
(@marx1)
Reputable Member
Joined: 18 years ago

I forgot to ask - I need the sequence to start at say 5:30pm and turn everything off at 11:00pm - I saw some info from a LEDTriks post - but I still must ask - Why isn't there a sample for us who don't know or really care to learn c# about how to do a SIMPLE background sequence


Reply
Posts: 87
(@wingrunr)
Trusted Member
Joined: 19 years ago

For a 5:30 to 11 time range, you need to use a DateTime object.


void Start() {
	Off(All);

       DateTime now = DateTime.Now; //get the current time

        //The DateTime constructor goes (YYYY, MM, DD, HH, MM, SS)
	DateTime start = new DateTime(now.Year, now.Month, now.Day, 17, 30, 00);
	DateTime end = new DateTime(now.Year, now.Month, now.Day, 23, 00, 00);

        //We only want the channels to turn on while the current time is
        //between 5:30 and 11 pm
	while (now.CompareTo(start) >= 0 && now.CompareTo(end) <= 0)
	{
               On (Channels(Tree_1), At(100));
               On (ChannelRange(1,15), At(100));
               On (ChannelRange(18,7), At(100));
               On (ChannelRange(27,8), At(100));

               Random (ChannelRange(15,2), 50, For(50).Second);

	       now = DateTime.Now;  //update the current time
	}
}

I think that will do the trick.


Reply
A Marchini
Posts: 426
(@a-marchini)
Reputable Member
Joined: 19 years ago

I feel your pain there. I have no trouble with the programming but I am not aware of the functions specific to the "on/off" stuff.
I imagine the class can be viewed while programming, but I don't have a lot of C# experience myself. Of course the devil is always in the details.

If you want to do anything specifically useful with the script you will need to learn some of the language.

I think the first thing to do at this point, it to take some of the examples we have and plop them in the wiki. So at least they are in one place.

Out of curiosity, can't you just string the standard sequences using the Programs option??

Tony M.


Reply
A Marchini
Posts: 426
(@a-marchini)
Reputable Member
Joined: 19 years ago
Mudsculpter wrote:Have you seen this?

some sample code

Ah, and as I read and breath, the outline of the class in charge of the lights...
Thanks for listing this for us..

Tony M.


Reply
Posts: 209
Topic starter
(@marx1)
Reputable Member
Joined: 18 years ago

YOU ARE MY SAVIOR!

That worked perfectly! Thanks


Reply
Posts: 23
(@gmijackso)
Eminent Member
Joined: 18 years ago

I've apparently overlooked the background sequence until tonight when I finished setting up my display. I had assumed (apparently wrongly) that I could just make a vixen sequence, and designate it as the background sequence and then tell vixen to use the background sequence until a show was scheduled. Apparently I was wrong?

Is there a simple way to use a vixen sequence as your background sequence and still play random songs from the music player? Or, does it have to be scripted like above?

Here's how it worked in my head. I had planned on making a sequence called background.vix that played when I wasn't running a show. While the background sequence was playing, the music player would play random songs from the playlist. Once a show was to start, Vixen would stop the background sequence and music, and start the scheduled program. Once the program was over, vixen would then restart the background sequence. The beauty of this was that I could easily/daily change the background.vix sequence and the "static" display is different. Is there a way to do this?

I know I can create and schedule my background sequence as if it were a show, but I wouldn't be able to randomize the music in the playlist to play then right?
Any ideas/suggestions would be great, otherwise I'll be looking into this whole script thing when I get home from work tomorrow I guess...
Thanks! Running 2.0.5 btw.


Reply
Share: