Creating Keyboard Shortcuts for Vertical Zoom

Help for Audacity on macOS.
Forum rules
ImageThis forum is for Audacity on macOS 10.4 and later.
Please state which version of macOS you are using,
and the exact three-section version number of Audacity from "Audacity menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Post Reply
rcarlberg
Posts: 32
Joined: Sat Nov 10, 2018 1:43 am
Operating System: macOS 10.15 Catalina or later

Creating Keyboard Shortcuts for Vertical Zoom

Post by rcarlberg » Sat Nov 10, 2018 1:53 am

I use Audacity for LP-to-CD conversions, often need to expand the vertical scale to chase small ticks and pops. With Audacity 2.2.1 this was pretty simple -- can't remember if I created a script or it was baked in.

With the new Audacity 2.3.0 I can Control+Click on the vertical scale which brings up a menu for "zoom reset," "zoom x 1/2," "zoom x 2," "half wave," "zoom in" and "zoom out." I would like to add keyboard shortcuts ("control =" for "zoom in" and "control _" for "zoom out"). However the only "zoom" available on the Audacity-Preferences-Keyboard menu appears to be HORIZONTAL zoom -- not VERTICAL zoom.

Can somebody point me in the right direction please.

billw58
Forum Staff
Posts: 5565
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: Creating Keyboard Shortcuts for Vertical Zoom

Post by billw58 » Sat Nov 10, 2018 5:01 am

You're correct that you can't make keyboard shortcuts for those functions.

In 2.3.0 vertical zooming was changed. Default behaviour is the context menu you describe.
If you go to Preferences > Tracks > Track Behaviors and check "Advanced Vertical Zooming" then the old zooming behaviour becomes available.
This "old" behaviour allows you simply right-click in the vertical ruler to zoom in. A few quick clicks should get you where you want. Then a shift-right-click will reset the vertical zoom to zero.

See this page in the manual.

-- Bill

rcarlberg
Posts: 32
Joined: Sat Nov 10, 2018 1:43 am
Operating System: macOS 10.15 Catalina or later

Re: Creating Keyboard Shortcuts for Vertical Zoom

Post by rcarlberg » Sat Nov 10, 2018 4:41 pm

Okay thanks Bill, I'll try that. Seems like an odd omission though -- having to go backwards a version to get "advanced" features(!)

steve
Site Admin
Posts: 80678
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Creating Keyboard Shortcuts for Vertical Zoom

Post by steve » Sat Nov 10, 2018 5:06 pm

rcarlberg wrote:
Sat Nov 10, 2018 4:41 pm
having to go backwards a version to get "advanced" features(!)
You don't have to go back to a different version. You just need to set in Preference, which option you prefer.

In previous versions there was no option - you got "Advanced zooming" whether you liked it or not. A lot of people didn't like it, so Audacity now gives you the option.

As far as I'm aware there have never been keyboard shortcuts for vertical zoom, and personally I don't see benefit in such an option when the "Advanced zoom" provides much better control.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

billw58
Forum Staff
Posts: 5565
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: Creating Keyboard Shortcuts for Vertical Zoom

Post by billw58 » Sat Nov 10, 2018 5:24 pm

steve wrote:
Sat Nov 10, 2018 5:06 pm
personally I don't see benefit in such an option when the "Advanced zoom" provides much better control.
Personally, I'd love an option to get, for example, 16x vertical zoom centered on zero with one keystroke.

-- Bill

steve
Site Admin
Posts: 80678
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Creating Keyboard Shortcuts for Vertical Zoom

Post by steve » Sun Nov 11, 2018 3:43 pm

billw58 wrote:
Sat Nov 10, 2018 5:24 pm
Personally, I'd love an option to get, for example, 16x vertical zoom centered on zero with one keystroke.
I'm so used to using mouse zoom that I'd not really considered that, but on reflection I think that's a good point.

I think that for people that use the "half wave" view, the current options for VZoom are more convenient / easier than having to specify upper and lower bounds, but I'm not keen on duplication. The options that I see are:
  1. Retain the current "VZoom" and add "VZoom Top" and "VZoom Bottom" options, where "VZoom" takes priority if set.
  2. Remove the current "VZoom" option and replace it with "VZoom Top" and "VZoom Bottom".
  3. Leave as it is now.
In both (a) and (b) cases, "VZoom Top" and "VZoom Bottom" take numeric values in the range +/- 2.0.

I'm inclined to go with (a).
Your views?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

billw58
Forum Staff
Posts: 5565
Joined: Wed Aug 12, 2009 2:10 am
Operating System: macOS 10.15 Catalina or later

Re: Creating Keyboard Shortcuts for Vertical Zoom

Post by billw58 » Sun Nov 11, 2018 3:59 pm

If we're talking about the Set Track Visuals scriptable, I'd like to see "Zoom In" and "Zoom Out" added. If I want 16x zoom in, I'd call it 4 times in a macro.

I, too, am really used to the "old, advanced" zooming, but it always annoyed me that I had to keep my mouse pointer as close as possible to the zero mark to keep the waveform centered on zero. A Zoom In command that kept the waveform centered would suit me just fine.

-- Bill

steve
Site Admin
Posts: 80678
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Creating Keyboard Shortcuts for Vertical Zoom

Post by steve » Mon Nov 12, 2018 9:18 am

I've added "VZoom Top" and "VZoom Bottom" to the "Set Track Visuals" macro command, so in the next version of Audacity you will be able to create a macro with any zoom level for "selected wave tracks" within Audacity's supported range.
The supported range is:
Maximum vertical zoom = VZoomTop - VZoomBottom = 0.001
Maximum VZoom Top = 2.0
Minimum VZoom Bottom = -2.0

So, for example, to create a macro that zooms in close around the centre line, you could (for example) create a macro with "Set Track Visuals" and set "VZoom Top = 0.1" and "VZoom Bottom = -0.1".

More complex behaviour (such as zooming in/out by a factor of 4 or more or less) can be achieved via Nyquist plug-ins.
Here's a couple of example plug-ins that work with the current "alpha" code (so should work in the next Audacity release) that zoom in/out vertically on all selected tracks by a factor of 2.
vzoomin.ny
(1.08 KiB) Downloaded 10 times
vzoomout.ny
(1022 Bytes) Downloaded 9 times
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply