Old 09-11-2019, 03:57 AM   #1
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,721
Default New Script: Inline Midi Editor toggle per track

Hi gang,

UPDATED 2019-09-11: Made it for all selected tracks and added undo code blocks.

I find it tedious to select items I want to inline edit... or just see in a piano roll format on the main arrange screen. So I wrote a script that toggles the entire selected track (first selected) to Inline Edit mode. Much less fiddly than current implementations.

Here it is in action. You can also apply the script to multiple tracks by selecting different tracks as you go... and copy/paste MIDI between them by using the cursor and track selection. If you think it would be more valuable to do inline edit for ALL selected tracks at once, I can update it. Let me know.



Here is the code:

Code:
--[[
Script: AK Track Inline Edit toggle (maintain selected items).lua
Written by Thonex
v1.1

updated to apply to all selected tracksand added undo code blocks
--]]

function TOGGLE_TRACK_INLINE_EDIT ()
  reaper.PreventUIRefresh(1)
  reaper.Undo_BeginBlock()

----- log originally selected items ------

  orig_sel_item = {}
  orig_sel_tracks = {}
  trk_item = {}

  num_selected_items =  reaper.CountSelectedMediaItems( 0 )
  num_selected_tracks =  reaper.CountSelectedTracks( 0 )

  for i=0, num_selected_items-1 do
      orig_sel_item [i] =  reaper.GetSelectedMediaItem( 0, i )
  end
  reaper.SelectAllMediaItems(0, 0 ) -- deselect all items on project now that all orig selected items are logged
   
----- select all item on selected tracks  ------  

  for ii = 0, num_selected_tracks-1 do

      track = reaper.GetSelectedTrack( 0, ii )
      num_item_trk = reaper.CountTrackMediaItems( track )

      for i=0, num_item_trk-1 do
          trk_item [i] =  reaper.GetTrackMediaItem( track, i )
          reaper.SetMediaItemSelected( trk_item [i], 1 )
      end
  end
 toggle_inline = reaper.NamedCommandLookup( "_RS8990ef30b1d78ba18e5e3423352dc632f43aa723"  )-- Script: me2beats_Toggle open items inline editors.lua
 reaper.Main_OnCommand(toggle_inline,0) -- Script: me2beats_Toggle open items inline editors.lua 
  
----- reset selection state to initial state ------ 

  reaper.SelectAllMediaItems(0, 0 )
  
  for i=0, num_selected_items-1 do
      orig_sel_item [i] =  reaper.SetMediaItemSelected( orig_sel_item [i], 1 )
  end

  reaper.PreventUIRefresh(-1) 
  reaper.Undo_EndBlock("Toggle tracks inline editor state",-1)

end

TOGGLE_TRACK_INLINE_EDIT ()
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 • Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.

Last edited by Thonex; 09-13-2019 at 02:20 PM.
Thonex is offline   Reply With Quote
Old 09-11-2019, 07:32 AM   #2
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
Default

Hi, thanks for this script... and YES ... I do think it makes more sense to have it work on all selected tracks

I hope you will update to that or give us the code to add...

that way if we only have one track selected it still works fine but with a few selected it would catch them all and let us Inline Edit between them
more easily...

thanks again!
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi is offline   Reply With Quote
Old 09-11-2019, 08:11 AM   #3
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,721
Default

Quote:
Originally Posted by hopi View Post
Hi, thanks for this script... and YES ... I do think it makes more sense to have it work on all selected tracks

I hope you will update to that or give us the code to add...

that way if we only have one track selected it still works fine but with a few selected it would catch them all and let us Inline Edit between them
more easily...

thanks again!
Sure.

Ok...will add later today and will bump the post and update the OP.
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 • Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.
Thonex is offline   Reply With Quote
Old 09-11-2019, 10:26 AM   #4
Thonex
Human being with feelings
 
Join Date: May 2018
Location: Los Angeles
Posts: 1,721
Default

UPDATED 2019-09-11: Made it for all selected tracks and added undo code blocks.
__________________
Cheers... Andrew K
Reaper v6.80+dev0621 - June 21 2023 • Catalina • Mac Mini 2020 6 core i7 • 64GB RAM • OS: Catalina • 4K monitor • RME RayDAT card with Sync Card and extended Light Pipe.
Thonex is offline   Reply With Quote
Old 09-12-2019, 09:25 PM   #5
Ozman
Human being with feelings
 
Join Date: Feb 2015
Posts: 755
Default

This needs to be be added to a ReaPack.
Ozman is offline   Reply With Quote
Old 09-13-2019, 12:04 PM   #6
hopi
Human being with feelings
 
hopi's Avatar
 
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
Default

Thanks much update works great and makes perfect sense to me...

i.e., IF we only want to work on one track we just select only that track
__________________
...should be fixed for the next build... http://tinyurl.com/cr7o7yl
https://soundcloud.com/hopikiva
hopi is offline   Reply With Quote
Old 01-17-2020, 07:49 PM   #7
PointReyes
Human being with feelings
 
Join Date: Jan 2016
Posts: 164
Default

Thank you for this much needed script. For some reason it doesn't do anything when I use it, though. I select a track or multiple tracks and hit the assigned key (also tried it directly from the Actions page), but unfortunately nothing happens. Would there be something obvious that I missing? This is on Reaper 6.
__________________
Latest Reaper 6. Mac Pro trashcan 6-core 3.7gHz; 32g RAM; all SSD drives for system, audio, and (3 drives) samples; the most current OS X version; Apollo 8 2nd Gen interface
PointReyes is offline   Reply With Quote
Old 01-17-2020, 08:12 PM   #8
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,968
Default

The script above requires another script to be installed at a specific location to work properly: "Toggle open items inline editors" by me2beats.

Assuming you have ReaPack:
  1. Copy/paste the following URL in Extensions > ReaPack > Import repositories to enable me2beats's script repository:
    Code:
    https://github.com/me2beats/reapack/raw/master/index.xml
  2. Search for "Toggle open items inline editors" in Extensions > ReaPack > Browse packages
  3. Right click on it and choose Install, then click on OK

EDIT: me2beat's script requires the SWS extension to be installed as well.

Last edited by cfillion; 01-17-2020 at 08:21 PM.
cfillion is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:35 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.