This is almost everything I have.

This is a place for people to share the custom macros they have written.
User avatar
kimwida
Posts: 268
Joined: 05 Aug 2016, 16:26
Location: Seoul

This is almost everything I have.

Postby kimwida » 21 Oct 2026, 03:24

https://youtu.be/CwehpuVSa4k?si=DziHn4xFEPS5P96m

This is macro generator codes.
I couldn't say it suit all of the fixtures but it works for me and I've been using it for 6~7 years without any problem.
If you change some variables in "variable.lua", you can use it with your fixtures.
You need to run these codes with Lua to generate macros.

===================================================================== fie name : variable.lua =============================================================
FixtureName = {"36x10_Zoom","LED_Light_Bar","Focus Spot 7z","HD_Beam"} --,"LED_48_Bar"}
-- Suppoted color type is "Wheel", "RGB", "RGBW" and "CMY"
-- 36x10_Zoom is RGBW, LED_Light_Bar is RGB, Focus Spot 7z is CMY, HD_Beam is Wheel
FixtureType = {"Wheel","RGBW","RGBW","Wheel"}--,"RGB"}
FixturePage = 1
-- The first slot's position of each patched fixtures
FixtureSlot = {1,9,17,25}--,33}
FixtureCount = {8,8,8,8}
-- Palette page
PalettePage = 1
-- Starting slot's position which a palette is recorded
PaletteSlot = {2,18,34,50}--,66}
-- Starting Palette User Number
PaletteUserNum = 100
-- Max number of patched fixture's palette color
maxColor = {14,15,14,14}--,14}

--Color Wheel
ColorWheel = {1,2,3,4,5,6,7,8,9,10,11,12,13,14}

-- CMY Color Red, Orange, DYellow, Yellow, Green, LGreen, Cyan, PBlue, Blue, DBlue, DPurple, Purple, Pink, White, Black
cmyColorCyan ={ 0, 0, 0, 0, 1, 0.75, 1, 1, 1, 0.8, 0.6, 0, 0, 0, 1}
cmyColorMagenta ={ 1, 0.7, 0.4, 0, 0, 0, 0, 0.4, 1, 1, 1, 1, 1, 0, 1}
cmyColorYellow ={ 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0.2, 0.7, 0, 1}
cmyColorCTO ={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
cmyColorWhite ={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

--RGBW Color ={"Red","Orange","DYellow","Yellow","Green","PGreen","Cyan","PBlue","Blue","DBlue","DPurple","Purple","Pink","White","Black"}
ColorRed ={ 1, 1, 1, 1, 0, 0, 0, 0.3, 0, 0.2, 0.5, 1, 1, 1, 0}
ColorGreen ={ 0, 0.25, 0.55, 1, 1, 1, 1, 0.7, 0, 0, 0, 0, 0, 1, 0}
ColorBlue ={ 0, 0, 0, 0, 0, 0.36, 1, 1, 1, 1, 1, 1, 0.7, 1, 0}
ColorWhite ={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}

GroupType = { "LeftToRight", "RightToLeft", "EndsInLinear", "VerticalBlinds", "Random", "Random" }
GroupLegend={ ">>>>", "<<<<", ">><<", "<<>>", "Rnd1", "Rnd2" }
GroupSlot = 1
GroupSlotGap = #GroupType

--For macro map
nameMacro = {"HighColor", "LowColor","MidColor"} --
RefPaletteWindow = "Beams" -- 레퍼런스 Palette(Main, Sub 파렛)이 위치한 윈도우
RefPalettePage = 1 -- 레퍼런스 Palette들이 위치한 페이지 빼기 1 왜냐하면 Main, Sub ... 등등에서 페이지를 올려야해서
RefPaletteSlot = {8,9,10,11} -- 레퍼런스 Palette의 슬롯 위치
RefGapSlot = 6 -- Main palette slot 과 Sub palette slot과의 갭차이
=======================================================================================================================================================


============================================================ file name : 1_Make_Palettes.lua ==============================================================
==================================================================Generate Palettes=====================================================================
require "variable"

trim = " <step pause=\"0.1\">"
local userprofile = os.getenv("USERPROFILE")
filename = userprofile .. "\\Documents\\Titan\\Macros\\"
filename = filename.."Make_Palettes.xml"
src = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
src = src.."<avolites.macros>\n"
src = src.."<macro id=\"Make_Palettes_For_MacroMap\">\n"
src = src.."<name>Make Palettes</name>\n"
src = src.." <sequence>\n"

for j=1, #FixtureType, 1 do
src = src ..trim.."ActionScript.SetProperty.Enum(\"Palette.MinimumPaletteMode\", \"Shared\")</step>\n"
src = src ..trim.."ActionScript.SetProperty.Enum(\"Palette.RecordMode\", \"Channel\")</step>\n\n"
src = src ..trim.."Handles.Colours.ChangePage(0)</step>\n"

if (FixtureType[j] == "RGBW") then
for i=1, maxColor[j], 1 do
PaletteUserNum = PaletteUserNum + 1
src = src..trim.."Selection.Context.Programmer.SelectFixture(handle:\"Location=Fixtures,"..FixturePage..","..FixtureSlot[j].."\")</step>\n"
src = src..trim.."Programmer.Editor.Fixtures.SetControlValueById(240,1,"..ColorRed[i]..",true,true)</step>\n"
src = src..trim.."Programmer.Editor.Fixtures.SetControlValueById(256,1,"..ColorGreen[i]..",true,true)</step>\n"
src = src..trim.."Programmer.Editor.Fixtures.SetControlValueById(272,1,"..ColorBlue[i]..",true,true)</step>\n"
src = src..trim.."Programmer.Editor.Fixtures.SetControlValueById(274,1,"..ColorWhite[i]..",true,true)</step>\n"
src = src..trim.."ActionScript.SetProperty(\"Palette.CurrentPaletteNumber\",userNumber:" .. PaletteUserNum .. ")</step>\n"
src = src..trim.."Palette.StoreMenu.StoreOnButton(\"Colours\", "..tostring(PaletteSlot[j]-1)..")</step>\n"
src = src..trim.."Programmer.Editor.ClearAll(false, false)</step>\n\n"
PaletteSlot[j] = PaletteSlot[j] + 1
end
elseif (FixtureType[j] == "Wheel") then
for i=1, maxColor[j], 1 do
PaletteUserNum = PaletteUserNum + 1
src = src..trim.."Selection.Context.Programmer.SelectFixture(handle:\"Location=Fixtures,"..FixturePage..","..FixtureSlot[j].."\")</step>\n"
src = src..trim.."Programmer.Editor.Fixtures.SetControlValueById(112," .. ColorWheel[i] .. ", 100,true,true)</step>\n"
src = src..trim.."ActionScript.SetProperty(\"Palette.CurrentPaletteNumber\",userNumber:"..PaletteUserNum..")</step>\n"
src = src..trim.."Palette.StoreMenu.StoreOnButton(\"Colours\", "..tostring(PaletteSlot[j]-1)..")</step>\n"
src = src..trim.."Programmer.Editor.ClearAll(false, false)</step>\n\n"
PaletteSlot[j] = PaletteSlot[j] + 1
end
elseif (FixtureType[j] == "RGB") then
for i=1, maxColor[j], 1 do
PaletteUserNum = PaletteUserNum + 1
src = src..trim.."Selection.Context.Programmer.SelectFixture(handle:\"Location=Fixtures,"..FixturePage..","..FixtureSlot[j].."\")</step>\n"
src = src..trim.."Programmer.Editor.Fixtures.SetControlValueById(240,1,"..ColorRed[i]..",true,true)</step>\n"
src = src..trim.."Programmer.Editor.Fixtures.SetControlValueById(256,1,"..ColorGreen[i]..",true,true)</step>\n"
src = src..trim.."Programmer.Editor.Fixtures.SetControlValueById(272,1,"..ColorBlue[i]..",true,true)</step>\n"
src = src..trim.."ActionScript.SetProperty(\"Palette.CurrentPaletteNumber\",userNumber:" .. PaletteUserNum .. ")</step>\n"
src = src..trim.."Palette.StoreMenu.StoreOnButton(\"Colours\", "..tostring(PaletteSlot[j]-1)..")</step>\n"
src = src..trim.."Programmer.Editor.ClearAll(false, false)</step>\n\n"
PaletteSlot[j] = PaletteSlot[j] + 1
end
elseif (FixtureType[j] == "CMY") then
for i=1, maxColor[j], 1 do
PaletteUserNum = PaletteUserNum + 1
src = src..trim.."Selection.Context.Programmer.SelectFixture(handle:\"Location=Fixtures,"..FixturePage..","..FixtureSlot[j].."\")</step>\n"
src = src..trim.."Programmer.Editor.Fixtures.SetControlValueById(64,1,"..cmyColorCyan[i]..",true,true)</step>\n"
src = src..trim.."Programmer.Editor.Fixtures.SetControlValueById(80,1,"..cmyColorMagenta[i]..",true,true)</step>\n"
src = src..trim.."Programmer.Editor.Fixtures.SetControlValueById(96,1,"..cmyColorYellow[i]..",true,true)</step>\n"
src = src..trim.."Programmer.Editor.Fixtures.SetControlValueById(274,1,"..cmyColorCTO[i]..",true,true)</step>\n"
src = src..trim.."Programmer.Editor.Fixtures.SetControlValueById(277,1,"..cmyColorWhite[i]..",true,true)</step>\n"
src = src..trim.."ActionScript.SetProperty(\"Palette.CurrentPaletteNumber\",userNumber:" .. PaletteUserNum .. ")</step>\n"
src = src..trim.."Palette.StoreMenu.StoreOnButton(\"Colours\", "..tostring(PaletteSlot[j]-1)..")</step>\n"
src = src..trim.."Programmer.Editor.ClearAll(false, false)</step>\n\n"
PaletteSlot[j] = PaletteSlot[j] + 1
end
end
end

src = src.." </sequence>\n"
src = src.."</macro>\n"
src = src.."</avolites.macros>\n"

local file = io.open(filename, "w")
io.output(file)
io.write(src)
io.close(file)
=======================================================================================================================================================

============================================================ file name : 2_Make_Groups.lua ==============================================================
==================================================================Generate Groups=====================================================================
require "variable"

trim = " <step pause=\"0.01\">"
trim2 = " <step>"

local userprofile = os.getenv("USERPROFILE")
filename = userprofile .. "\\Documents\\Titan\\Macros\\"
filename = filename.."Make_Groups.xml"

src = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
src = src.."<avolites.macros>\n"
src = src.."<macro id=\"Make_Groups\">\n"
src = src.."<name>Make Groups</name>\n"
src = src.." <sequence>\n"

for i=1, #FixtureName do
for k=1, #GroupType do
--각 조명기 종류별로 기본 Group 하나 만들기
src = src..trim.."Selection.Context.Programmer.SelectFixtures(\"Fixtures\", {"
startFixture = FixtureSlot[i]-1
endFixture = FixtureSlot[i] + FixtureCount[i]-2
for j=startFixture, endFixture-1 do
src = src..j..","
end
src = src..tostring(endFixture).."})</step>\n\n"

if (GroupType[k] == "Random") then
src = src..trim.."UserMacros.RecallMacroById(\"Avolites.Macros.PatternSelection.Odd\")</step>\n"
src = src..trim.."UserMacros.RecallMacroById(\"Avolites.Macros.PatternSelection.RandomOrder\")</step>\n"
src = src..trim.."Group.StoreMenu.StoreOnButton(\"Groups\","..tostring(GroupSlotGap*(i-1)+GroupSlot+k-2)..","..tostring(i*400 + k) ..")</step>\n"
else
src = src..trim.."Group.StoreMenu.StoreOnButton(\"Groups\","..tostring(GroupSlotGap*(i-1)+GroupSlot+k-2)..","..tostring(i*400 + k) ..")</step>\n"
src = src..trim.."ActionScript.SetProperty.Enum(\"Selection.Context.Global.Direction\",\""..GroupType[k].."\")</step>\n"
src = src..trim.."Group.Editor.UpdateFixtureLocationsFromProgrammer(handle:\"Location=Groups,1,"..tostring(GroupSlotGap*(i-1)+k).."\")</step>\n"
end

src = src..trim.."Handles.SetSourceHandleFromHandle(Handles.GetHandle(\"Groups\",0," .. tostring(GroupSlotGap*(i-1)+k-1) .. ")) </step>\n"
src = src..trim.."ActionScript.SetProperty(\"Handles.PendingLegend\",\"" .. FixtureName[i] .. " " .. GroupLegend[k] .. "\")</step>\n"
src = src..trim.."Handles.SetLegend()</step>\n"
src = src..trim.."Handles.ClearSelection()</step>\n"
src = src..trim.."Programmer.Editor.ClearAll(false, false)</step>\n\n"
end
end

src = src.." </sequence>\n"
src = src.."</macro>\n"
src = src.."</avolites.macros>\n"

local file = io.open(filename, "w")
io.output(file)
io.write(src)
io.close(file)

=======================================================================================================================================================

============================================================ file name : 3_Make_MacroMap.lua ==============================================================
==================================================================Generate Macros for=====================================================================
require "variable"

Halo = {}
for i=1, #nameMacro do
Halo[i] = {}
for j=1, #FixtureName do
Halo[i][j] = {}
Halo[i][j].page = 1
Halo[i][j].slot = 1
end
end

trim = " <step pause=\"0.01\">"
trim2 = " <step>"
for j=1, #nameMacro do
for i=1, #FixtureName do
maxPaletteSlot = PaletteSlot[i] + maxColor[i] - 1

for slot = PaletteSlot[i], maxPaletteSlot do -- main up color macro
local userprofile = os.getenv("USERPROFILE")
filename = userprofile .. "\\Documents\\Titan\\Macros\\"
filename = filename..FixtureName[i].."_"..nameMacro[j].."_"..slot..".xml"
src = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
src = src.."<avolites.macros>\n"
src = src.."<!-- Automatically exported from With MA2 - Titan Mobile 10.1.96.5 (DESKTOP-7QPH7DR) on 2018-05-05 오후 4:24:48. -->\n"
src = src.."<macro id=\""..FixtureName[i].."_"..nameMacro[j].."_"..slot.."\">\n"
src = src.."<name>"..FixtureName[i].." "..nameMacro[j]..slot.."</name>\n"
src = src.." <sequence>\n"
src = src..trim.."ActionScript.SetProperty.Boolean(\"Programmer.BlindActive\", true)</step>\n"
src = src..trim.."Programmer.SetBlindMode(false, 0)</step>\n"
src = src..trim.."Attribute.Mask.IncludeAll(\"Palette\")</step>\n"
src = src..trim.."Selection.Context.Programmer.SelectFixture(handle:\"Location=Fixtures," .. FixturePage .. "," .. FixtureSlot[i] .. "\")</step>\n"
src = src..trim.."Palette.ApplyPalette(\"Location=Colours,1,"..slot.."\", false)</step>\n"
src = src..trim.."ActionScript.SetProperty(\"Palette.CurrentPaletteHandle\", handle:\"Location=" .. RefPaletteWindow .. "," .. RefPalettePage .. "," .. tostring(RefPaletteSlot[i]+(j*RefGapSlot)-RefGapSlot) .. "\")</step>\n"
src = src..trim.."ActionScript.SetProperty.Enum(\"Palette.StorePaletteMode\", \"Shared\")</step>\n"
src = src..trim.."Palette.StoreCurrentPaletteReplace()</step>\n"
src = src..trim.."Programmer.Editor.Clear(Attribute.Mask.Clear.Value, Programmer.Editor.Fixtures.Clear.Presets, false, Expert.ClearMenu.FadeTime)</step>\n"
src = src..trim.."ActionScript.SetProperty.Boolean(\"Programmer.BlindActive\", false)</step>\n"
src = src..trim.."Programmer.SetBlindMode(false, 0)</step>\n"
--현재 Main이 어떤 색인지를 보여줄 전광판 같은 핸들에 색이미지를 넣는다.
src = src..trim.."Handles.SetSourceHandleFromHandle(handle:\"Location=" .. RefPaletteWindow .. "," .. RefPalettePage .. "," .. tostring(RefPaletteSlot[i]+(RefGapSlot*j)-RefGapSlot) .. "\")</step>\n"
src = src..trim.."Handles.SetIcon(Math.Cast.ToInteger(Handles.GetIconId(handle:\"Location=Colours,1,"..slot.."\")))</step>\n"
src = src..trim.."Handles.ClearSelection()</step>\n"
--이전에 선택되어진 매크로 Halo 지우기
for k=PaletteSlot[i], maxPaletteSlot do
src = src..trim2.."Handles.SetSourceHandleFromHandle(handle:\"Location=Colours,"..tostring(j+1)..","..k.."\")</step>\n"
src = src..trim2.."Handles.RemoveHalo()</step>\n"
src = src..trim2.."Handles.ClearSelection()</step>\n"
end
--선택되어진 매크로 Halo 쓰기
src = src..trim.."Handles.SetSourceHandleFromHandle(handle:\"Location=Colours,"..tostring(j+1)..","..slot.."\")</step>\n"
src = src..trim.."ActionScript.SetProperty(\"Handles.PendingHalo\", colour:\"#ffffffff\")</step>\n"
src = src..trim.."Handles.SetHalo()</step>\n"
src = src..trim.."Handles.ClearSelection()</step>\n"
src = src.." </sequence>\n"
src = src.."</macro>\n"
src = src.."</avolites.macros>\n"
Halo[j][i].page = j+1
Halo[j][i].slot = slot

local file = io.open(filename, "w")
io.output(file)
io.write(src)
io.close(file)
end

filename = "C:\\Users\\kimwida\\Documents\\Titan\\Macros\\"
filename = filename.."Move_"..FixtureName[i].."_"..nameMacro[j]..".xml"
src = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
src = src.."<avolites.macros>\n"
src = src.."<macro id=\"Move_"..FixtureName[i].."_"..nameMacro[j].."\">\n"
src = src.."<name>Move "..FixtureName[i].." "..nameMacro[j].."</name>\n"
src = src.." <sequence>\n"

for slot = PaletteSlot[i], maxPaletteSlot do
--매크로 이동(에러발생해서 복사) 시키는 작업
src = src..trim.."Playbacks.Editor.Macros.SetTargetHandle(\""..FixtureName[i].."_"..nameMacro[j].."_"..slot.."\")</step>\n"
src = src..trim.."ActionScript.SetProperty.Enum(\"Handles.OperationMode\", \"copy\")</step>\n"
src = src..trim.."Handles.SetSourceHandleFromHandle(Playbacks.Editor.Macros.Target.Handle)</step>\n"
src = src..trim.."ActionScript.SetProperty.Integer(\"Windows.Colours.CurrentPage\", "..j..")</step>\n"
src = src..trim.."Handles.CopyDestination(\"Colours\", ".. tostring(slot-1)..")</step>\n"
src = src..trim.."Handles.ClearSelection()</step>\n"
--이동 후 매크로에 Colours 1page에 있는 자기위치의 Palette 색깔 입히기
src = src..trim.."Handles.SetSourceHandleFromHandle(handle:\"Location=Colours,"..tostring(1+j)..","..slot.."\")</step>\n"
src = src..trim.."Handles.SetIcon(Math.Cast.ToInteger(Handles.GetIconId(handle:\"Location=Colours,1,"..slot.."\")))</step>\n"
src = src..trim.."Handles.ClearSelection()</step>\n"
end

src = src.." </sequence>\n"
src = src.."</macro>\n"
src = src.."</avolites.macros>\n"

local file = io.open(filename, "w")
io.output(file)
io.write(src)
io.close(file)
end
end

filename = "C:\\Users\\kimwida\\Documents\\Titan\\Macros\\"
filename = filename.."Run_All_MacroMappedPalette.xml"
src = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
src = src.."<avolites.macros>\n"
src = src.."<macro id=\"Run_All\">\n"
src = src.."<name>Run All</name>\n"
src = src.." <sequence>\n"
src = src..trim.."UserMacros.RecallMacroById(\"Make_Palettes_For_MacroMap\")</step>\n"
src = src..trim.."UserMacros.RecallMacroById(\"Make_Groups\")</step>\n"
for i=1, #nameMacro do
for j=1, #FixtureName do
src = src..trim.."UserMacros.RecallMacroById(\"Move_"..FixtureName[j].."_"..nameMacro[i].."\")</step>\n"
end
end
src = src.." </sequence>\n"
src = src.."</macro>\n"
src = src.."</avolites.macros>\n"

local file = io.open(filename, "w")
io.output(file)
io.write(src)
io.close(file)
=======================================================================================================================================================

Who is online

Users browsing this forum: No registered users and 40 guests