4PointCutting: Cleaned up comments, addd headers
This commit is contained in:
parent
2ba98cd1de
commit
8c100ef186
@ -1,3 +1,12 @@
|
|||||||
|
-- Reaper Scripts for 4 point editing. This script executes "one edit" and copies source material from
|
||||||
|
-- already set source in/out markers to also set destination in/out markers.
|
||||||
|
-- Author: Ludwig Frühschütz
|
||||||
|
-- Source: https://www.eleton-audio.de
|
||||||
|
-- Git: https://files.eleton-audio.de/gitea/Ludwig/Reaper-Scripts.git
|
||||||
|
-- License: GPL v3.0
|
||||||
|
-- Requires: Reaper 5 or 6
|
||||||
|
-- Requires: This script goes with several other scripts that work closely together.
|
||||||
|
|
||||||
local stored_cursorPos = 0
|
local stored_cursorPos = 0
|
||||||
local stored_timeSelStart = 0
|
local stored_timeSelStart = 0
|
||||||
local stored_timeSelEnd = 0
|
local stored_timeSelEnd = 0
|
||||||
@ -17,6 +26,7 @@ function msg(m)
|
|||||||
reaper.ShowConsoleMsg(tostring(m) .. "\n")
|
reaper.ShowConsoleMsg(tostring(m) .. "\n")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Selects the source tracks, or, if not stored in rpp, selects all tracks
|
||||||
function select_src_tracks()
|
function select_src_tracks()
|
||||||
local tracks_str = ''
|
local tracks_str = ''
|
||||||
local tracks = {}
|
local tracks = {}
|
||||||
@ -29,7 +39,6 @@ function select_src_tracks()
|
|||||||
table.insert(tracks, reaper.BR_GetMediaTrackByGUID(0, '{' .. str))
|
table.insert(tracks, reaper.BR_GetMediaTrackByGUID(0, '{' .. str))
|
||||||
end
|
end
|
||||||
-- select tracks
|
-- select tracks
|
||||||
--reaper.Main_OnCommand(40297, 0) -- Unselect all tracks
|
|
||||||
for _, track in ipairs(tracks) do
|
for _, track in ipairs(tracks) do
|
||||||
reaper.SetTrackSelected(track, true)
|
reaper.SetTrackSelected(track, true)
|
||||||
end
|
end
|
||||||
@ -41,6 +50,7 @@ function select_src_tracks()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Select the destination tracks, or, if not stored in rpp, the first track
|
||||||
function select_dst_track_only()
|
function select_dst_track_only()
|
||||||
local track_str = ''
|
local track_str = ''
|
||||||
local retval
|
local retval
|
||||||
@ -68,8 +78,7 @@ end
|
|||||||
if reaper.CountSelectedTracks(0) > 0then
|
if reaper.CountSelectedTracks(0) > 0then
|
||||||
reaper.Main_OnCommand(40297, 0) -- Unselect all tracks
|
reaper.Main_OnCommand(40297, 0) -- Unselect all tracks
|
||||||
end
|
end
|
||||||
--reaper.Main_OnCommand(40769, 0)
|
select_src_tracks()
|
||||||
select_src_tracks() -- select tracks specified in rpp (by using 4Pcut_set_src-tracks.lua)
|
|
||||||
|
|
||||||
-- run through all markers and get position of the 4 points
|
-- run through all markers and get position of the 4 points
|
||||||
local nof_markers = 0
|
local nof_markers = 0
|
||||||
@ -113,17 +122,12 @@ end
|
|||||||
-- Do stuff before actual edits...
|
-- Do stuff before actual edits...
|
||||||
reaper.Undo_BeginBlock()
|
reaper.Undo_BeginBlock()
|
||||||
|
|
||||||
|
|
||||||
-- Set Source Time selection and Copy Items
|
-- Set Source Time selection and Copy Items
|
||||||
reaper.GetSet_LoopTimeRange(true, false, mark_srcin_pos, mark_srcout_pos, false)
|
reaper.GetSet_LoopTimeRange(true, false, mark_srcin_pos, mark_srcout_pos, false)
|
||||||
reaper.Main_OnCommand(40718, 0) -- select items on selected tracks under time selection
|
reaper.Main_OnCommand(40718, 0) -- select items on selected tracks under time selection
|
||||||
reaper.Main_OnCommand(40060, 0) -- copy selected items under time selection 41383
|
reaper.Main_OnCommand(40060, 0) -- copy selected items under time selection 41383
|
||||||
-- reaper.Main_OnCommand( reaper.NamedCommandLookup('_SWS_SMARTCOPY'), 0 )
|
|
||||||
|
|
||||||
|
|
||||||
-- Move edit cursor to Dest-In and Paste
|
-- Move edit cursor to Dest-In and Paste
|
||||||
--reaper.GoToMarker(0, mark_dstin_id, false)
|
|
||||||
-- reaper.GetSet_LoopTimeRange(true, false, mark_dstin_pos, mark_dstout_pos, false)
|
|
||||||
reaper.MoveEditCursor(mark_dstin_pos - reaper.GetCursorPosition(), false)
|
reaper.MoveEditCursor(mark_dstin_pos - reaper.GetCursorPosition(), false)
|
||||||
select_dst_track_only()
|
select_dst_track_only()
|
||||||
reaper.Main_OnCommand(40058, 0) -- paste item
|
reaper.Main_OnCommand(40058, 0) -- paste item
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
-- Reaper Script for 4 point editing. This script deletes all the special markers that are
|
||||||
|
-- used to define source and destination areas.
|
||||||
|
-- Author: Ludwig Frühschütz
|
||||||
|
-- Source: https://www.eleton-audio.de
|
||||||
|
-- Git: https://files.eleton-audio.de/gitea/Ludwig/Reaper-Scripts.git
|
||||||
|
-- License: GPL v3.0
|
||||||
|
-- Requires: Reaper 5 or 6
|
||||||
|
-- Requires: This script goes with several other scripts that work closely together.
|
||||||
|
|
||||||
local nof_markers = 0
|
local nof_markers = 0
|
||||||
local id = -1
|
local id = -1
|
||||||
local name = ''
|
local name = ''
|
||||||
|
@ -1,2 +1,10 @@
|
|||||||
|
-- Reaper Scripts for 4 point editing. This script resets the source and destination tracks to "all" and "first".
|
||||||
|
-- Author: Ludwig Frühschütz
|
||||||
|
-- Source: https://www.eleton-audio.de
|
||||||
|
-- Git: https://files.eleton-audio.de/gitea/Ludwig/Reaper-Scripts.git
|
||||||
|
-- License: GPL v3.0
|
||||||
|
-- Requires: Reaper 5 or 6
|
||||||
|
-- Requires: This script goes with several other scripts that work closely together.
|
||||||
|
|
||||||
reaper.SetProjExtState(0, '4PointCut', 'dst_track', '')
|
reaper.SetProjExtState(0, '4PointCut', 'dst_track', '')
|
||||||
reaper.SetProjExtState(0, '4PointCut', 'src_tracks', '')
|
reaper.SetProjExtState(0, '4PointCut', 'src_tracks', '')
|
@ -1,3 +1,11 @@
|
|||||||
|
-- Reaper Scripts for 4 point editing. This script selects the previous set destination track
|
||||||
|
-- Author: Ludwig Frühschütz
|
||||||
|
-- Source: https://www.eleton-audio.de
|
||||||
|
-- Git: https://files.eleton-audio.de/gitea/Ludwig/Reaper-Scripts.git
|
||||||
|
-- License: GPL v3.0
|
||||||
|
-- Requires: Reaper 5 or 6
|
||||||
|
-- Requires: This script goes with several other scripts that work closely together.
|
||||||
|
|
||||||
-- Send a message to the console
|
-- Send a message to the console
|
||||||
function msg(m)
|
function msg(m)
|
||||||
reaper.ShowConsoleMsg(tostring(m) .. "\n")
|
reaper.ShowConsoleMsg(tostring(m) .. "\n")
|
||||||
@ -6,7 +14,7 @@ end
|
|||||||
-- START HERE vvvvvvvvvvvvvvvvv
|
-- START HERE vvvvvvvvvvvvvvvvv
|
||||||
local track_str = ''
|
local track_str = ''
|
||||||
local retval
|
local retval
|
||||||
|
-- get the setting stored in rpp and select the track
|
||||||
retval, track_str = reaper.GetProjExtState(0, '4PointCut', 'dst_track')
|
retval, track_str = reaper.GetProjExtState(0, '4PointCut', 'dst_track')
|
||||||
if retval > 0 then -- variable exists in rpp
|
if retval > 0 then -- variable exists in rpp
|
||||||
reaper.SetOnlyTrackSelected(reaper.BR_GetMediaTrackByGUID(0, track_str))
|
reaper.SetOnlyTrackSelected(reaper.BR_GetMediaTrackByGUID(0, track_str))
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
-- Reaper Scripts for 4 point editing. This script selects the previous set source tracks
|
||||||
|
-- Author: Ludwig Frühschütz
|
||||||
|
-- Source: https://www.eleton-audio.de
|
||||||
|
-- Git: https://files.eleton-audio.de/gitea/Ludwig/Reaper-Scripts.git
|
||||||
|
-- License: GPL v3.0
|
||||||
|
-- Requires: Reaper 5 or 6
|
||||||
|
-- Requires: This script goes with several other scripts that work closely together.
|
||||||
|
|
||||||
-- Send a message to the console
|
-- Send a message to the console
|
||||||
function msg(m)
|
function msg(m)
|
||||||
reaper.ShowConsoleMsg(tostring(m) .. "\n")
|
reaper.ShowConsoleMsg(tostring(m) .. "\n")
|
||||||
@ -8,6 +16,7 @@ local tracks_str = ''
|
|||||||
local tracks = {}
|
local tracks = {}
|
||||||
local retval
|
local retval
|
||||||
|
|
||||||
|
-- get stored GUIDs from rpp and select the tracks
|
||||||
retval, tracks_str = reaper.GetProjExtState(0, '4PointCut', 'src_tracks')
|
retval, tracks_str = reaper.GetProjExtState(0, '4PointCut', 'src_tracks')
|
||||||
if retval > 0 then -- variable exists in rpp
|
if retval > 0 then -- variable exists in rpp
|
||||||
-- separate GUIDs and populate track table
|
-- separate GUIDs and populate track table
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
-- Reaper Scripts for 4 point editing. This script sets the Destination Start marker to the position of the edit cursor
|
||||||
|
-- Author: Ludwig Frühschütz
|
||||||
|
-- Source: https://www.eleton-audio.de
|
||||||
|
-- Git: https://files.eleton-audio.de/gitea/Ludwig/Reaper-Scripts.git
|
||||||
|
-- License: GPL v3.0
|
||||||
|
-- Requires: Reaper 5 or 6
|
||||||
|
-- Requires: This script goes with several other scripts that work closely together.
|
||||||
|
|
||||||
local nof_markers = 0
|
local nof_markers = 0
|
||||||
local id = -1
|
local id = -1
|
||||||
|
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
-- Reaper Scripts for 4 point editing. This script sets the Destination End marker to the position of the edit cursor
|
||||||
|
-- Author: Ludwig Frühschütz
|
||||||
|
-- Source: https://www.eleton-audio.de
|
||||||
|
-- Git: https://files.eleton-audio.de/gitea/Ludwig/Reaper-Scripts.git
|
||||||
|
-- License: GPL v3.0
|
||||||
|
-- Requires: Reaper 5 or 6
|
||||||
|
-- Requires: This script goes with several other scripts that work closely together.
|
||||||
|
|
||||||
local nof_markers = 0
|
local nof_markers = 0
|
||||||
local id = -1
|
local id = -1
|
||||||
|
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
-- Reaper Scripts for 4 point editing. This script sets the Source Start marker to the position of the edit cursor
|
||||||
|
-- Author: Ludwig Frühschütz
|
||||||
|
-- Source: https://www.eleton-audio.de
|
||||||
|
-- Git: https://files.eleton-audio.de/gitea/Ludwig/Reaper-Scripts.git
|
||||||
|
-- License: GPL v3.0
|
||||||
|
-- Requires: Reaper 5 or 6
|
||||||
|
-- Requires: This script goes with several other scripts that work closely together.
|
||||||
|
|
||||||
local nof_markers = 0
|
local nof_markers = 0
|
||||||
local id = -1
|
local id = -1
|
||||||
|
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
-- Reaper Scripts for 4 point editing. This script sets the Source End marker to the position of the edit cursor
|
||||||
|
-- Author: Ludwig Frühschütz
|
||||||
|
-- Source: https://www.eleton-audio.de
|
||||||
|
-- Git: https://files.eleton-audio.de/gitea/Ludwig/Reaper-Scripts.git
|
||||||
|
-- License: GPL v3.0
|
||||||
|
-- Requires: Reaper 5 or 6
|
||||||
|
-- Requires: This script goes with several other scripts that work closely together.
|
||||||
|
|
||||||
local nof_markers = 0
|
local nof_markers = 0
|
||||||
local id = -1
|
local id = -1
|
||||||
|
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
-- Reaper Scripts for 4 point editing. This script sets the Destination track and stores it to the rpp.
|
||||||
|
-- Only one (the first) selected track is used here.
|
||||||
|
-- Author: Ludwig Frühschütz
|
||||||
|
-- Source: https://www.eleton-audio.de
|
||||||
|
-- Git: https://files.eleton-audio.de/gitea/Ludwig/Reaper-Scripts.git
|
||||||
|
-- License: GPL v3.0
|
||||||
|
-- Requires: Reaper 5 or 6
|
||||||
|
-- Requires: This script goes with several other scripts that work closely together.
|
||||||
|
|
||||||
-- Send a message to the console
|
-- Send a message to the console
|
||||||
function msg(m)
|
function msg(m)
|
||||||
reaper.ShowConsoleMsg(tostring(m) .. "\n")
|
reaper.ShowConsoleMsg(tostring(m) .. "\n")
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
-- Reaper Scripts for 4 point editing. This script sets the source tracks and stores it to the rpp.
|
||||||
|
-- Author: Ludwig Frühschütz
|
||||||
|
-- Source: https://www.eleton-audio.de
|
||||||
|
-- Git: https://files.eleton-audio.de/gitea/Ludwig/Reaper-Scripts.git
|
||||||
|
-- License: GPL v3.0
|
||||||
|
-- Requires: Reaper 5 or 6
|
||||||
|
-- Requires: This script goes with several other scripts that work closely together.
|
||||||
|
|
||||||
-- Send a message to the console
|
-- Send a message to the console
|
||||||
function msg(m)
|
function msg(m)
|
||||||
reaper.ShowConsoleMsg(tostring(m) .. "\n")
|
reaper.ShowConsoleMsg(tostring(m) .. "\n")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user