Old 06-17-2016, 09:48 AM   #1
JayJSE2
Human being with feelings
 
JayJSE2's Avatar
 
Join Date: Feb 2014
Posts: 310
Default Creating regions with preset names?

There's probably a very easy way to do this, but I can't seem to find a way of creating shortcuts to create and name song sections as regions (like 'intro', 'verse', 'chorus' etc.) from a time selection. The closest I can get is using "insert region from time selection and edit", but then I still have to manually enter the name.

Can anyone help?
JayJSE2 is offline   Reply With Quote
Old 06-17-2016, 01:01 PM   #2
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Here's a simple Lua script for that:

(Actually there are three versions of this same script - save as scriptname.lua -> load from the action list -> add shortcut keys)

Create region (name=intro).lua
Code:
function create_region(region_name)
  local color = 0
  local ts_start, ts_end = reaper.GetSet_LoopTimeRange(false, false, 0, 0, false)
  if ts_start == ts_end then return end
  reaper.AddProjectMarker2(0, true, ts_start, ts_end, region_name, -1, color)
  reaper.Undo_OnStateChangeEx("Create region with predefined name", -1, -1)
end

create_region("intro")
Create region (name=verse).lua
Code:
function create_region(region_name)
  local color = 0
  local ts_start, ts_end = reaper.GetSet_LoopTimeRange(false, false, 0, 0, false)
  if ts_start == ts_end then return end
  reaper.AddProjectMarker2(0, true, ts_start, ts_end, region_name, -1, color)
  reaper.Undo_OnStateChangeEx("Create region with predefined name", -1, -1)
end

create_region("verse")
Create region (name=chorus).lua
Code:
function create_region(region_name)
  local color = 0
  local ts_start, ts_end = reaper.GetSet_LoopTimeRange(false, false, 0, 0, false)
  if ts_start == ts_end then return end
  reaper.AddProjectMarker2(0, true, ts_start, ts_end, region_name, -1, color)
  reaper.Undo_OnStateChangeEx("Create region with predefined name", -1, -1)
end

create_region("chorus")
spk77 is offline   Reply With Quote
Old 06-17-2016, 01:59 PM   #3
JayJSE2
Human being with feelings
 
JayJSE2's Avatar
 
Join Date: Feb 2014
Posts: 310
Default

Great, thanks!

Still, it seems odd that even with all the stuff that reaper can do out of the box (and even with SWS), this isn't included as a proper feature.
JayJSE2 is offline   Reply With Quote
Old 06-19-2018, 02:58 PM   #4
ValourWinds
Human being with feelings
 
Join Date: Jul 2016
Posts: 40
Default

Where would I download this script from?
ValourWinds 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 01:57 AM.


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