Examples (Main Output Macro)

   Print  Previous  Next

GetFadeType

Select a different fade type while running this Main Output Macro and monitor the Script Output to see the result.

@scriptname="get fade type test";

@author="";

@version="";

@description="";

 

void InitEffect()

{}

 

void PreRenderEffect()

{

 switch(GetFadeType())

 {

    case CROSSFADE: WriteText("CrossFade");break;

    case WHITEFADE: WriteText("WhiteFade");break;

    case BLACKFADE: WriteText("BlackFade");break;

    case COLORFADE: WriteText("ColorFade");break;

    case X_WIPE: WriteText("X Wipe");break;

    case Y_WIPE: WriteText("Y Wipe");break;

    case Z_WIPE: WriteText("Z Wipe");break;

    case X_CROSS_WIPE: WriteText("XC Wipe");break;

    case Y_CROSS_WIPE: WriteText("YC Wipe");break;

    case Z_CROSS_WIPE: WriteText("ZC Wipe");break;

    case X_SLIDE: WriteText("X Slide");break;

    case Y_SLIDE: WriteText("Y Slide");break;

    case Z_SLIDE: WriteText("Z Slide");break;

    case X_CROSS_SLIDE: WriteText("XC Slide");break;

    case Y_CROSS_SLIDE: WriteText("YC Slide");break;

    case Z_CROSS_SLIDE: WriteText("ZC Slide");break;

 }

}

 

void PostRenderEffect()

{}

 

 

SetFadeType

Watch the fade area while running the script to see how one of the first four fade types is selected in succession.

@scriptname="set fade type test";

@author="";

@version="";

@description="";

 

int Value=0;

void InitEffect()

{}

 

void PreRenderEffect()

{

 Value%=400;// range 0...200

 switch(Value)

 {

    case 0: SetFadeType(CROSSFADE);break;

    case 25: SetFadeType(WHITEFADE);break;

    case 50: SetFadeType(BLACKFADE);break;

    case 75: SetFadeType(COLORFADE);break;

    case 100: SetFadeType(X_WIPE);break;

    case 125: SetFadeType(Y_WIPE);break;

    case 150: SetFadeType(Z_WIPE);break;

    case 175: SetFadeType(X_CROSS_WIPE);break;

    case 200: SetFadeType(Y_CROSS_WIPE);break;

    case 225: SetFadeType(Z_CROSS_WIPE);break;

    case 250: SetFadeType(X_SLIDE);break;

    case 275: SetFadeType(Y_SLIDE);break;

    case 300: SetFadeType(Z_SLIDE);break;

    case 325: SetFadeType(X_CROSS_SLIDE);break;

    case 350: SetFadeType(Y_CROSS_SLIDE);break;

    case 375: SetFadeType(Z_CROSS_SLIDE);break;

 }

 Value++;

}

 

void PostRenderEffect()

{}

 

 

GetFadeColor

Select a different color for the Color-Fade while running the script and monitor the Script Output to see the result.

@scriptname="get fade color values";

@author="";

@version="";

@description="";

 

color c;

void InitEffect()

{}

 

void PreRenderEffect()

{

 c=GetFadeColor();

 WriteText("Red: "+(string)c.r+", Green: "+(string)c.g+", Blue: "+(string)c.b+",
  White:"+(string)c.w);

}

 

void PostRenderEffect()

{}

 

 

SetFadeColor

Monitor the color window next to the Color-Fade button to see the result as the Red color value is increased repeatedly.

@scriptname="set fade color red value";

@author="";

@version="";

@description="";

 

color c;

void InitEffect()

{}

 

void PreRenderEffect()

{

 c.r++;

 c.r%=256;// range 0...255

 SetFadeColor(c);

}

 

void PostRenderEffect()

{}

 

 

GetFadeTime

Increase or decrease the Fade Time and monitor the Script Output while running the script.

@scriptname="get fade time";

@author="";

@version="";

@description="";

 

float fTime;

void InitEffect()

{}

 

void PreRenderEffect()

{

 fTime=GetFadeTime();

 WriteText("FadeTime: "+(string)fTime);

}

 

void PostRenderEffect()

{}

 

 

SetFadeTime

Watch the Fade Time value while running the script.

@scriptname="set fade time";

@author="";

@version="";

@description="";

 

float fTime=0.0;

void InitEffect()

{}

 

void PreRenderEffect()

{

 fTime+=0.1;

 if(fTime>60.0)

         fTime=0.0;// range 0...60

 SetFadeTime(fTime);

}

 

void PostRenderEffect()

{}

 

 

GetFadeValue

Slide the crossfader from Left to Right or back and monitor the Script Output while running the script.

@scriptname="get fader value Left-Right";

@author="";

@version="";

@description="";

 

int fValue;

void InitEffect()

{}

 

void PreRenderEffect()

{

 fValue=GetFadeValue();

 WriteText((string)fValue);

}

 

void PostRenderEffect()

{}

 

 

SetFadeValue

Watch the crossfader to see the result of the script.

@scriptname="set fader value Left-Right";

@author="";

@version="";

@description="";

 

int Value=0;

void InitEffect()

{}

 

void PreRenderEffect()

{

 Value++;

 Value%=256;// range 0...255

 SetFadeValue(Value);

}

 

void PostRenderEffect()

{}

 

 

GetFreeze

To test this script, use the Freeze button and monitor the Script Output while running the script.

@scriptname="get freeze button test";

@author="";

@version="";

@description="";

 

void InitEffect()

{}

 

void PreRenderEffect()

if(GetFreeze())

  WriteText("Freeze button is pressed");

else

  WriteText("Freeze button is not pressed");

}

 

void PostRenderEffect()

{}

 

 

SetFreeze

Watch the Freeze button to see the effect of the script.

@scriptname="freeze, unfreeze test";

@author="";

@version="";

@description="";

 

int Value=0;

void InitEffect()

{}

 

void PreRenderEffect()

{

 Value++;

 Value%=100;// range 0...100

 switch(Value)

 {

    case 5: SetFreeze(FREEZE);break;

    case 55: SetFreeze(UNFREEZE);break;

 }

}

 

void PostRenderEffect()

{}

 

 

GetMasterFader

Adjust the Master while running the script and monitor the Script Output.

@scriptname="get fader value from master";

@author="";

@version="";

@description="";

 

void InitEffect()

{}

 

void PreRenderEffect()

{

 WriteText("Master: "+(string)GetMasterFader());

}

 

void PostRenderEffect()

{}

 

 

SetMasterFader

Watch the Master closely to see the result of the script.

@scriptname="set master fader value";

@author="";

@version="";

@description="";

 

int Value=0;

void InitEffect()

{}

 

void PreRenderEffect()

{

 Value++;

 Value%=256;// range 0...255

 SetMasterFader(Value);

}

 

void PostRenderEffect()

{}

 

 

GetAudioFader

Adjust the Audio Input Level while running the script and monitor the Script Output.

@scriptname="get fader value from audio";

@author="";

@version="";

@description="";

 

void InitEffect()

{}

 

void PreRenderEffect()

{

 WriteText("AudioFader: "+(string)GetAudioFader());

}

 

void PostRenderEffect()

{}

 

 

SetAudioFader

Monitor the Audio Input Level closely to see the result of the script.

@scriptname="set audio fader";

@author="";

@version="";

@description="";

 

int Value=0;

void InitEffect()

{}

 

void PreRenderEffect()

{

 Value++;

 Value%=256;// range 0...255

 SetAudioFader(Value);

}

 

void PostRenderEffect()

{}

 

 

CuelistStop/CuelistPlay

To test this script, a Cue List with Duration and a minimum of 2 Cues is required.

@scriptname="cue list stop/start test";

@author="";

@version="";

@description="";

 

int Value=0;

void InitEffect()

{}

 

void PreRenderEffect()

{

 Value++;

 Value%=500;// range 0...500

 switch(Value)

 {

    case 10: CuelistStop();break;

    case 260: CuelistPlay();break;

 }

}

 

void PostRenderEffect()

{}

 

 

CuelistGo/CuelistBack

To test this script, a Cue List with Duration and a minimum of 2 Cues is required.

@scriptname="cue list go/back test";

@author="";

@version="";

@description="";

 

int Value=0;

void InitEffect()

{}

 

void PreRenderEffect()

{

 

 Value++;

 Value%=500;// range 0...500

 switch(Value)

 {

    case 10: CuelistGo();break;

    case 260: CuelistBack();break;

 }

}

 

void PostRenderEffect()

{}

 

 

CuelistGoto

To test this script, a Cue List with Duration and a minimum of 9 Cues is required.

@scriptname="cue list goto test";

@author="";

@version="";

@description="";

 

int Value=0;

void InitEffect()

{}

 

void PreRenderEffect()

{

 

 Value++;

 Value%=250;// range 0...250

 if(Value%50==0)

         CuelistGoto(Value/25);    // skip 1,3,5,7,9,1,3,...

         //CuelistGoto(Value/50);        // skip 1,2,3,4,5,6,1,2,...

}

 

void PostRenderEffect()

{}

 

 

To test this script, create a Cue List, activate several Cues, and monitor the Script Output.

@scriptname="CurrentCue";  

@author="inoage / info@madrix.com";  

@version="";  

@description="View current item from Cue List";  

 

void InitEffect() 

{} 

 

void PreRenderEffect() 

{} 

 

void PostRenderEffect() 

     WriteText((string)CuelistCurrentCue()); 

}

 

 

GetStorageSpeedMaster

Adjust the Speed Master Left or Right while running the script and monitor the Script Output.

@scriptname="get Speed Master test";

@author="";

@version="";

@description="";

 

void InitEffect()

{}

 

void PreRenderEffect()

WriteText("SpeedLeft:"+(string)GetStorageSpeedMaster(STORAGE_LEFT)

+" SpeedRight:"+(string)GetStorageSpeedMaster(STORAGE_RIGHT));

}

 

void PostRenderEffect()

{}

 

 

SetStorageSpeedMaster

This is script is best tested with the SCE Color Scroll effect. Monitor Preview Left and Preview Right as well as the Speed Masters to see the results of the script.

@scriptname="Speed Master test";

@author="";

@version="";

@description="";

 

float Value=0.0;

void InitEffect()

{}

 

void PreRenderEffect()

{

 

 Value+=0.1;

 if(Value>10.0)

         Value=-10.0;// range 0...255

 

 SetStorageSpeedMaster(STORAGE_LEFT,Value);        // Storage Left

 SetStorageSpeedMaster(STORAGE_RIGHT,Value/2.0);        // Storage Right

}

 

void PostRenderEffect()

{}

 

 

GetStoragePause

To test this script, press the 'Pause' button of Storage Area Left or Right and monitor the Script Output.

@scriptname="get storage pause test";

@author="";

@version="";

@description="";

 

void InitEffect()

{}

 

void PreRenderEffect()

if(GetStoragePause(STORAGE_LEFT))

  WriteText("Storage Left Paused");

else

  WriteText("Storage Left Running");

if(GetStoragePause(STORAGE_RIGHT))

  WriteText("Storage Right Paused");

else

  WriteText("Storage Right Running");

}

 

void PostRenderEffect()

{}

 

 

SetStoragePause

This is script is best tested with the SCE Color Scroll effect. Monitor the Pause buttons of Storage Left and Storage Right to see the effects of the script.

@scriptname="storage no-/pause test";

@author="";

@version="";

@description="";

 

int Value=0;

void InitEffect()

{}

 

void PreRenderEffect()

{

 

 Value++;

 Value%=200;// range 0...200

 

 switch(Value)

 {

            case 10: SetStoragePause(STORAGE_LEFT,PAUSE);break;// Storage Left

         case 60: SetStoragePause(STORAGE_RIGHT,PAUSE);break;// Storage Right

            case 110: SetStoragePause(STORAGE_LEFT,NOPAUSE);break;// Storage Left

         case 160: SetStoragePause(STORAGE_RIGHT,NOPAUSE);break;// Storage Right

 }

}

void PostRenderEffect()

{}

 

 

GetStoragePlace

While running the script, select different Storage Places across Storage Left or Storage Right and monitor the Script Output. The currently selected Storage Place number minus 1 should be displayed.

@scriptname="get storage place test";

@author="";

@version="";

@description="";

 

void InitEffect()

{}

 

void PreRenderEffect()

  WriteText("Storage Left:"+(string)GetStoragePlace(STORAGE_LEFT)
  +" Storage Right:"+(string)GetStoragePlace(STORAGE_RIGHT));

}

 

void PostRenderEffect()

{}

 

 

SetStoragePlace

Monitor the Effect Areas Left and Right as well as the two Storage Areas (Left and Right) to see the results of the script.

@scriptname="test setStoragePlace with and without autofade";

@author="";

@version="";

@description="";

 

int Value=0;

int place=0;

void InitEffect()

{

 SetFadeTime(1.0);// better for demonstration

}

 

void PreRenderEffect()

{

 Value++;

 Value%=1000;// range 0...1000

 switch(Value)

 {

 case 150: SetStoragePlace(STORAGE_LEFT,place,WITH_AUTOFADE);break;
         // Storage Left with Autofade

 case 300: SetStoragePlace(STORAGE_RIGHT,place,WITH_AUTOFADE);break;
         // Storage Right with Autofade

 case 450: place++;

         case 600: SetStoragePlace(STORAGE_LEFT,place,WITHOUT_AUTOFADE);break;
 // Storage Left without Autofade, if FaderValue not a place on Storage Left

 case 750: SetStoragePlace(STORAGE_RIGHT,place,WITHOUT_AUTOFADE);break;
 // Storage Right without autofade, if FaderValue not a place on Storage Right

 case 900: place++;

 }  

 if(place>59)   // place range 0...59

         place=0;

}

 

void PostRenderEffect()

{}

 

 

GetStorageSubMaster

Adjust the Submasters of Storage Left and Storage Right (SUB) and monitor the Script Output while running the script.

@scriptname="storage submaster get test";

@author="";

@version="";

@description="";

 

int subLeft;

int subRight;

void InitEffect()

{}

 

void PreRenderEffect()

{

 subLeft=GetStorageSubMaster(STORAGE_LEFT);// Storage Left

 subRight=GetStorageSubMaster(STORAGE_RIGHT);// Storage Right

 WriteText("Submaster Left:" +(string)subLeft +", Submaster Right:" +(string)subRight);           

}

 

void PostRenderEffect()

{}

 

 

SetStorageSubMaster

Select an SCE Effect in both Effect Areas and monitor the two previews (Preview Left and Preview Right) while running the script.

@scriptname="storage submaster set test";

@author="";

@version="";

@description="";

 

int Value=0;

void InitEffect()

{}

 

void PreRenderEffect()

{

 

 Value++;

 Value%=256;// range 0...255

 

 SetStorageSubMaster(STORAGE_LEFT,Value);// Storage Left

 SetStorageSubMaster(STORAGE_RIGHT,255-Value);// Storage Right

 WriteText("SubLeft: "+(string)Value+", SubRight: "+(string)(255-Value));

}

 

void PostRenderEffect()

{}

 

 

Cue List - Various 1

This Macro creates a new Cue List and adds 8 new Cues. All 8 Cues will be given different settings that are increased each time. Make sure to open the Cue List before or after running this Script to see the result.

@scriptname="creating a cue list";

@author="inoage";

@version="MADRIX 3.3";

@description="";

 

void InitEffect()

{

    color fadecolor;

    CuelistNew(8);        //create a new Cue List and add 8 Cues

 

    for(int i=0;i<8;i++)        // change the following settings for each Cue

    {

        CueSetDescription(i, "Color"+ (string)(i+1));

        CueSetTimeCode(i, i+1,i+2,i+3,i+4);

        CueSetDuration(i, i+5,i+6,i+7,i+8);

        CueSetDateWeekday(i, i+1);

        CueSetFollow(i, (i+2)%9);

        CueSetStorage(i, (i%2));

        CueSetPlace(i, (i%4));

        CueSetFadeType(i, i);

        CueSetFadeTime(i, (float)i*10.0+10.0);

        fadecolor.r =i*10;

        fadecolor.r =i*15;

        fadecolor.r =i*20;

        CueSetFadeColor(i, fadecolor);

    }

}

 

void PreRenderEffect()

{

 

}

 

void PostRenderEffect()

{

 

}

 

void MatrixSizeChanged()

{

    InitEffect();

}

 

 

CueGetFadeColor

Make sure to create or load a Cue List first. This Main Output Macro analyzes the current Cue List and shows the currently set up Fade Color of each Cue in the Script Output.

@scriptname="analyze fade color of cues";

@author="inoage";

@version="MADRIX 3.3";

@description="";

 

void InitEffect()

{

   const int count = CuelistCount();

    if(count>0)

        WriteText("Cue List View");

    else

        WriteText("Cue List is empty!");

 

    for(int i=0;i<count;i++)

    {

        color c = CueGetFadeColor(i);        //retrieve the Fade Color for every Cue in the Cue List

        WriteText(  (string)i                       + " | " + // number

                    "R:"+(string)c.r                + " | " +

                    "G:"+(string)c.g                + " | " +

                    "B:"+(string)c.b                + " | " +

                    "W:"+(string)c.w                + " | " );

 

    }

}

 

void PreRenderEffect()

{

 

}

 

void PostRenderEffect()

{

 

}

 

void MatrixSizeChanged()

{

    InitEffect();

}

 

 

Cue List - Various 2

Make sure to create or load a Cue List first. This Main Output Macro analyzes the current Cue List and shows all Cues and their settings in the Script Output.

@scriptname="simple cue list view 1";

@author="inoage";

@version="MADRIX 3.3";

@description="";

 

void InitEffect()

{

    string sCueCurr;

    const int count = CuelistCount();

    const int CueCurrent = CuelistCurrentCue();

    if(count>0)

        WriteText("Cue List View");

    else

        WriteText("Cue List is empty!");

 

    for(int i=0;i<count;i++)        //analyze all Cues

    {

        if(CueCurrent==i)

            sCueCurr = ">";

        else

            sCueCurr = " ";

 

        color c = CueGetFadeColor(i);

        WriteText(  sCueCurr                        + "  "  + // select current cue

                    (string)i                       + " | " + // number

                    CueGetDescription(i)            + " | " + // cue description

                    CueGetDateString(i)             + " | " + // get ready date string

                    CueGetTimeCodeString(i)         + " | " + // get ready time code string

                    CueGetDurationString(i)         + " | " + // get ready duration string

                    (string)CueGetStorage(i)        + " | " +

                    (string)CueGetPlace(i)          + " | " +

                    (string)CueGetFadeType(i)       + " | " +

                    (string)CueGetFadeTime(i)       +"s | " +

                    "R:"+(string)c.r                + " | " +

                    "G:"+(string)c.g                + " | " +

                    "B:"+(string)c.b                + " | " +

                    "W:"+(string)c.w);        

    }

 

}

 

void PreRenderEffect()

{

}

 

void PostRenderEffect()

{

}

 

void MatrixSizeChanged()

{

    InitEffect();

}

 

 

Cue List - Various 3

Make sure to create or load a Cue List first. This Main Output Macro analyzes the current Cue List and shows all Cues and their settings in the Script Output.

@scriptname="simple cue list view 2";

@author="inoage";

@version="MADRIX 3.3";

@description="";

 

void InitEffect()

{

    string sCueCurr;

    const int count = CuelistCount();

    const int CueCurrent = CuelistCurrentCue();

    if(count>0)

        WriteText("Cuelist View");

    else

        WriteText("Cuelist is empty");

 

    for(int i=0;i<count;i++)        //analyze all Cues

    {

        if(CueCurrent==i)

            sCueCurr = ">";

        else

            sCueCurr = " ";

 

        string sTimecode ="--:--:--:--";

        if(CueGetTimeCodeHour(i)>=0)

            sTimecode = (string)CueGetTimeCodeHour(i)  + ":" + 

                        (string)CueGetTimeCodeMinute(i)+ ":" + 

                        (string)CueGetTimeCodeSecond(i)+ ":" + 

                        (string)CueGetTimeCodeFrame(i);

 

        string sDuration ="--:--:--:--";

        if(CueGetDurationHour(i)>=0)

            sDuration = (string)CueGetDurationHour(i)  + ":" + 

                        (string)CueGetDurationMinute(i)+ ":" + 

                        (string)CueGetDurationSecond(i)+ ":" + 

                        (string)CueGetDurationFrame(i);

 

        string sDate ="--/--/--";

 

        switch(CueGetDateWeekday(i))

        {

         default:sDate =   (string)CueGetDateYear(i)  + "/" +

                           (string)CueGetDateMonth(i) + "/" +

                           (string)CueGetDateDay(i);

                             break;

         case 8: sDate="daily"; break;

         case 7: sDate="Sun";   break;

         case 6: sDate="Sat";   break;

         case 5: sDate="Fri";   break;

         case 4: sDate="Thu";   break;

         case 3: sDate="Wed";   break;

         case 2: sDate="Tue";   break;

         case 1: sDate="Mon";   break;

         case 0: sDate="ERROR"; break;

        }

 

        color c = CueGetFadeColor(i);

        WriteText(  sCueCurr                        + "  "  + // select current cue

                    (string)i                       + " | " + // number

                    CueGetDescription(i)            + " | " + // cue description

                    sDate                           + " | " + // date string

                    sTimecode                       + " | " + // time code string

                    sDuration                       + " | " + // duration string

                    (string)CueGetStorage(i)        + " | " +

                    (string)CueGetPlace(i)          + " | " +

                    (string)CueGetFadeType(i)       + " | " +

                    (string)CueGetFadeTime(i)       +"s | " +

                    "R:"+(string)c.r                + " | " +

                    "G:"+(string)c.g                + " | " +

                    "B:"+(string)c.b                + " | " +

                    "W:"+(string)c.w);      

    }

 

}

 

void PreRenderEffect()

{

}

 

void PostRenderEffect()

{

}

 

void MatrixSizeChanged()

{

    InitEffect();

}

 

 

Fixture Groups - Various 1

Set up different Fixture Groups first. This Main Output Macro analyzes specific Fixture Group information and shows their settings in the Script Output.

@scriptname="";

@author="inoage";

@version="3.4";

@description="get fixture groups' data";

 

int GroupValue;

int GroupId;

string GroupName;

 

void InitEffect()

{

    if(GetGroupCount()<1)

        WriteText("No groups have been set up!");

 

}

 

void PreRenderEffect()

{

    const int GroupCount = GetGroupCount();

    for(int i=0; i<GroupCount; i++)

    {

        GroupId = GetGroupIdByIndex(i);

        GroupName = GetGroupDisplayName(i);

        GroupValue = GetGroupValue(i);

        WriteText("Group: " + (string)(i)+ ", ID: " + (string)GroupId+ ", Name: " + (string)GroupName+ ", Value: " + (string)GroupValue);

    }

}

 

void PostRenderEffect()

{

 

}

 

void MatrixSizeChanged()

{

    InitEffect();

}
 

 

SetGroupValue

Set up different Fixture Groups first. This Main Output Macro steadily increases the values for your Fixture Groups in the Group Control and starts from the beginning again when the maximum value is reached.

@scriptname="";

@author="";

@version="";

@description="set groups value";

 

int FrameCount;

int Value;

 

void InitEffect()

{

    if(GetGroupCount()<1)

        WriteText("No groups have been set up!");

    FrameCount=0;

}

 

void PreRenderEffect()

{

    const int GroupCount = GetGroupCount();

    for(int i=0; i<GroupCount; i++)

    {

        Value = FrameCount/(i+1);

        SetGroupValue(i, Value);

    }

 

    FrameCount++;

    FrameCount= FrameCount%256;

}

 

void PostRenderEffect()

{

 

}

 

void MatrixSizeChanged()

{

    InitEffect();

}
 

MADRIX Version: 3.6j | Script Version: 2.22
[Ctrl & +/-] = Zoom In/Out | [Ctrl & 0] = 100%
Print   Previous   Next