Old 10-22-2018, 04:58 PM   #1
Steviebone
Human being with feelings
 
Join Date: Jul 2018
Posts: 809
Default Is there a way to do this? (select take directly)

I have a group of one measure takes that have been collected into a single container. The takes number in the hundreds. I need a way to be able to navigate directly to specific takes without using the painfully slow previous/next take function.

I see in the actions panel that there are actions for selecting takes 1 - 9, but nothing above that. How can I write an action that allows me to access other takes directly? Can someone show me a script example of how to access a take by number? I could then duplicate the scripts as needed and attach them to buttons allowing me to gain the direct access I need to operate efficiently.

BTW, these are MIDI items, not audio.

Last edited by Steviebone; 10-22-2018 at 05:22 PM.
Steviebone is offline   Reply With Quote
Old 10-22-2018, 05:50 PM   #2
Steviebone
Human being with feelings
 
Join Date: Jul 2018
Posts: 809
Default

I found this script courtesy of KAWA: (https://forums.cockos.com/showthread.php?p=1852714)

--================================================== ==================
local function DBG(msg) --debug message function
if ( msg == nil )
then
reaper.ShowConsoleMsg("nil" .. "\n");
else
reaper.ShowConsoleMsg(tostring(msg) .. "\n");
end
end
--================================================== ==================
-- main
local incrementStep = 1; -- next Take
local proj = 0; -- current project;
local selectedItemNum = reaper.CountSelectedMediaItems( proj);
local count = 0;
while ( count < selectedItemNum)
do
--================================================== ==============
local mediaItem = reaper.GetSelectedMediaItem(proj, count);
local activeTakeNumber = reaper.GetMediaItemInfo_Value(mediaItem, "I_CURTAKE");
local availableTakeNumber = reaper.GetMediaItemNumTakes(mediaItem);
local nextCurrentTakeNum = math.abs( (activeTakeNumber+incrementStep) % availableTakeNumber ) ; -- between [0 ~ availableTakeNum-1],
-- DBG ( nextCurrentTakeNum );
local result = reaper.SetMediaItemInfo_Value( mediaItem
, "I_CURTAKE"
, nextCurrentTakeNum
);
--================================================== ==============
-- reaper.UpdateItemInProject(mediaItem);
count = count +1;
end
--================================================== ==================
reaper.UpdateArrange();
--================================================== ==================

I can change the increment number (incrementStep) to jump in various leaps. This works fine. I couldn't make it jump to directly to a specific take tho. Any help there?
Steviebone is offline   Reply With Quote
Old 10-22-2018, 11:09 PM   #3
dsyrock
Human being with feelings
 
dsyrock's Avatar
 
Join Date: Sep 2018
Location: China
Posts: 565
Default

Hi, maybe this script can help you

Code:
reaper.Undo_BeginBlock()

selectednum=reaper.CountSelectedMediaItems(0)

if selectednum==1 then 

  _,num=reaper.GetUserInputs("Input a number", 1, "The number of take you wanna select", "")

  item=reaper.GetSelectedMediaItem(0,0)

  take=reaper.GetMediaItemTake(item,num-1)

  reaper.SetActiveTake(take)
  
end

reaper.UpdateArrange()

reaper.Undo_EndBlock("",-1)
What you need to do is
  • select the item that contain the take you wanna select
  • run the script
  • input the number of take

PS: You must select exactly ONE item

Last edited by dsyrock; 10-22-2018 at 11:22 PM.
dsyrock is offline   Reply With Quote
Old 10-22-2018, 11:34 PM   #4
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

Also, consider
  • Item: Choose active take for item under mouse
  • Take: Activate take under mouse
But with hundred of take, I don't even know if the track can display that many takes ^^
X-Raym 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 10:36 AM.


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