Old 11-08-2017, 07:22 AM   #1
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default Time Selection Script

Is there a script or group of actions that can do the following:

1. Select from the left most edge of the first chronological item in the project.

2. Expand that to the right most edge of the last chronological item in the project.

3. Expand that selection by 1 second to the left and right.

I tend to need to export end of day mixes (rendering time selection) and with lots of songs and would be nice if I could just click a toolbar button and get the same consistent selection each time which would include 1 second at the beginning and the ending of the project.

I can set up markers/regions etc. but due to other needs, I add/delete all markers from time to time (and project start/end may change a tad) and so on and it would be really, really nice to automate this selection for rendering. Just realized that I'm not sure if I chose the right forum.
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 11-08-2017, 08:28 AM   #2
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
Default

Not sure if I got this right, but try this Lua script and tell me if it does what you need:

Code:
reaper.Undo_BeginBlock()

reaper.Main_OnCommand(40182, 0) -- Item: Select all items
reaper.Main_OnCommand(40290, 0) -- Time selection: Set time selection to items
startOut, endOut = reaper.GetSet_LoopTimeRange(false, false, 0, 0, false) -- get cur. time sel. values
reaper.GetSet_LoopTimeRange(true, false, startOut-1, endOut+1, false) -- expand start/end of time sel. by 1 sec.
reaper.Main_OnCommand(40289, 0) -- Item: Unselect all items

reaper.Undo_EndBlock("Script: Set time sel. to items and expand time sel. by 1 sec.", -1)
(Currently it unselects all items at the end, if that's a problem I could do a version which preserves item selection state.)
nofish is offline   Reply With Quote
Old 11-08-2017, 08:52 AM   #3
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Quote:
Originally Posted by nofish View Post
Not sure if I got this right, but try this Lua script and tell me if it does what you need:

Code:
reaper.Undo_BeginBlock()

reaper.Main_OnCommand(40182, 0) -- Item: Select all items
reaper.Main_OnCommand(40290, 0) -- Time selection: Set time selection to items
startOut, endOut = reaper.GetSet_LoopTimeRange(false, false, 0, 0, false) -- get cur. time sel. values
reaper.GetSet_LoopTimeRange(true, false, startOut-1, endOut+1, false) -- expand start/end of time sel. by 1 sec.
reaper.Main_OnCommand(40289, 0) -- Item: Unselect all items

reaper.Undo_EndBlock("Script: Set time sel. to items and expand time sel. by 1 sec.", -1)
(Currently it unselects all items at the end, if that's a problem I could do a version which preserves item selection state.)
Thanks man! I can't test until tonight but certainly will, item selection isn't a concern at all.
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 11-08-2017, 06:20 PM   #4
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Kudos... This appears to work perfectly. Thanks again!
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 11-08-2017, 06:23 PM   #5
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
Default

Nice, you're welcome.
nofish is offline   Reply With Quote
Old 11-09-2017, 06:07 AM   #6
Reno.thestraws
Human being with feelings
 
Reno.thestraws's Avatar
 
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
Default

You don't even need a script

CAE!

__________________
http://www.residenceemilia.com
Reno.thestraws is offline   Reply With Quote
Old 11-09-2017, 07:06 AM   #7
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Quote:
Originally Posted by Reno.thestraws View Post
You don't even need a script

CAE!

That's more actions than 7 lines of code LOL.
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 11-17-2017, 06:13 PM   #8
Reno.thestraws
Human being with feelings
 
Reno.thestraws's Avatar
 
Join Date: Nov 2009
Location: Belgium
Posts: 10,474
Default

yes but CA can report toggles states which can make a HUGE difference (toolbar on/on, IF/IFNOT,..)
__________________
http://www.residenceemilia.com
Reno.thestraws is offline   Reply With Quote
Old 11-17-2017, 06:15 PM   #9
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Quote:
Originally Posted by Reno.thestraws View Post
yes but CA can report toggles states which can make a HUGE difference (toolbar on/on, IF/IFNOT,..)
Gotcha.

I just needed the project +/-1 second selected. I have nofish's script setup now, works wonderfully.
__________________
Music is what feelings sound like.
karbomusic is offline   Reply With Quote
Old 06-30-2018, 01:01 PM   #10
israeltandrade
Human being with feelings
 
israeltandrade's Avatar
 
Join Date: Aug 2016
Posts: 62
Default

Could someone make a simple script to expand time selection edge left 1 frame/pixel/64th note? I need something of this sort.
israeltandrade is offline   Reply With Quote
Old 06-30-2018, 02:56 PM   #11
israeltandrade
Human being with feelings
 
israeltandrade's Avatar
 
Join Date: Aug 2016
Posts: 62
Default

Well, I did something along the lines what I need/want. But is very big and clunky (that is the price for not knowing scripting... xD )
Anyway, if it helps someone, it will be necessary some python scripts. The custom action is on the picture attached.
My aim is to make the midi item a little bigger to the left, but with some tweak it could serve other purposes.
Attached Images
File Type: png Item Strech.png (6.0 KB, 271 views)
israeltandrade is offline   Reply With Quote
Old 07-02-2018, 09:55 AM   #12
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
Default

nice one nofish... will be handy to have, thanks
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi is offline   Reply With Quote
Old 07-02-2018, 10:27 AM   #13
karbomusic
Human being with feelings
 
karbomusic's Avatar
 
Join Date: May 2009
Posts: 29,269
Default

Quote:
Originally Posted by hopi View Post
nice one nofish... will be handy to have, thanks
It is, I still use it daily. I also added one so that I have a button that makes that selection then immediately renders with current settings which is great for getting to a stopping point and it's a single press to render out a test mix.
__________________
Music is what feelings sound like.
karbomusic 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 03:07 PM.


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