Old 11-12-2018, 04:52 AM   #1
SymboliC
Human being with feelings
 
SymboliC's Avatar
 
Join Date: Dec 2013
Location: istanbul
Posts: 193
Default Switching between tracks question

Hi,

When one MIDI editor per project is used and several midi items from different tracks are opened in the editor/notation view, is it possible to quickly switch between/activate tracks by a shortcut?

Currently I'm doing small changes to each track and every time I have to move my mouse to the track list right hand-side and click the curved arrow in order to make the track active to insert new notes or edit the present ones.

It would be nice if a switching is possible between active tracks by a button press. Anyone know a way to make it so?

Thank you,
__________________
...and creativity surrendered to technical difficulties.
SymboliC is offline   Reply With Quote
Old 11-12-2018, 05:10 AM   #2
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Location: Gerbage, Tennessee
Posts: 2,036
Default

Quote:
Originally Posted by SymboliC View Post
Hi,

When one MIDI editor per project is used and several midi items from different tracks are opened in the editor/notation view, is it possible to quickly switch between/activate tracks by a shortcut?

It would be nice if a switching is possible between active tracks by a button press. Anyone know a way to make it so?
my default project starts with 8 channels of midi for melodic instrumentation and a 9th for percussive midi.

the tracks are all set up, and i use the side buttons on my launchpad to switch between them -- single press to switch to that channel/select the track, double press to open the midi on that track, and longpress to show fx chain for that track.

here's my "open midi item" custom action and the script it uses within...

1- sws: show selected track in TCP
2- script 1: create midi item under edit cursor if none exists (NOTE--this assumes you've already selected your intended midi track)
3- Xen/sws - select items under edit cursor on selected track
4- script 2: open midi editor / run midi editor action
5- select all items on track

script 1: create midi item under edit cursor if none exists

Code:
--[[////////////// pLaMuK ///////////////////////////////////
if no item under edit cursor, create midi item.
please contact me on the forums with any improvements.
discussion: http://forum.cockos.com/showthread.php?p=1520818&posted=1#post1520818
//////////////////////////////////////////////////////--]]

--written in LUA. learn REASCRIPT--http://extremraym.com/en/learn-reascript-reaper/
--script v. 1.0
--todo: tempo-calculated item endpoint (X 1/4notes)
--followup script that checks midi item for contents, and if none, deletes it

-- reaper.ShowConsoleMsg(tostring("test").."\n")

function is_edit_cursor_on_item() 
  reaper.Undo_BeginBlock() --Begining of the undo block.
  selected_tracks_count = reaper.CountSelectedTracks(0)
  cursor_pos = reaper.GetCursorPosition() --edit cursor position
  no_edit_cursor = 0 --number of tracks that DON'T contain the edit cursor

  for i = 0, selected_tracks_count-1  do  -- LOOP THROUGH SELECTED TRACKS
    track_sel = reaper.GetSelectedTrack(0, i)
    item_num = reaper.CountTrackMediaItems(track_sel)



    for j = 0, item_num-1 do -- LOOP THROUGH MEDIA ITEMS
      item = reaper.GetTrackMediaItem(track_sel, j)
      start_pos = reaper.GetMediaItemInfo_Value(item, "D_POSITION");
      end_pos = start_pos + reaper.GetMediaItemInfo_Value(item, "D_LENGTH");
     
           
           --now, count how many items don't contain edit cursor:
        if cursor_pos >= start_pos and cursor_pos <= end_pos 
          then --do nothing. consider editing to DELETE item if no midi events counted.     
          else no_edit_cursor = no_edit_cursor + 1
        end --end item count
    end -- ENDLOOP through selected items
  end -- ENDLOOP through selected tracks
  
  if no_edit_cursor == item_num   --- check to see if # of items w/out edit cursor == total
    then reaper.CreateNewMIDIItemInProj(track_sel, cursor_pos, cursor_pos+1)

    reaper.Main_OnCommandEx(reaper.NamedCommandLookup( "_ecc87463a4710b46a8843a0dbe767187"), 0, 0)    
    
  end
  
  reaper.Undo_EndBlock("create midi item under mouse cursor if none exists", 0) 
end

is_edit_cursor_on_item() -- Execute your main function
reaper.UpdateArrange() -- Update the arrangement (often needed)
script 2: open midi editor / run midi editor action (NOTE - comment out anything here you don't need regarding zoom/fold/etc

Code:
function do_actions_from_main_and_midi_sections()
(
   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, 40799); // other midi on track (doesn't work in script)
  //MIDIEditor_OnCommand(active_MIDI_editor, 40452); // show all note rowss40466
  MIDIEditor_OnCommand(active_MIDI_editor, 40453); // hide unused note row
  MIDIEditor_OnCommand(active_MIDI_editor, 40006); // select all events
  MIDIEditor_OnCommand(active_MIDI_editor, 40725); // zoom to selected notes
  MIDIEditor_OnCommand(active_MIDI_editor, 40214); // deselect all
  MIDIEditor_OnCommand(active_MIDI_editor, 40466); // zoom to content    
);

do_actions_from_main_and_midi_sections();
__________________
° using REAPER as host/arranger/sequencer to write instrumental beat music.
° striving for a loop-based, controller-centric midi recording/editing workflow.
° reluctantly switched to using Ableton for live performance and actually enjoying it
mccrabney is online now   Reply With Quote
Old 11-15-2018, 04:41 PM   #3
SymboliC
Human being with feelings
 
SymboliC's Avatar
 
Join Date: Dec 2013
Location: istanbul
Posts: 193
Default

Quote:
Originally Posted by mccrabney View Post
my default project starts with 8 channels of midi for melodic instrumentation and a 9th for percussive midi....
Thank you mccrabney,

While I'm not familiar with scripting in Reaper and not sure if this is the functionality I've been looking for, tomorrow I'll give it a try and see if it does the job for me.

Just to clarify, I've been looking for somthing like this...
Any easier suggestions?




Cheers,
Attached Images
File Type: jpg question.jpg (61.1 KB, 104 views)
__________________
...and creativity surrendered to technical difficulties.
SymboliC 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 11:59 AM.


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