Creating Effects with the Random command

CueScript offers a Random command which can generate a random number between two given values. This command can be used virtually anywhere, but one great use of it is to create simple Effects.

We'll go grough a few exaples in this article, but we encourage you to come up with your own, more complex, effects!

We'll be using macros and a 36 channel LED light-bar as our demonstation fixture in this article, you may need to modify the code to match your fixture.

You can find out more about the Random command in the users manual, here.


Color Pop

To create a simple "Color Pop" effect (see above), we'll use a macro to randomly select a channel and raise it's value to 100%, then drop that valaue back down.

We'll use the Time command to add a slight fade to this effect. Additionally, we raise the channel up, then wait 0.25 seconds (using the Wait command), then drop it back down. After another 0.25 seconds we call macro #2 to loop back on the macro.

The result of this effect will be a random color (other than red in this case) that will raise and lower every half-second. We do our channel "Color Pop" in playback 2 so that we don't have to remember the previous value (active in playback 1), we simply overlay the random color and then remove it.

Here's the code we'll use in our macro:

"playback" = 1
"fade" = 0.15
"range_a" = 1
"range_b" = 36
"random_ch" = (randomrange_b)
playback ('playback' + 1)
time 'fade'
ch 'random_ch' at #255
w0.25
ch 'random_ch' at 0
w0.25
m2

Twinkle

To create a "twinkle" effect (see above), we'll use a similar macro to the "Color Pop" effect to randomly select an rgb fixture and raise it's red, green, and blue values to 100%, then drop those valaue back down.

Again, We'll use the Time command to add a slight fade to this effect. We raise the channels up, then wait 0.25 seconds (using the Wait command), then drop it back down. After another 0.25 seconds we call macro #3 to loop back on the macro.

The result of this effect will be a random fixture that will "twinkle" to white every half-second.

Because we are dealing with color here (white), we need to know what channels map to fixtures. To do this, we create variables for each "fixture" or LED on our light-bar. Each variable points to the starting channel of the Fixture/LED.

Once we have our fixture, we'll use the random command to choose a random fixture/LED and then raise/lower it. We do this in playback 2 so that we don't have to remember the previous value, we simply overlay the white color and then remove it.

Here's the code we'll use in our macro:

"playback" = 1
"fade" = 0.15
"led1" = 1
"led2" = 4
"led3" = 7
"led4" = 10
"led5" = 13
"led6" = 16
"led7" = 19
"led8" = 22
"led9" = 25
"led10" = 28
"led11" = 31
"led12" = 34
"random_led" = (random12)
"random_led" = `led${random_led}`

pl ('playback' + 1)
t'fade'
ch 'random_led' > ('random_led' + 2) at 100
w0.25
ch 'random_led' > ('random_led' + 2) at 0
w0.25
m3

Flicker

To create a "flicker" effect (see above), we'll create a macro that is the inverse of the "Twinkle" effect. We'll use override mode on our higher playback to suppress the values below.

We use the random command to select a fixture, then drop those channels to zero in the higher playback. Because this playback is in override mode, the zeros will suppress the values below. After 0.25 seconds we release the channels on our higher playback to allow the values below to pass through. Next, we call macro #4 to loop back on the macro.

The result of this effect will be a random fixture that will "flicker" like a candle every half-second.

Here's the code we'll use in our macro:

set Playback.Mode "Override"
"playback" = 1
"fade" = 0.15
"led1" = 1
"led2" = 4
"led3" = 7
"led4" = 10
"led5" = 13
"led6" = 16
"led7" = 19
"led8" = 22
"led9" = 25
"led10" = 28
"led11" = 31
"led12" = 34
"random_led" = (random12)
"random_led" = `led${random_led}`

pl ('playback' + 1)
t'fade'
ch 'random_led' > ('random_led' + 2) at 0
w0.25
ch * release
w0.25
m4

Some Notes

We used the Random command to select random fixtures and create effects on them, but you can use the random command for virtually anything.

For instance, you could select a random color ( c1>3 at {random{0,100},random{0,100},random{0,100}} ), randomize fade times ( time random{0,5} ), choose a random cue ( cue random{1,10} go ) or even select a random-random effect ( macro random{2,4} ).

We'd love to hear how you make use of random, tell us about it!

Have a Tip or Trick you would like to see? Let us know!

We hope you enjoyed this Tip & Trick, and as always, if you ever have any suggestions or ideas that you would like to see
featured, shoot us an email at support@interactive-online.com and let us know!