### ReaImGui Basic Template (Lua) Source: https://context7.com/reateam/reascripts-templates/llms.txt A template for immediate-mode GUI development using the ReaImGui extension. Ensure ReaImGui is installed via Reapack. ```lua input_title = "ReaImGui Demo" if not reaper.ImGui_CreateContext then reaper.MB("Missing dependency: ReaImGui extension.\nDownload it via Reapack.", "Error", 0) return false end -- Optional: Load shim for version compatibility reaimgui_shim_file_path = reaper.GetResourcePath() .. '/Scripts/ReaTeam Extensions/API/imgui.lua' if reaper.file_exists(reaimgui_shim_file_path) then dofile(reaimgui_shim_file_path)('0.8.6') end function SetButtonState(set) local is_new_value, filename, sec, cmd, mode, resolution, val = reaper.get_action_context() reaper.SetToggleCommandState(sec, cmd, set or 0) reaper.RefreshToolbar2(sec, cmd) end function Exit() SetButtonState() end function Main() -- Your ImGui widgets here if reaper.ImGui_Button(ctx, "Click Me") then reaper.ShowConsoleMsg("Button clicked!\n") end end function Run() local imgui_visible, imgui_open = reaper.ImGui_Begin(ctx, input_title, true, reaper.ImGui_WindowFlags_NoCollapse()) if imgui_visible then imgui_width, imgui_height = reaper.ImGui_GetWindowSize(ctx) Main() reaper.ImGui_End(ctx) end if imgui_open and not reaper.ImGui_IsKeyPressed(ctx, reaper.ImGui_Key_Escape()) then reaper.defer(Run) end end function Init() SetButtonState(1) reaper.atexit(Exit) ctx = reaper.ImGui_CreateContext(input_title) reaper.defer(Run) end Init() ``` -------------------------------- ### Get All MIDI Events Source: https://context7.com/reateam/reascripts-templates/llms.txt Parses and displays all MIDI events from items in the project using MIDI_GetAllEvts. Events are printed to the console. ```lua reaper.ClearConsole() tcnt = reaper.CountTracks(0) for t = 1, tcnt do tr = reaper.GetTrack(0, t-1) icnt = reaper.CountTrackMediaItems(tr) for i = 1, icnt do item = reaper.GetTrackMediaItem(tr, i-1) tk = reaper.GetActiveTake(item) if tk ~= nil then ok, buf = reaper.MIDI_GetAllEvts(tk, "") if ok and buf:len() > 0 then reaper.ShowConsoleMsg(string.format("\nTrack %d, item %d:\n", t, i)) pos = 1 while pos <= buf:len() do offs, flag, msg = string.unpack("IBs4", buf, pos) adv = 4 + 1 + 4 + msg:len() -- int+char+int+msg out = "+" .. offs .. "\t" for j = 1, msg:len() do out = out .. string.format("%02X ", msg:byte(j)) end if flag ~= 0 then out = out .. "\t" end if flag & 1 == 1 then out = out .. "sel " end if flag & 2 == 2 then out = out .. "mute " end reaper.ShowConsoleMsg(out .. "\n") pos = pos + adv end end end end end ``` -------------------------------- ### Import Audio Item From Path Source: https://context7.com/reateam/reascripts-templates/llms.txt Creates a new media item on a track from an audio file path. Requires the SWS extension. ```lua function ImportAudioItemFromPath(path, track, position, length) local retval local created local item = reaper.AddMediaItemToTrack(track) reaper.SetMediaItemInfo_Value(item, "D_POSITION", position) reaper.SetMediaItemInfo_Value(item, "D_LENGTH", length) local take = reaper.AddTakeToMediaItem(item) local pcm = reaper.PCM_Source_CreateFromFile(path) if pcm ~= nil then created = reaper.BR_SetTakeSourceFromFile(take, path, false) -- Requires SWS reaper.UpdateItemInProject(item) retval = item else reaper.DeleteTrackMediaItem(track, item) retval = nil end return retval end -- Example usage track = reaper.GetTrack(0, 0) retval, file_path = reaper.GetUserFileNameForRead("", "Import from file", "") item = ImportAudioItemFromPath(file_path, track, 0, 2) -- position=0, length=2 seconds if item ~= nil then reaper.Main_OnCommand(40048, 0) -- rebuild all peaks reaper.UpdateArrange() end ``` -------------------------------- ### Simple GUI Template with Controls (Lua) Source: https://context7.com/reateam/reascripts-templates/llms.txt A basic GUI framework using REAPER's GFX system for elements like buttons. Requires REAPER's Lua environment. ```lua -- Element Base Class local Element = {} function Element:new(x, y, w, h, r, g, b, a, lbl, fnt, fnt_sz, norm_val) local elm = {} elm.def_xywh = {x, y, w, h, fnt_sz} elm.x, elm.y, elm.w, elm.h = x, y, w, h elm.r, elm.g, elm.b, elm.a = r, g, b, a elm.lbl, elm.fnt, elm.fnt_sz = lbl, fnt, fnt_sz elm.norm_val = norm_val setmetatable(elm, self) self.__index = self return elm end function Element:pointIN(p_x, p_y) return p_x >= self.x and p_x <= self.x + self.w and p_y >= self.y and p_y <= self.y + self.h end function Element:mouseIN() return gfx.mouse_cap & 1 == 0 and self:pointIN(gfx.mouse_x, gfx.mouse_y) end function Element:mouseDown() return gfx.mouse_cap & 1 == 1 and self:pointIN(mouse_ox, mouse_oy) end function Element:mouseClick() return gfx.mouse_cap & 1 == 0 and last_mouse_cap & 1 == 1 and self:pointIN(gfx.mouse_x, gfx.mouse_y) and self:pointIN(mouse_ox, mouse_oy) end -- Button Class local Button = {} setmetatable(Button, {__index = Element}) function Button:draw() local r, g, b, a = self.r, self.g, self.b, self.a if self:mouseIN() then a = a + 0.1 end if self:mouseDown() then a = a + 0.2 end if self:mouseClick() and self.onClick then self.onClick() end gfx.set(r, g, b, a) gfx.rect(self.x, self.y, self.w, self.h, true) gfx.rect(self.x, self.y, self.w, self.h, false) gfx.set(0.7, 0.9, 0.4, 1) gfx.setfont(1, self.fnt, self.fnt_sz) local lbl_w, lbl_h = gfx.measurestr(self.lbl) gfx.x = self.x + (self.w - lbl_w) / 2 gfx.y = self.y + (self.h - lbl_h) / 2 gfx.drawstr(self.lbl) end -- Create UI elements local btn1 = Button:new(20, 20, 100, 30, 0.5, 0.3, 0.4, 0.3, "Click Me", "Arial", 15, 0) btn1.onClick = function() reaper.ShowConsoleMsg("Button clicked!\n") end -- Init and main loop function Init() gfx.init("GUI Demo", 300, 200, 0, 100, 100) last_mouse_cap = 0 mouse_ox, mouse_oy = -1, -1 end function mainloop() if gfx.mouse_cap & 1 == 1 and last_mouse_cap & 1 == 0 then mouse_ox, mouse_oy = gfx.mouse_x, gfx.mouse_y end btn1:draw() last_mouse_cap = gfx.mouse_cap char = gfx.getchar() if char ~= -1 then reaper.defer(mainloop) end gfx.update() end Init() mainloop() ``` -------------------------------- ### List FX Parameters and Values in Lua Source: https://context7.com/reateam/reascripts-templates/llms.txt Retrieves parameters from the focused FX window and prints them to the console. Requires the REAPER API to be available. ```lua local function Msg(str) reaper.ShowConsoleMsg(tostring(str) .. "\n") end local retval, tracknumberOut, itemnumberOut, fxnumberOut = reaper.GetFocusedFX() tracknumberOut = reaper.GetTrack(0, tracknumberOut - 1) local parms = {} if not retval or retval == 0 then return 0 elseif retval == 1 then -- Track FX __, parms.name = reaper.TrackFX_GetFXName(tracknumberOut, fxnumberOut, "") local num = reaper.TrackFX_GetNumParams(tracknumberOut, fxnumberOut) for i = 1, num do local ret, pname = reaper.TrackFX_GetParamName(tracknumberOut, fxnumberOut, i, "") local val, minvalOut, maxvalOut = reaper.TrackFX_GetParam(tracknumberOut, fxnumberOut, i) local ret, fval = reaper.TrackFX_GetFormattedParamValue(tracknumberOut, fxnumberOut, i, "") table.insert(parms, {pname, val, fval}) end elseif retval == 2 then -- Take FX local takenumberOut, fxnumberOut = fxnumberOut & 0xFFFF, fxnumberOut >> 16 local item = reaper.GetTrackMediaItem(tracknumberOut, itemnumberOut) if not item then return 0 end local take = reaper.GetMediaItemTake(item, takenumberOut) if not take then return 0 end __, parms.name = reaper.TakeFX_GetFXName(take, fxnumberOut, "") local num = reaper.TakeFX_GetNumParams(take, fxnumberOut) for i = 1, num do local ret, pname = reaper.TakeFX_GetParamName(take, fxnumberOut, i, "") local val = reaper.TakeFX_GetParam(take, fxnumberOut, i) local ret, fval = reaper.TakeFX_GetFormattedParamValue(take, fxnumberOut, i, "") table.insert(parms, {pname, val, fval}) end end Msg("Listing parameters for " .. tostring(parms.name) .. "\n") for i = 1, #parms do Msg("\t" .. i .. " - " .. tostring(parms[i][1])) Msg("\t\tReal value: " .. tostring(parms[i][2]) .. "\n\t\tFormatted: " .. tostring(parms[i][3])) end ``` -------------------------------- ### Lua Background Script with Defer System Source: https://context7.com/reateam/reascripts-templates/llms.txt Template for background scripts that execute actions at regular intervals using REAPER's defer system. Use for tasks that need to run periodically without blocking the UI. ```lua time = 1 -- time in seconds before each action time1 = reaper.time_precise() function Main() time2 = reaper.time_precise() if time2 - time1 > time then time1 = reaper.time_precise() -- reset timer -- Your periodic action here reaper.ShowConsoleMsg("Action executed\n") end reaper.defer(Main) end -- Run Main() ``` -------------------------------- ### Basic Lua Script Template with Undo and UI Refresh Source: https://context7.com/reateam/reascripts-templates/llms.txt Provides a complete Lua script structure including undo block management, UI refresh control, debug console output, and common iteration patterns. Use for general-purpose scripts requiring robust structure. ```lua -- USER CONFIG AREA console = true -- true/false: display debug messages in the console undo_text = "My action" -- UTILITIES function SaveSelectedItems(t) local t = t or {} for i = 0, reaper.CountSelectedMediaItems(0)-1 do t[i+1] = reaper.GetSelectedMediaItem(0, i) end return t end function RestoreSelectedItems(items) reaper.SelectAllMediaItems(0, false) for i, item in ipairs(items) do reaper.SetMediaItemSelected(item, true) end end function Msg(value) if console then reaper.ShowConsoleMsg(tostring(value) .. "\n") end end -- Main function function Main() for i, item in ipairs(init_sel_items) do -- Manipulate items here local value = reaper.GetMediaItemInfo_Value(item, "D_VOL") reaper.SetMediaItemInfo_Value(item, "D_POSITION", value_set) end end -- INIT function Init() reaper.ClearConsole() count_sel_items = reaper.CountSelectedMediaItems(0) if count_sel_items == 0 then return false end reaper.PreventUIRefresh(1) reaper.Undo_BeginBlock() init_sel_items = SaveSelectedItems() Main() RestoreSelectedItems(init_sel_items) reaper.Undo_EndBlock(undo_text, -1) reaper.UpdateArrange() reaper.PreventUIRefresh(-1) end Init() ``` -------------------------------- ### Insert MIDI Notes on Selected Takes Source: https://context7.com/reateam/reascripts-templates/llms.txt Inserts MIDI notes programmatically into selected media items containing MIDI data. Ensure the take has MIDI data before execution. ```lua count_items = reaper.CountSelectedMediaItems(0) for i = 0, count_items - 1 do local item = reaper.GetSelectedMediaItem(0, i) local take = reaper.GetActiveTake(item) -- MIDI_InsertNote parameters: -- take, selected, muted, startppqpos, endppqpos, chan, pitch, vel, noSortIn local selected = true local muted = false local startppqpos = 0 -- Start position in PPQ local endppqpos = 960 -- End position in PPQ (960 = 1 quarter note at 960 PPQ) local chan = 0 -- MIDI channel (0-15) local pitch = 60 -- Note number (60 = Middle C) local vel = 100 -- Velocity (0-127) local noSortIn = true -- Set true for multiple insertions local retval = reaper.MIDI_InsertNote(take, selected, muted, startppqpos, endppqpos, chan, pitch, vel, noSortIn) reaper.MIDI_Sort(take) -- Sort after insertion when noSortIn=true end reaper.UpdateArrange() ``` -------------------------------- ### Basic EEL Script Template with Debugging Source: https://context7.com/reateam/reascripts-templates/llms.txt Provides a basic EEL script structure with integrated debugging support for console messages and optional console cleaning. Suitable for EEL scripting tasks within REAPER. ```eel // ----- DEBUGGING ====> @import ../Functions/X-Raym_Functions - console debug messages.eel debug = 1; // 0 => No console. 1 => Display console messages clean = 1; // 0 => No cleaning. 1 => Console cleaning before execution msg_clean(); // <==== DEBUGGING ----- function main() ( Undo_BeginBlock(); // LOOP THROUGH SELECTED ITEMS selected_items_count = CountSelectedMediaItems(0); i = 0; loop(selected_items_count, (item = GetSelectedMediaItem(0, i)) ? ( value_get = GetMediaItemInfo_Value(item, "D_VOL"); value_set = value_get; SetMediaItemInfo_Value(item, "D_VOL", value_set); ); i += 1; ); Undo_EndBlock("My action", 0); ); msg_start(); main(); UpdateArrange(); msg_end(); ``` -------------------------------- ### Retrieve Marker or Region at Position Source: https://context7.com/reateam/reascripts-templates/llms.txt Retrieves the name and index of a marker or region at a specific project timeline position. ```lua function GetMarkerOrRegionAtPos(pos) local vals = {} local markeridx, regionidx = reaper.GetLastMarkerAndCurRegion(0, pos) if regionidx then local retval, isrgn, start, rgnend, name, idx = reaper.EnumProjectMarkers(regionidx) vals.region_name = name vals.region_idx = idx end if markeridx then local retval, isrgn, start, rgnend, name, idx = reaper.EnumProjectMarkers(markeridx) if start == pos then vals.marker_name = name vals.marker_idx = idx end end return vals end -- Usage local cursor_pos = reaper.GetCursorPosition() local info = GetMarkerOrRegionAtPos(cursor_pos) if info.region_name then reaper.ShowConsoleMsg("In region: " .. info.region_name .. "\n") end ``` -------------------------------- ### String Split Function (Lua) Source: https://context7.com/reateam/reascripts-templates/llms.txt Extends the string library to split a string into a table of substrings based on a specified delimiter. Defaults to ':' if no delimiter is provided. ```lua function string:split(sep) local sep, fields = sep or ":", {} local pattern = string.format("([^ %s]+)", sep) self:gsub(pattern, function(c) fields[#fields + 1] = c end) return fields end -- Usage local csv = "apple,banana,cherry" local fruits = csv:split(",") -- fruits = {"apple", "banana", "cherry"} ``` -------------------------------- ### Create JSFX MIDI Effect Source: https://context7.com/reateam/reascripts-templates/llms.txt A template for building JSFX MIDI effects, including logic for input channel filtering. ```jsfx desc:Note Filter Example slider1:0<0,16,1{Any,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}>Input Channel @init statNoteOn = $x90; statNoteOff = $x80; @slider inChannel = slider1 - 1; @block while ( midirecv(offset, msg1, note, vel) ? ( // Extract message type and channel status = msg1 & $xF0; channel = msg1 & $x0F; // Is it on our channel? channel == inChannel || inChannel == -1 ? ( // Is it a note event? status == statNoteOn || status == statNoteOff ? ( // Process note here // Example: transpose up one octave note = note + 12; ); ); midisend(offset, msg1, note, vel); 1; // Continue processing ); ); ``` -------------------------------- ### Add FX to Selected Tracks Source: https://context7.com/reateam/reascripts-templates/llms.txt Adds a specified FX plugin to all selected tracks in the project. Uses Undo_BeginBlock and Undo_EndBlock for undo functionality. ```lua reaper.Undo_BeginBlock() FX = "ReaComp" -- FX name to add TrackIdx = 0 TrackCount = reaper.CountSelectedTracks(0) while TrackIdx < TrackCount do track = reaper.GetSelectedTrack(0, TrackIdx) reaper.TrackFX_AddByName(track, FX, 0, -1) -- -1 = add to end of chain TrackIdx = TrackIdx + 1 end reaper.Undo_EndBlock("Add new track FX instance", -1) ``` -------------------------------- ### Serialize and Deserialize Lua Tables Source: https://context7.com/reateam/reascripts-templates/llms.txt Functions to save and load Lua tables to files for persistent storage. ```lua function table.save(tbl, filename) local file = io.open(filename, "w") if not file then return nil, "Cannot open file" end local function serialize(t, indent) indent = indent or "" local s = "{\n" for k, v in pairs(t) do s = s .. indent .. " " if type(k) == "string" then s = s .. '["' .. k .. '"] = ' else s = s .. "[" .. k .. "] = " end if type(v) == "table" then s = s .. serialize(v, indent .. " ") elseif type(v) == "string" then s = s .. '"' .. v .. '"' else s = s .. tostring(v) end s = s .. ",\n" end return s .. indent .. "}" end file:write("return " .. serialize(tbl)) file:close() return true end function table.load(filename) local chunk, err = loadfile(filename) if chunk then return chunk() end return nil, err end -- Usage local data = {name = "Project", tracks = 16, tempo = 120.5} table.save(data, "settings.lua") local loaded = table.load("settings.lua") -- loaded.name == "Project" ``` -------------------------------- ### Convert RGB and HSL Color Spaces Source: https://context7.com/reateam/reascripts-templates/llms.txt Functions to convert between RGB and HSL color formats. Useful for color manipulation in scripts. ```lua function rgbToHsl(r, g, b, a) r, g, b = r / 255, g / 255, b / 255 local max, min = math.max(r, g, b), math.min(r, g, b) local h, s, l l = (max + min) / 2 if max == min then h, s = 0, 0 else local d = max - min s = l > 0.5 and d / (2 - max - min) or d / (max + min) if max == r then h = (g - b) / d + (g < b and 6 or 0) elseif max == g then h = (b - r) / d + 2 else h = (r - g) / d + 4 end h = h / 6 end return h, s, l, a or 255 end function hslToRgb(h, s, l, a) local r, g, b if s == 0 then r, g, b = l, l, l else local function hue2rgb(p, q, t) if t < 0 then t = t + 1 end if t > 1 then t = t - 1 end if t < 1/6 then return p + (q - p) * 6 * t end if t < 1/2 then return q end if t < 2/3 then return p + (q - p) * (2/3 - t) * 6 end return p end local q = l < 0.5 and l * (1 + s) or l + s - l * s local p = 2 * l - q r = hue2rgb(p, q, h + 1/3) g = hue2rgb(p, q, h) b = hue2rgb(p, q, h - 1/3) end return math.floor(r * 255 + 0.5), math.floor(g * 255 + 0.5), math.floor(b * 255 + 0.5), (a or 1) * 255 end -- Usage local h, s, l = rgbToHsl(255, 128, 64) local r, g, b = hslToRgb(h, s, l * 0.8) -- Darken by 20% ``` -------------------------------- ### Convert dB to Linear Amplitude Source: https://context7.com/reateam/reascripts-templates/llms.txt Utility functions for converting between decibel values and linear amplitude. ```lua function dBFromVal(val) return 20 * math.log(val, 10) end function ValFromdB(dB_val) return 10 ^ (dB_val / 20) end -- Usage local db_value = dBFromVal(2) -- ~6.02 dB local linear_value = ValFromdB(6.02) -- ~2.0 ``` -------------------------------- ### Calculate Average RMS of Media Take Source: https://context7.com/reateam/reascripts-templates/llms.txt Calculates the average Root Mean Square (RMS) level of a media take. Supports volume and pan adjustments, and can output values in dB. Ensure a valid take object is provided. ```lua function get_average_rms(take, adj_for_take_vol, adj_for_item_vol, adj_for_take_pan, val_is_dB) local RMS_t = {} if take == nil then return end local item = reaper.GetMediaItemTake_Item(take) if item == nil then return end local item_pos = reaper.GetMediaItemInfo_Value(item, "D_POSITION") local item_len = reaper.GetMediaItemInfo_Value(item, "D_LENGTH") local take_pcm_source = reaper.GetMediaItemTake_Source(take) if take_pcm_source == nil then return end local aa = reaper.CreateTakeAudioAccessor(take) if aa == nil then return end local take_source_len = reaper.GetMediaSourceLength(take_pcm_source) local take_source_num_channels = reaper.GetMediaSourceNumChannels(take_pcm_source) local take_source_sample_rate = reaper.GetMediaSourceSampleRate(take_pcm_source) if take_source_sample_rate == 0 then return end -- MIDI source local samples_per_channel = take_source_sample_rate / 10 local buffer = reaper.new_array(samples_per_channel * take_source_num_channels) local channel_data = {} for i = 1, take_source_num_channels do channel_data[i] = { rms = 0, sum_squares = 0 } end local aa_start = reaper.GetAudioAccessorStartTime(aa) local aa_end = reaper.GetAudioAccessorEndTime(aa) local total_samples = math.floor((aa_end - aa_start) * take_source_sample_rate + 0.5) if total_samples < 1 then return end local sample_count = 0 local offs = aa_start while sample_count < total_samples do local aa_ret = reaper.GetAudioAccessorSamples(aa, take_source_sample_rate, take_source_num_channels, offs, samples_per_channel, buffer) if aa_ret == 1 then for i = 1, #buffer, take_source_num_channels do if sample_count == total_samples then break end for j = 1, take_source_num_channels do local spl = buffer[i + j - 1] channel_data[j].sum_squares = channel_data[j].sum_squares + spl * spl end sample_count = sample_count + 1 end elseif aa_ret == 0 then sample_count = sample_count + samples_per_channel else return end offs = offs + samples_per_channel / take_source_sample_rate end reaper.DestroyAudioAccessor(aa) -- Calculate adjustments local adjust_vol = 1 if adj_for_take_vol then adjust_vol = adjust_vol * reaper.GetMediaItemTakeInfo_Value(take, "D_VOL") end if adj_for_item_vol then adjust_vol = adjust_vol * reaper.GetMediaItemInfo_Value(item, "D_VOL") end -- Calculate RMS per channel for i = 1, take_source_num_channels do local curr_ch = channel_data[i] curr_ch.rms = math.sqrt(curr_ch.sum_squares / total_samples) * adjust_vol RMS_t[i] = curr_ch.rms if val_is_dB then RMS_t[i] = 20 * math.log(RMS_t[i], 10) end end return RMS_t end -- Example usage local item = reaper.GetSelectedMediaItem(0, 0) if item then local take = reaper.GetActiveTake(item) local rms = get_average_rms(take, true, true, false, true) -- returns dB values if rms then for ch, val in ipairs(rms) do reaper.ShowConsoleMsg("Channel " .. ch .. " RMS: " .. val .. " dB\n") end end end ``` -------------------------------- ### Console Print Function (Lua) Source: https://context7.com/reateam/reascripts-templates/llms.txt An enhanced print function that outputs multiple values to REAPER's console, concatenating them with newlines. Useful for debugging. ```lua function print(...) local t = {} for i, v in ipairs({...}) do t[i] = tostring(v) end reaper.ShowConsoleMsg(table.concat(t, "\n") .. "\n") end -- Usage print("Value:", 42, "Status:", true) ``` -------------------------------- ### Set Selected Tracks Info Value in Lua Source: https://context7.com/reateam/reascripts-templates/llms.txt Iterates through selected tracks and modifies their properties, such as height override and name, using REAPER API functions. Use when needing to batch update track properties. ```lua console = true function Msg(value) if console then reaper.ShowConsoleMsg(tostring(value) .. "\n") end end function main() -- LOOP THROUGH SELECTED TRACKS for i = 0, sel_tracks_count - 1 do local track = reaper.GetSelectedTrack(0, i) -- Get selected track i -- Set numeric property value reaper.SetMediaTrackInfo_Value(track, "I_HEIGHTOVERRIDE", 0) -- Set string property value (track name) local retval, track_name = reaper.GetSetMediaTrackInfo_String(track, "P_NAME", "new track name", true) end end -- INIT sel_tracks_count = reaper.CountSelectedTracks(0) if sel_tracks_count > 0 then reaper.Undo_BeginBlock() reaper.PreventUIRefresh(1) main() reaper.UpdateArrange() reaper.PreventUIRefresh(-1) reaper.Undo_EndBlock("Set track properties", -1) end ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.