Examples (Global Macro)

  Previous  Next

GetFadeType

Select a different fade type while running this Global 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 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()
{}
 
 
 

 

»Description

 

SetFadeType

Watch the fade area while running the script to see how the fade types are selected in succession.

@scriptname="set fade type test";
@author="";
@version="";
@description="";
 
int Value=0;
void InitEffect()
{}
 
void PreRenderEffect()
{
 Value%=400;// range 0...399
 switch(Value)
 {
    case 0: SetFadeType(CROSSFADE);break;
    case 25: SetFadeType(WHITEFADE);break;
    case 50: SetFadeType(BLACKFADE);break;
    case 75: SetFadeType(X_WIPE);break;
    case 100: SetFadeType(Y_WIPE);break;
    case 125: SetFadeType(Z_WIPE);break;
    case 150: SetFadeType(X_CROSS_WIPE);break;
    case 175: SetFadeType(Y_CROSS_WIPE);break;
    case 200: SetFadeType(Z_CROSS_WIPE);break;
    case 225: SetFadeType(X_SLIDE);break;
    case 250: SetFadeType(Y_SLIDE);break;
    case 275: SetFadeType(Z_SLIDE);break;
    case 300: SetFadeType(X_CROSS_SLIDE);break;
    case 325: SetFadeType(Y_CROSS_SLIDE);break;
    case 350: SetFadeType(Z_CROSS_SLIDE);break;
 }
 Value++;
}
 
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...99
 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()
{}
 
 
 

 

GetAudioInputFader

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

@scriptname="get fader value from audio input";
@author="";
@version="";
@description="";
 
void InitEffect()
{}
 
void PreRenderEffect()
{
 WriteText("Audio Input Fader: "+(string)GetAudioInputFader());
}
 
void PostRenderEffect()
{}
 
 
 

 

SetAudioInputFader

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

@scriptname="set fader value of audio input";
@author="";
@version="";
@description="";
 
int Value=0;
void InitEffect()
{}
 
void PreRenderEffect()
{
 Value++;
 Value%=256;// range 0...255
 SetAudioInputFader(Value);
}
 
void PostRenderEffect()
{}
 
 
 

 

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(LEFT)
+" SpeedRight:"+(string)GetStorageSpeedMaster(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 -10.0...10.0
 
 SetStorageSpeedMaster(LEFT,Value);        // Deck A
 SetStorageSpeedMaster(RIGHT,Value/2.0);        // Deck B
}
 
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(LEFT))
  WriteText("Deck A Paused");
else
  WriteText("Deck A Running");
if(GetStoragePause(RIGHT))
  WriteText("Deck B Paused");
else
  WriteText("Deck B Running");
}
 
void PostRenderEffect()
{}
 
 
 

 

 

SetStoragePause

This is script is best tested with the SCE Color Scroll effect. Monitor the Pause buttons of Deck A and Deck B 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...199
 
 switch(Value)
 {
         case 10: SetStoragePause(LEFT,PAUSE);break;// Deck A
         case 60: SetStoragePause(RIGHT,PAUSE);break;// Deck B
         case 110: SetStoragePause(LEFT,NOPAUSE);break;// Deck A
         case 160: SetStoragePause(RIGHT,NOPAUSE);break;// Deck B
 }
}
void PostRenderEffect()
{}
 
 
 

 

GetStoragePlace

While running the script, select different Storage Places across Deck A or Deck B 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("Deck A:"+(string)GetStoragePlace(LEFT)
 +" Deck B:"+(string)GetStoragePlace(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...999
 switch(Value)
 {
 case 150: SetStoragePlace(LEFT,place,WITH_AUTOFADE);break;
         // Deck A with Autofade
 case 300: SetStoragePlace(RIGHT,place,WITH_AUTOFADE);break;
         // Deck B with Autofade
 case 450: place++;
         case 600: SetStoragePlace(LEFT,place,WITHOUT_AUTOFADE);break;
 // Deck A without Autofade; if FaderValue not a place on Deck A
 case 750: SetStoragePlace(RIGHT,place,WITHOUT_AUTOFADE);break;
 // Deck B without autofade; if FaderValue not a place on Deck B
 case 900: place++;
 }  
 if(place>255)   // place range 0...255
         place=0;
}
 
void PostRenderEffect()
{}
 
 
 

 

GetStorageSubMaster

Adjust the Submasters of Deck A and Deck B (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(LEFT);// Deck A
 subRight=GetStorageSubMaster(RIGHT);// Deck B
 WriteText("Submaster Deck A:" +(string)subLeft +", Submaster Deck B:" +(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(LEFT,Value);// Deck A
 SetStorageSubMaster(RIGHT,255-Value);// Deck B
 WriteText("SubLeft: "+(string)Value+", SubRight: "+(string)(255-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...499
 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...499
 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...249
 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());
}
 
 
 

 

 

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()
{
 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);
 }
}
 
void PreRenderEffect()
{
 
}
 
void PostRenderEffect()
{
 
}
 
void MatrixSizeChanged()
{
 InitEffect();
}
 
 
 

 

Cue List - Various 2

Make sure to create or load a Cue List first. This Global 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 = " ";
 
         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");        
    }
 
}
 
void PreRenderEffect()
{
}
 
void PostRenderEffect()
{
}
 
void MatrixSizeChanged()
{
    InitEffect();
}
 
 
 

 

Cue List - Various 3

Make sure to create or load a Cue List first. This Global 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;
         }
 
         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");
 }
 
}
 
void PreRenderEffect()
{
}
 
void PostRenderEffect()
{
}
 
void MatrixSizeChanged()
{
 InitEffect();
}
 
 
 

 

Fixture Groups - Various

Set up different Fixture Groups first. This Global 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 Global 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: 5.6 | Script Version: 3.18
[Ctrl & +/-] = Zoom In/Out | [Ctrl & 0] = 100%
 Previous   Next

 


Enable automatic translation | Activer la traduction automatique |