Last active
July 31, 2019 04:21
-
-
Save cfillion/c348011581b6028eb503493cafd37eb1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- @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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you! Please add to reapack