|
|
|
07-13-2018, 07:16 AM
|
#1
|
Human being with feelings
Join Date: Jan 2010
Location: Kalispell
Posts: 14,745
|
Horizontal zoom to time selection
We've got "SWS: Toggle horizontal zoom to time selection" that's a toggle, but the toggle state can get out of sequence so that it doesn't function properly.
Can just a straight (non-toggle) "Horizontal zoom to time selection" be scripted?
Thanks
|
|
|
07-13-2018, 08:37 AM
|
#2
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
This should do the magic, if I understood that action correctly. Needs SWS.
Maybe buggy, as I coded it in this forum, not in Reaper, though
Just copy the code into a new script:
Code:
starttime, endtime = reaper.GetSet_LoopTimeRange(false, false, 0, 0, false)
reaper.BR_SetArrangeView(0, starttime, endtime)
|
|
|
07-13-2018, 09:43 AM
|
#3
|
Human being with feelings
Join Date: Jan 2010
Location: Kalispell
Posts: 14,745
|
Quote:
Originally Posted by mespotine
This should do the magic, if I understood that action correctly. Needs SWS.
Maybe buggy, as I coded it in this forum, not in Reaper, though
Just copy the code into a new script:
Code:
starttime, endtime = reaper.GetSet_LoopTimeRange(false, false, 0, 0, false)
reaper.BR_SetArrangeView(0, starttime, endtime)
|
Thank you very much mespotine, this works. It does zoom in a little more then I'd like but I just put a zoom out after it and it works perfect.
|
|
|
07-13-2018, 10:35 AM
|
#4
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
You can change the last line to use starttime - 1, endttime + 1 or something for a bit of padding. (Value is in seconds)
|
|
|
07-13-2018, 11:54 AM
|
#5
|
Human being with feelings
Join Date: Jan 2010
Location: Kalispell
Posts: 14,745
|
Quote:
Originally Posted by Lokasenna
You can change the last line to use starttime - 1, endttime + 1 or something for a bit of padding. (Value is in seconds)
|
Ah thanks Lokasenna, do decimals also work? Just thinking I might be able to perfect the zoom.
This could end up to be a much used script, I'm constantly needing to zoom in certain amounts.
|
|
|
07-13-2018, 12:00 PM
|
#6
|
Human being with feelings
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
|
Quote:
Originally Posted by Tod
Ah thanks Lokasenna, do decimals also work? Just thinking I might be able to perfect the zoom.
This could end up to be a much used script, I'm constantly needing to zoom in certain amounts.
|
Yup, milliseconds work just fine.
However, a percentage-based pad would probably be more useful - if you want to zoom to a small time selection and then your pad was backing out a large ways, etc, absolute values wouldn't be too helpful.
Code:
local pad = 10 -- % of the time selection's length to pad out
local starttime, endtime = reaper.GetSet_LoopTimeRange(false, false, 0, 0, false)
local length = endtime - starttime
local pad_amt = 0.5 * (length * (pad / 100))
reaper.BR_SetArrangeView(0, starttime - pad_amt, endtime + pad_amt)
Edit the amount on the first line to whatever you want.
|
|
|
07-13-2018, 12:07 PM
|
#7
|
Human being with feelings
Join Date: Jan 2010
Location: Kalispell
Posts: 14,745
|
Quote:
Originally Posted by Lokasenna
Yup, milliseconds work just fine.
However, a percentage-based pad would probably be more useful - if you want to zoom to a small time selection and then your pad was backing out a large ways, etc, absolute values wouldn't be too helpful.
|
Thanks again Lokasenna, I checked the +1 on the endtime and it worked perfect. Milliseconds is good, I'm going to be able to use this script for a lot of things.
|
|
|
07-18-2018, 07:45 AM
|
#8
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
You're welcome
|
|
|
07-20-2018, 02:21 PM
|
#9
|
Human being with feelings
Join Date: Jan 2010
Location: Kalispell
Posts: 14,745
|
Quote:
Originally Posted by mespotine
You're welcome
|
Thanks again mespotine, I'm getting a lot of use out of it.
|
|
|
07-21-2018, 07:45 PM
|
#10
|
Human being with feelings
Join Date: Jan 2013
Location: San Jose, CA
Posts: 116
|
Thank You Tod - For asking the question.
Thank You Mespotine - For the initial script.
Thank You Lokasenna - For the script enhancements.
And Thanks to the various website authors who's writings gave me the clues needed to take that raw text and turn it into an actual script. And how to create a custom toolbar button.
This, plus a button for me2beats 'Horizontal Zoom to Project', and I'm already working faster.
Thanks to you all for sharing your knowledge!
~john~
|
|
|
07-22-2018, 05:48 AM
|
#11
|
Human being with feelings
Join Date: Jan 2012
Posts: 1,180
|
Yes this is really handy for me also.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 06:02 PM.
|