Reaper song markers

I've tested many DAWs but my heart belongs to Reaper. You can do pretty much anything in music production with Reaper. When you miss some function than you can make your own by creating Actions by dropping the sequence of commands in Action window. But sometimes it isn't enough. Luckilly Reaper has its own EEL scripting language and even Python if you feel more comfortable with it.

I've created several scripts in EEL because it feels a little bit faster than Python. Here is a script I've made in EEL that triggers just by pressing keys F2-F7 and inserting song markers: VS1, CH2 and so on. It is counter sensitive - you get VS3 after VS2 or CH4 after CH3.

 


Here you are, change the first two variables and save as for example VERSE.EEL. Then import it to Reaper and assign keybord shortcut...
I tried to comment as much as possible in this script, it might help others to  understand the way script works or just go borrow code like I did.

Change Mainprefix to "BR", find another color and save as BRIDGE.EEL and so on... If you're advanced composer than you could save some as ELISION or ADLIB...

Happy composing!

// Reaper EEL script, created by Denis Sahuric 2016
// Add this script and assign a shortcut in Reaper, for example a key "F6" and you can add verse markers named "VS+number" by simply pressing "F6"
// Make a copy of this script and change main parameters Mainprefix and Maincolor for other shortcuts, example Chorus.

Mainprefix = "CH"; // Change to your own preference...
Maincolor = 0xE9492A; // use PicPick color picker with C++ coding to choose another color

sprintf(firstmarker,  "%s%s", Mainprefix,"1"); // Combines prefix with number 1 for initial marker
      
Main_OnCommand(40898, 0);//Renumber markers
CountProjectMarkers(0, numMarkers, numRegions); // self-explanatory

// If there's no markers at all in project, create the first one:
numMarkers == 0 ? (
  AddProjectMarker2(0, 0, GetCursorPosition(), GetCursorPosition(), firstmarker,0 - 1, Maincolor|0x1000000); // Adds a "VS1" marker at cursor, colour blue
);

// This function is called if there's already 1 or more markers present in your project:
function Add_Nubered_Verse_Markers()
(     
  aa = 1;
  while(numMarkers)(
    EnumProjectMarkers(numMarkers-1, isrgnOut, posOut, rgnendOut, #nameOut, markrgnindexnumberOut);
    sprintf(findthis,  "%s%s", Mainprefix,"*");
      // findthis = "VS*";
      compare = matchi(findthis, #nameOut, dummy);
      compare > 0 ? (
        aa += 1;
        bb = Mainprefix;
        sprintf(#Dee, "%s%.f", bb,aa);
        );
    numMarkers -= 1;
  );
  aa > 1 ? AddProjectMarker2(0, 0, GetCursorPosition(), GetCursorPosition(), #Dee,0 - 1, Maincolor|0x1000000); // Adds a "VS" next marker at cursor, colour blue
  // This one adds the first prefix-based marker because there are 1 or more markers present but with another name:
  aa == 1 ? AddProjectMarker2(0, 0, GetCursorPosition(), GetCursorPosition(), sprintf(#,"%s%s", Mainprefix,"1"),0 - 1, Maincolor|0x1000000); // Adds a "VS1" marker at cursor, colour blue
  Main_OnCommand(40898, 0);//Renumber markers
  UpdateArrange(); // Update the arrangement
);

// Call the function only if marker count is more than null:
numMarkers > 0 ? Add_Nubered_Verse_Markers();

Comments