Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cfillion/c348011581b6028eb503493cafd37eb1 to your computer and use it in GitHub Desktop.
Save cfillion/c348011581b6028eb503493cafd37eb1 to your computer and use it in GitHub Desktop.
-- @version 1.0beta
-- @author cfillion
-- send types
local RECEIVE = -1
local SEND = 0
local HARDWARE = 1
local PARAMS = {
'B_MUTE', 'B_PHASE', 'B_MONO', 'D_VOL', 'D_PAN',' D_PANLAW', 'I_SENDMODE',
'I_AUTOMODE', 'I_SRCCHAN', 'I_DSTCHAN', 'I_MIDIFLAGS',
}
local DESTINATION = 1
local config = {
copy_index = 0, -- which send/receive to copy
copy_type = SEND,
paste_type = SEND,
}
function enumSelectedTracks()
local i = -1
return function()
i = i + 1
return reaper.GetSelectedTrack(0, i)
end
end
for track in enumSelectedTracks() do
local parent = reaper.GetParentTrack(track)
local target = parent and reaper.BR_GetMediaTrackSendInfo_Track(parent,
config.copy_type, config.copy_index, DESTINATION)
if target then
local sendId = reaper.CreateTrackSend(track, target)
for _, param in ipairs(PARAMS) do
local value = reaper.GetTrackSendInfo_Value(parent, config.copy_type, config.copy_index, param)
reaper.SetTrackSendInfo_Value(track, config.paste_type, sendId, param, value)
end
end
end
@reaswi
Copy link

reaswi commented Jul 31, 2019

Thank you! Please add to reapack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment