|
|
|
01-03-2019, 08:01 AM
|
#1
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Smart contextual zoom
amagalma_Smart contextual zoom
In ReaPack.
Description:
-- Toggles zoom to objects under mouse (if less than two are selected), or to selected objects (if 2+ are selected)
-- Can zoom to tracks, items, envelopes, regions or time selection
-- Mode is stored in project external state so zooming out can be resumed even after loading a saved project
-- Does not create unnecessary undo points
-- Undo points are created only when (un)hiding Master Track, which is unavoidable
-- Needs js_ReaScriptAPI extension
GIF:
Use:
1) Assign the action to a hotkey
2) Hover the mouse over a track in TCP and press the hotkey: if less than two tracks are selected, then the track under the mouse gets maximized. If two or more tracks are selected, then these tracks get maximized. Press hotkey again over any track to return to initial TCP view state.
3) Hover the mouse over a track in empty Arrange area and press the hotkey: the track under the mouse gets maximized. Press hotkey again over any track in TCP or empty Arrange area to return to initial TCP view state.
4) Hover mouse over an item and press the hotkey: if less than two items are selected, then the item under the mouse gets maximized. If two or more items are selected, then these items get maximized. Press hotkey again over any item to return to initial Arrange view state.
5) Hover mouse over a region in the region lane and press the hotkey: the region zooms to fill the Arrange view. Press hotkey again over the region in the region lane to return to initial Arrange view state.
6) Hover mouse over Timeline lane and press the hotkey: script zooms to the time selection if any. Press hotkey again over the timeline lane to return to initial Arrange view state.
7) Hover mouse over an envelope and press the hotkey: envelope maximizes to fill the TCP. Press the hotkey again over the envelope to set to the default envelope size.
Last edited by amagalma; 01-04-2019 at 07:48 AM.
|
|
|
01-03-2019, 08:39 AM
|
#2
|
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
This reminds me of kawa's auto track height for mouse over or selected track which I use very often. Click here:
Yours looks pretty practical too. Did you use a hotkey in your gif?
|
|
|
01-03-2019, 08:45 AM
|
#3
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
The two scripts do completely different things. In this one, zooming is not automatic and is not only for the selected track. You assign the script to a hotkey and you can zoom in to whatever you want whenever you press the key. You zoom in and with the second press you return to the previous state before the zoom. Try it and you will understand what I am saying.
|
|
|
01-03-2019, 08:52 AM
|
#4
|
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
Quote:
Originally Posted by amagalma
The two scripts do completely different things. In this one, zooming is not automatic and is not only for the selected track. You assign the script to a hotkey and you can zoom in to whatever you want whenever you press the key. You zoom in and with the second press you return to the previous state before the zoom. Try it and you will understand what I am saying.
|
That's what I guessed already. Will try it out.
Many thanks.
|
|
|
01-03-2019, 09:00 AM
|
#5
|
Human being with feelings
Join Date: Sep 2010
Location: Saint Paul, MN
Posts: 534
|
Nice, and thank you. Will use this a great deal...
tg
__________________
Mac Studio M1 MAX / 64GB / 2TB HD / macOS Ventura 13.6.3 / RME BabyFace Pro FS / SSL UF8 + UF1 + UC1 / Roland SYSTEM 8 / Kontrol S61 mk3 / Keylab 61 mkII / Komplete 14 / Omnisphere / Keyscape / Trilian / V Collection X / UVI Falcon
|
|
|
01-03-2019, 09:08 AM
|
#6
|
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
Code:
amagalma_Smart contextual zoom.lua:16: attempt to call a nil value (field 'JS_Window_FindChildByID')
What did I do wrong? I assigned a key, selected or hovered tracks or regions but I always got this error.
|
|
|
01-03-2019, 09:18 AM
|
#7
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
You need the js_ReaScriptAPI extension. Install it from ReaPack or manually.
|
|
|
01-03-2019, 09:52 AM
|
#8
|
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
Have no idea how to get or install this. So... nope
but thanks.
|
|
|
01-03-2019, 10:40 AM
|
#9
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Since you see my action, you seem to already have ReaPack. So, run action ReaPack: Browse packages... from the Action List. Type API in the window and right-click js_ReaScriptAPI: API functions for ReaScripts. Choose install.
|
|
|
01-03-2019, 10:47 AM
|
#10
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,770
|
Quote:
Originally Posted by Eliseat
Have no idea how to get or install this. So... nope
but thanks.
|
nope is not a word in Reaper. I assume you have SWS installed. Reaper is crippled without it. Well now this amazing community has come up with ReaPack to help with making it much easier to share code for use in Reaper. Want to learn more ?
|
|
|
01-03-2019, 11:10 AM
|
#11
|
Human being with feelings
Join Date: Jan 2010
Posts: 201
|
The emacs of DAWS.
|
|
|
01-03-2019, 11:38 AM
|
#12
|
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
|
This is pretty nice, thanks amagalma.
Also would be cool if it worked in the MIDI Editor as well, to toggle zooming/maximizing of: - CC lane under mouse cursor
- Note view (toggle visibility of all CC lanes) when mouse is over the grid.
- Time selection (as it works in the arrange view, just for continuity)
Also I think there is a small bug (at least it doesn't work the way I expect): zooming of items works based on mouse cursor, but zooming tracks is based on selected track, not what's under the cursor.
Edit: actually I see if an item is selected, it always zooms that rather than the one over the mouse cursor. To me it seems most obvious to always zoom whatever is under the cursor regardless of selection.
Last edited by tack; 01-03-2019 at 11:48 AM.
|
|
|
01-03-2019, 11:47 AM
|
#13
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
I will add zooming for the MIDI editor at some point.
In both cases it works the same: if no items/tracks are selected then it zooms to the item/track under the mouse, else it zooms to the selected ones.
|
|
|
01-03-2019, 11:48 AM
|
#14
|
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
Quote:
Originally Posted by amagalma
Since you see my action, you seem to already have ReaPack. So, run action ReaPack: Browse packages... from the Action List. Type API in the window and right-click js_ReaScriptAPI: API functions for ReaScripts. Choose install.
|
I did this already but for some reason I have no js_ReaScriptApi in my list. So I tried to find a URL to get JulianSanders ReaTeamExtensions URL. (I'm pretty sure this needs added separately.) I have no idea where to find it. And I have no idea what to do with those dll files provided for direct download.
As a female user I wouldn't call me a noob - I have SWS and Reapack installed and use a lot of scripts and extensions - but this is something which I find annoying. I know that this is not anybody's fault as this is kind of a blind spot for more experienced users or programmers. They live inside there own world and know anything about it. But from the outside its sometimes not easy for normal users to solve just simplest tasks which are necessary to run stuff properly.
No offense.
|
|
|
01-03-2019, 11:56 AM
|
#15
|
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
|
Quote:
Originally Posted by amagalma
In both cases it works the same: if no items/tracks are selected then it zooms to the item/track under the mouse, else it zooms to the selected ones.
|
The behaviour was inconsistent for me and took me a while to figure out why, but I think I see it now: in the case of tracks, if no track is selected, it will select the track, and therefore future toggling will always zoom the last track now that it's selected. Meanwhile with MIDI items, they aren't selected upon zooming.
Personally I feel it far more intuitive that the action should always zoom whatever is under the mouse regardless of what's selected, but I'm happy to fork the script locally as it's a pretty easy tweak. Thanks for laying the groundwork! Very handy workflow improvement.
|
|
|
01-03-2019, 12:11 PM
|
#16
|
Human being with feelings
Join Date: Dec 2017
Posts: 302
|
I love smart scripts! Thank you so much amagalma! Just do not quite understand why the master track opens. Is it necessary to calculate the height?
|
|
|
01-03-2019, 12:22 PM
|
#17
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Quote:
Originally Posted by nappies
I love smart scripts! Thank you so much amagalma! Just do not quite understand why the master track opens. Is it necessary to calculate the height?
|
Oh. That's a bug! :S
Quote:
Originally Posted by tack
The behaviour was inconsistent for me and took me a while to figure out why, but I think I see it now: in the case of tracks, if no track is selected, it will select the track, and therefore future toggling will always zoom the last track now that it's selected. Meanwhile with MIDI items, they aren't selected upon zooming.
|
Yes, you are right. This is inconsistent. I will make it so that it does not select the track under the mouse.
Quote:
Originally Posted by Eliseat
I did this already but for some reason I have no js_ReaScriptApi in my list. So I tried to find a URL to get JulianSanders ReaTeamExtensions URL. (I'm pretty sure this needs added separately.) I have no idea where to find it. And I have no idea what to do with those dll files provided for direct download.
|
If you open ReaPack: Manage repositories... do you have this entry? :
https://raw.githubusercontent.com/Re...ster/index.xml
If not, then add it (import repository) and you should be set
|
|
|
01-03-2019, 12:59 PM
|
#18
|
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
Thanks amalgama, after adding the url it works now.
|
|
|
01-03-2019, 01:00 PM
|
#19
|
Human being with feelings
Join Date: Jan 2015
Posts: 794
|
Looks very very promising
Still some bug to me, after trying to zoom in and out tracks/items I got all tracks hidden, no way to get them back anymore... I'll try to replicate more precisely
Again it would be great if you could zoom to item within selection if a selection exists (otherwise the full item will be zoomed). This would be of a great utility!!
For the rest I'm not sure how overing with the mouse works... if you select a give track, even if you over a different track the given track will always be zoomed in and not the one where the mouse is on...
thanks
g
|
|
|
01-03-2019, 01:08 PM
|
#20
|
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
|
Quote:
Originally Posted by Gianfini
Still some bug to me, after trying to zoom in and out tracks/items I got all tracks hidden, no way to get them back anymore... I'll try to replicate more precisely
|
This happened a couple times to me as well. I haven't sussed out how exactly to reproduce it.
|
|
|
01-04-2019, 12:06 AM
|
#21
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Added v1.1 in ReaPack
Changelog:
-- Added initial check for js_ReaScriptAPI extension's presence
-- Fixed Master Track visibility bug
-- Fixed Track under mouse getting selected, when there was no track selection
-- Added debug ability (set in the script)
Guys, about tracks staying hidden.. Could you enable debug in the script (debug = 1) and when the problem occurs, copy and paste here the last 5-6 messages, so that I can reproduce? Thanks!
|
|
|
01-04-2019, 12:25 AM
|
#22
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
Quote:
Originally Posted by JamesPeters
May I suggest: mentioning in the first post of this thread (and also possibly in the ReaPack documentation "about" etc.) that this script requires that API package and perhaps what repo it's in (since if it wasn't in my repo list it's probably not in others' lists as well).
|
Done!
Quote:
Originally Posted by Gianfini
Again it would be great if you could zoom to item within selection if a selection exists (otherwise the full item will be zoomed). This would be of a great utility!!
|
This would just save you one click. You can achieve the same by zooming to items and then running the script over the timeline.
Quote:
For the rest I'm not sure how overing with the mouse works... if you select a give track, even if you over a different track the given track will always be zoomed in and not the one where the mouse is on...
|
Updated the first post with information on how to use.
Last edited by amagalma; 01-04-2019 at 03:27 AM.
|
|
|
01-04-2019, 02:49 AM
|
#23
|
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
Quote:
Originally Posted by amagalma
Done!
Updated the first post with information on how to use.
|
Exemplary!
|
|
|
01-04-2019, 03:31 AM
|
#24
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,770
|
can it zoom / maximize a track and it's open envelope ?
|
|
|
01-04-2019, 03:35 AM
|
#25
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
It maximizes the track as much as possible in order to fit the trackview, while keeping its envelopes open at their original size
|
|
|
01-04-2019, 05:22 AM
|
#26
|
Human being with feelings
Join Date: Jan 2015
Posts: 794
|
Just few suggestions from my side below in CAPITAL LETTERS, to make it even better in my humble opinion.
Use:
1) Assign the action to a hotkey
2) Hover the mouse over a track and press the hotkey: if no tracks are selected, then the track under the mouse gets maximized. If one or more tracks are selected, then these tracks get maximized. Press hotkey again over any track to return to initial TCP view state.
IF ONE OR MORE TRACK IS SELECTED, PRESSING THE HOTKEY SHOULD MAXIMISE IT, REGARDLESS WHETHER THE MOUSE IS OVERING A TRACK, AN ITEM OR NONE OF THE TWO: THE SELECTION WINS
3) Hover mouse over an item and press the hotkey: if no items are selected, then the item under the mouse gets maximized. If one or more items are selected, then these items get maximized. Press hotkey again over any item to return to initial Arrange view state.
SAME AS PER TRACKS +
IMPORTANT: IF A SELECTION EXISTS AND CROSSES THE SELECTED ITEM'S, THE ZOOM SHOULD STICK TO THE SELECTION (+ ITEMS). IF I OVER ON THE TIME SELECTION IT JUST ZOOM THE TIME SELECTION FOR ALL TRACKS AND ITEMS, NO COMBINATION SEEMS POSSIBLE
4) Hover mouse over a region in the region lane and press the hotkey: the region zooms to fill the Arrange view. Press hotkey again over the region in the region lane to return to initial Arrange view state.
5) Hover mouse over Timeline lane and press the hotkey: script zooms to the time selection if any. Press hotkey again over the timeline lane to return to initial Arrange view state.
INTERESTING, BUT ALSO THE ITEM+SELECTION SHOULD BE POSSIBLE SEE POINT 3
6) Hover mouse over an envelope and press the hotkey: envelope maximizes to fill the TCP. Press the hotkey again over the envelope to set to the default envelope size.
THERE SHOULD BE A VIEW WHERE I HAVE HALF SCREEN WITH THE ITEM AND HALF SCREEN WITH THE MAXIMIZED ENVELOPE, BECAUSE WHEN USING ENVELOPE I ALWAYS HAVE TO SEE THE ITEM (E.G. TRANSIENT, ETC.). MAYBE WITH A SECOND CLICK TO HOT KEY IT COULD CYCLE TO THE HALF-ITEM/HALF-ENVELOPE VIEW?
POTENTIAL BUG: WHEN DOING THIS, ANY ITEM SELECTION GET LOST
POTENTIAL BUG: WHEN OVERING OVER THE HEADER OF AN ITEM (I HAVE THE OPTION TO SHOW THE HEADER ABOVE THE ITEM) IT INITIALLY ZOOMS THE TRACK, UPON SECOND HOTKEY PRESS IT SHOWS THE ITEM
ANOTHER THOUGHT, NOT A REAL SUGGESTION HERE: SINCE THE ZOOM HAPPENS TO FILL THE HOW ARRANGE AREA, WHY HIDING THE OTHER TRACKS? ON A COMPLEX PROJECT (SAY 150 TRACKS AND VARIOUS EDITING) IN CASE SOMETHING GOES WRONG WITH THE UN-HIDE IT WOULD ARM THE PROJECT LAYOUT (AS ONE HAS TO REMEMBER WHICH TRACKS WHERE HIDDEN AND UNHIDE MANUALLY THE OTHERS).
YOU MIGHT ZOOM WITHOUT HIDING THE OTHERS MAYBE?
g
|
|
|
01-04-2019, 05:39 AM
|
#27
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,770
|
too much caps lock......did not read.
Is Smart Zoom supposed to hide all the other tracks including master because it does here.
|
|
|
01-04-2019, 06:38 AM
|
#28
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
@Coachz: Yes, it hides everything else. The idea is to be a able to zoom in to any selection of tracks without anything else getting in the way. For example, track 2 is Bass and track 17 is Kick. I can select track 2 & 17 and see them maximized next to each other.
@Gianfini: Thanks for the suggestions. I do not like the idea of "selection wins". I prefer to be able to zoom according to context and have the two axis of zoom independent. Tracks and envelopes affect vertical zooming (trackview). Time selection and regions affect horizontal zooming (arrange view). Items affect both.
The half track, half envelope view is something I had considered in the beginning but there is no need for it since the waveform is already visible in the envelope. So, I prefer it this way, since it gives more resolution for the envelope points.
The reason for hiding other tracks is what I wrote to Coachz.
About the potential bugs: When doing what the item selection is getting lost?
In the second case you mention, I cannot do something because that is the context that the SWS API gives back to the script. The header of the item is considered track area and not item area.
Last edited by amagalma; 01-04-2019 at 06:46 AM.
|
|
|
01-04-2019, 06:43 AM
|
#29
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,770
|
ok that's cool. so how to you unzoom and unhide everything please? This is a great project and thanks so much. Guys like you make this a great community.
|
|
|
01-04-2019, 07:09 AM
|
#30
|
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
The script zooms in (hides) if you start it and zooms out (unhides) if you start is a second time. If there is a bug or something and you don't see your tracks maybe you can get them back visible in the track manager or via script: SWS show all tracks
|
|
|
01-04-2019, 07:14 AM
|
#31
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,770
|
Yeah it doesn't unzoom when I run it again. I'm using tracks in folders so maybe that needs fixing.
|
|
|
01-04-2019, 07:41 AM
|
#32
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
It works correctly here with tracks in folders or folders. Could you please make a licecap and explain the steps for me to reproduce the bug? Thanks!
|
|
|
01-04-2019, 07:42 AM
|
#33
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
I've just uploaded v1.2
Changelog
-- Fixed display correct scroll position when returning from zoom to envelope mode
-- Behavior change: running the script in empty arrange area, it always zooms to the track under mouse (and not the selected ones)
-- Behavior change: running the script over a track in TCP: if selected tracks < 2 then zooms to track under mouse, else to the selected tracks
-- Behavior change: running the script over an item: if selected items < 2 then zooms to item under mouse, else to the selected items
-- Some code optimization
I updated the usage info in the first post.
Last edited by amagalma; 01-04-2019 at 07:49 AM.
|
|
|
01-04-2019, 07:50 AM
|
#34
|
Human being with feelings
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
|
The hiding off all tracks happened while hovering free space of the track panel without any selection. But it seems to be gone in the new version.
Smart zoom is really clever. I like it a lot. Many thanks. Well done!
|
|
|
01-04-2019, 07:58 AM
|
#35
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
|
Thanks amagalma! This is such a brilliant script. This opens up completely new possibilities! I will definitely incorporate this in my workflow.
|
|
|
01-04-2019, 08:07 AM
|
#36
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
For those who have experienced hidden tracks bug (which I have not been able to reproduce), as a safety net you can do this:
1) Make a custom action like the following:
2) Use this one for the zooming and enable debug mode in the script (change to debug = 1 in the script)
Now, in case you come across this bug you can restore your view to the initial by running action SWS: Restore arrange view, slot 5. Then please send me the last 6 messages from your Reascript console so that I can reproduce and fix the bug.
Thanks!
|
|
|
01-04-2019, 08:32 AM
|
#37
|
Human being with feelings
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
|
Thanks for this awesome script !
However, i do experience the hidden tracks bug.
I will do as you told and send you the last 6 from reascript console (sorry, abit in a rush now).
Also i experience that there is no toggle behaviour: hitting the keycommand again with the intention to undo the zoom doesn't work.
Sorry if i missed something but is your script not made as a zoom toggle ?
Warm Regards !
OSX Mojave 10.14.2
Reaper, always latest (pre) release.
Reapack always uptodate, including js ReascriptAPI .
|
|
|
01-04-2019, 08:40 AM
|
#38
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,770
|
Quote:
Originally Posted by amagalma
For those who have experienced hidden tracks bug (which I have not been able to reproduce), as a safety net you can do this:
1) Make a custom action like the following:
2) Use this one for the zooming and enable debug mode in the script (change to debug = 1 in the script)
Now, in case you come across this bug you can restore your view to the initial by running action SWS: Restore arrange view, slot 5. Then please send me the last 6 messages from your Reascript console so that I can reproduce and fix the bug.
Thanks!
|
Here's a project you can test on the currently selected track. Click Download top right.
https://www.dropbox.com/s/yqlsfzlnxk...0Copy.zip?dl=0
|
|
|
01-04-2019, 09:13 AM
|
#39
|
Human being with feelings
Join Date: Apr 2011
Posts: 3,451
|
I can't reproduce..
Could you describe the steps? Or paste the messages in the console here?
|
|
|
01-04-2019, 09:31 AM
|
#40
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,770
|
This is me with focus on track 4 and running the action 3 or four times trying to get back.
|
|
|
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 08:12 AM.
|