Not sure if this helps, here something I am using for some time, it just zooms to all notes in the item.
Paste into a file 'toggle_midi_editor_and_zoom_to_notes.eel and put into Scripts directory.
PHP Code:
function toggle_midi_editor_and_zoom_to_notes()
(
Main_OnCommand(40716, 0); // Main toggle show midi editor windows
active_MIDI_editor = MIDIEditor_GetActive(); // Now the MIDI editor is opened -> get MIDI editor ID
MIDIEditor_OnCommand(active_MIDI_editor, 40746); // ME action: Edit: Select all notes in time selection
MIDIEditor_OnCommand(active_MIDI_editor, 40725); // ME action: View: Zoom to selected notes/CC
);
toggle_midi_editor_and_zoom_to_notes();
The only problem I remember was the vertical zoom, might not be always perfect, but ok, better than having nothing.
Psst, some secret tip how to bind this action, coming from Jeskola Buzz way of cool mapping, RETURN from pattern edit to sequence edit and RETURN back. In arrange window RETURN will trigger above, here the line if you are using vimper.
PHP Code:
OpenMidiEditor = 40153
['<cr>'] = runAction(OpenMidiEditor)
Then in midi editor RETURN will trigger closing window. Here the line if you are using vimper:
PHP Code:
,['<cr>'] = MidiEditor.runAction(MidiEditor.CloseWindow)
This way you can navigate around in arrange window between items, hitting ENTER for midi editing, hitting ENTER again for leaving editing, back to arrange. Navigate around, ENTER, ENTER... could it be simpler?
Or try this instead:
PHP Code:
function open_in_midi_editor_and_zoom_to_content()
(
Main_OnCommand(40153, 0); // MAIN section action 40153: "open selected item in MIDI editor"
active_MIDI_editor = MIDIEditor_GetActive(); // Now the MIDI editor is opened -> get MIDI editor ID
MIDIEditor_OnCommand(active_MIDI_editor, 40466); // ME action: "zoom to content"
MIDIEditor_OnCommand(active_MIDI_editor, 40468); // ME action: "zoom to one loop iteration"
);
open_in_midi_editor_and_zoom_to_content();