Old 02-19-2019, 07:17 PM   #1
NsaintP
Human being with feelings
 
Join Date: Feb 2019
Posts: 12
Default Delete all takes with lanes on a track?

Hi Guys,

Hoping a genius out there has a solution for me. I was advised to post this question here instead of newb forum.

I'm editing an audiobook and looking to get rid of all items that are in lanes in a given track. It takes me 5-10 mins per track to do this manually and I might inadvertently delete something not intended. Doing this again and again over 24 tracks is a bit daunting. Is there a way to 'select all items in lanes' and then delete them? The deleting part isn't the problem, obviously, that's one keystroke. The selecting is the mucky bit.

Apologies for photo. Size restriction

Any help is greatly appreciated.

N
Attached Images
File Type: jpg Mult Lanes.jpg (24.7 KB, 14 views)
NsaintP is offline   Reply With Quote
Old 02-19-2019, 07:47 PM   #2
NsaintP
Human being with feelings
 
Join Date: Feb 2019
Posts: 12
Default OOPS! Wrong forum. How to move to developer?

Hi guys,

Rookie mistake here, posted this to the wrong forum. I was advised to post to developer forum (ReaScript, JSFX, REAPER Plug-in Extensions, Developer Forum) but missed the broad side of the barn.

Time to repost.

N
NsaintP is offline   Reply With Quote
Old 02-19-2019, 08:32 PM   #3
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,064
Default

Sorry not sure I follow so will just post here,

All items on all tracks?

Code:
-- Delete all items with multiple takes

reaper.Undo_BeginBlock(0)
 
local itemcount = reaper.CountMediaItems(0)
for i = itemcount-1, 0, -1 do
  local item = reaper.GetMediaItem(0, i)
  if reaper.CountTakes(item) > 1 then
    local track = reaper.GetMediaItemTrack(item)
    reaper.DeleteTrackMediaItem(track, item)
  end
end

reaper.Undo_EndBlock("Delete all items with multiple takes", -1)
reaper.UpdateArrange()
EDIT, attached file in case your new to script...
Copy the attached Lua file to your Reaper Scripts folder, e.g., on Windows, "C:\Users\<your-name>\AppData\Roaming\REAPER\Scripts".
In REAPER open Actions window, click Load button > select the lua file, click OK, click Run button to run the action.
Attached Files
File Type: lua Delete all items with multiple takes.lua (415 Bytes, 8 views)

Last edited by Edgemeal; 02-19-2019 at 08:51 PM.
Edgemeal is offline   Reply With Quote
Old 02-21-2019, 07:45 PM   #4
NsaintP
Human being with feelings
 
Join Date: Feb 2019
Posts: 12
Default

Quote:
Originally Posted by Edgemeal View Post
Sorry not sure I follow so will just post here,

All items on all tracks?

Code:
-- Delete all items with multiple takes

reaper.Undo_BeginBlock(0)
 
local itemcount = reaper.CountMediaItems(0)
for i = itemcount-1, 0, -1 do
  local item = reaper.GetMediaItem(0, i)
  if reaper.CountTakes(item) > 1 then
    local track = reaper.GetMediaItemTrack(item)
    reaper.DeleteTrackMediaItem(track, item)
  end
end

reaper.Undo_EndBlock("Delete all items with multiple takes", -1)
reaper.UpdateArrange()
EDIT, attached file in case your new to script...
Copy the attached Lua file to your Reaper Scripts folder, e.g., on Windows, "C:\Users\<your-name>\AppData\Roaming\REAPER\Scripts".
In REAPER open Actions window, click Load button > select the lua file, click OK, click Run button to run the action.

Huge thanks Edgemeal but the script is deleting everything instead of only the takes with lanes. Unless I'm doing something wrong. . .

Basically highlighting all tracks to they're 'active' and running the script. The same thing happens when I don't highlight the items.

Here's what I'm trying to achieve in (hopefully) clearer terms:

1. Each chapter has its own track
2. There are 24 tracks.
3. Some passages, sentences, and words have multiple takes, which live in lanes.
4. Sometimes there are 2-3 minute portions without multiple takes (i.e. a single take and no take lanes)
5. My workflow is to 'explode all items to new tracks' which reaper does by giving everything in lanes their own track (which is great)
6. I now need a way to separate out the 2-3 minute stretches where there are no multiple takes from the original track (which has remained intact, despite the creation of new tracks etc)

I thought it might be possible to just delete everything from the original track that consisted of multiple takes, leaving only the 2-3 minute single take parts.

N
NsaintP is offline   Reply With Quote
Old 02-21-2019, 09:55 PM   #5
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 1,064
Default

Quote:
Originally Posted by NsaintP View Post
Huge thanks Edgemeal but the script is deleting everything instead of only the takes with lanes. Unless I'm doing something wrong. . .
There is nothing to do, That script simply deletes any item that contains more then one take.

Did you want it to work on selected tracks only? Or selected items only? Or...? Other then that probably beyond my coding skills.

EDIT Your title says ...on a track, so I assume you mean selected track(s) only, so just going to attach a couple scripts, and call it night.

Last edited by Edgemeal; 02-21-2019 at 10:30 PM.
Edgemeal is offline   Reply With Quote
Old 02-26-2019, 06:51 PM   #6
NsaintP
Human being with feelings
 
Join Date: Feb 2019
Posts: 12
Default

Quote:
Originally Posted by Edgemeal View Post
There is nothing to do, That script simply deletes any item that contains more then one take.

Did you want it to work on selected tracks only? Or selected items only? Or...? Other then that probably beyond my coding skills.

EDIT Your title says ...on a track, so I assume you mean selected track(s) only, so just going to attach a couple scripts, and call it night.

Big Ups Edgemeal. Script worked brilliantly. The original one you did, I should say. It turns out it was user error on my part. I hadn't removed all empty takes prior to running your script. Therefore, even though a particular lane might only have one take (but quite a few empty lanes) your script was deleting that take too because it was, in fact, still in a lane. So basically it deleted everything!

Anyway - I sincerely appreciate your help. It kicks a boatload of ass to be part of a community like this. Long live Reaper! Long live open source!

N
NsaintP is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 07:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.