Advanced MIDI Editing in REAPER, Part 3 - Zoom Control

For many users (myself included), the native zoom functionality in REAPER's MIDI Editor can lead to a lot of needless resizing and scrolling and leaves a lot to be desired. If you also find yourself frustrated with zooming in the MIDI Editor, you're in luck! A talented scripter by the name of Feed The Cat (FTC) has created a suite of zooming scripts titled “MIDI Editor Magic” that allow the user to fine tune the MIDI Editor’s zooming functions to exactly what they need. I prefer to use it to manage contextual zooming to multiple item selections, like so:

However, this is only one of many ways the script can be employed. Read on to learn how you can configure it to your liking.

This guide assumes you've gone through Part 1 of this series.


ME Magic contains three “modules”:

  1. An all-in-one function that executes different zooming behaviors depending on where the mouse cursor is.
  2. A bundle of individual actions that are designed to execute specific vertical/horizontal zoom behavior when run.
  3. Two actions that are designed to handle zooming specifically when multiple MIDI items are selected.

These can be used individually or in any combination you like. To begin, we’ll cover how to set up and use each module. Afterwards, we’ll cover how to customize it all to do exactly what you want.


MODULE ONE


Open the Preferences window (default: Ctrl-P) and navigate to the following:

Click on the “Action list…” option at the bottom of the dropdown. Locate the “Script: FTC_MeMagic.lua” action and assign it. Assign the same action for the Default action in the “left click” behavior for Context: Media item.

We’ve now enabled the script to work when you double click or single click on a MIDI Item. This will not break or overwrite how REAPER handles double or single clicking on any other kind of item on the timeline. Note that you do not have to use these mouse modifiers for the script to work; they just add functionality.

Finally, open the Actions List and assign a keyboard shortcut to “Script: FTC_MeMagic.lua”. I’ve assigned mine to ‘Z’ for “(Z)oom”. Be sure to select “Global” in the Scope dropdown or the script won’t work correctly:

And we’re all set up! Double clicking a MIDI Item will now open it in the MIDI Editor and smart zoom to its contents (more on customizing this behavior later), while single clicking will smart zoom to its contents in an already open editor.

Additionally, pressing the hotkey we assigned while the mouse is in different areas will trigger different kinds of zooming. The context-sensitive areas are:

  • MIDI Editor Note Area (the grid)
  • MIDI Editor Piano Pane (where you see the vertically stacked piano keys)
  • MIDI Editor Ruler
  • MIDI Editor CC lanes
  • Arrange View Area

Try pressing the assigned hotkey in those areas. Furthermore, try holding it down while moving the mouse around in the note area/grid.


MODULE TWO


You might not want an entire suite of context-sensitive zooming actions and instead want some specific behaviors that you might access via toolbar or hotkey. If this is the case, MIDI Editor Magic also comes with a big list of individually assignable zoom behaviors. 

If you open the Actions List and type “FTC” in the filter you’ll very easily see this list. It begins with “Script: FTC_MeMagic (1-2) Vertically zoom to notes in visible area.lua” and extends quite a ways.

Simply assign these actions as needed to whatever you want and you’re good to go! Note that in order for any of these individual scripts to work you will need to have the main FTC_MeMagic.lua script installed.


MODULE THREE


If you want the MIDI Editor to be able to smart zoom in on multiple MIDI items then set everything up just like you did with Module One, but use “Script: FTC_Multi edit scroll.lua” or “Script: FTC_Multi edit zoom.lua” instead of “Script: FTC_MeMagic.lua”. These can be assigned to mouse modifiers, hotkeys, or both.

  • Multi edit zoom will zoom in to fit all selected items both vertically and horizontally.
  • Multi edit scroll will zoom in to fit all selected items horizontally only and will vertically scroll to the center of all selected item’s notes. (This is useful if you want to maintain a consistent vertical zoom level while editing).

Remember to change the scope of whatever shortcut you assign to “Global”.


CUSTOMIZATION


FTC designed these scripts to be extremely customizable by the user. To do so, find the script you’d like to customize in the Actions List, right click on it, and select “Edit selected custom action/Reascript”. The ReaScript Development Window will open, along with the script’s code.

Don’t worry, no scripting is required on our part! All we have to do is edit text in the appropriate fields.  FTC has done an excellent job labeling and describing what everything means, so read the commentary in the script itself to find out what to change and how.

Once you’ve made all the changes you want, press Ctrl-S to save the script and then close out of the development window.  Keep in mind that this overwrites the script, so if you want to revert to “factory settings”, either keep track of them or - if you can’t remember them - re-install the script via ReaPack.


Part 1 - Set Up
Part 2 - Editing Tools
Part 3 - Zoom Control ← Thou art here
Part 4 - CC Lane Management

If you find this collection of scripts useful, please consider donating to FTC here to support him and his valuable work. If you have a bug report or feature request (or just want to say thank you) for this script, visit the official forum thread.

If you're looking for more scripts beyond those mentioned in this series, I maintain a Google Sheet Database of MIDI-related ReaScripts

The theme I'm using in the screenshots and GIFs is the Reapertips Theme