View Single Post
Old 11-01-2017, 05:30 AM   #88
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,031
Default

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(407160); // 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_editor40746); // ME action: Edit: Select all notes in time selection
  
MIDIEditor_OnCommand(active_MIDI_editor40725); // 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(401530); // 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_editor40466); // ME action: "zoom to content" 
  
MIDIEditor_OnCommand(active_MIDI_editor40468); // ME action: "zoom to one loop iteration"
);

open_in_midi_editor_and_zoom_to_content(); 

Last edited by TonE; 11-01-2017 at 02:12 PM. Reason: better colors using php instead of code
TonE is offline   Reply With Quote