Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Q&A, Tips, Tricks and Howto

Reply
 
Thread Tools Display Modes
Old 03-17-2017, 12:36 PM   #1
Swamp Ape
Human being with feelings
 
Swamp Ape's Avatar
 
Join Date: Mar 2012
Location: Asheville NC
Posts: 1,335
Default Trying to build a "create regions between markers" action

I have a long, continuous piece of music that I want to break up into tracks. I want to drop markers where I want tracks to stop and start, then automatically create regions between them. Is there an action that does this, or one I can build myself?
Swamp Ape is offline   Reply With Quote
Old 03-17-2017, 02:06 PM   #2
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 5,247
Default

When u have SWS extensions installed, then you have this Action:
"SWS: Convert markers to regions"

Sufficient enough or .. ?
__________________
Macbook Pro INTEL | Reaper, always latest version | OSX Ventura | Presonus Studio 24c
My Reaper Tips&Tricks YouTube Channel: https://www.youtube.com/user/vanhaze2000/playlists
vanhaze is offline   Reply With Quote
Old 03-17-2017, 08:45 PM   #3
Swamp Ape
Human being with feelings
 
Swamp Ape's Avatar
 
Join Date: Mar 2012
Location: Asheville NC
Posts: 1,335
Default

Thanks, I do. Don't know how I missed that...
Swamp Ape is offline   Reply With Quote
Old 03-20-2017, 03:40 PM   #4
sasa
Human being with feelings
 
Join Date: Sep 2008
Posts: 2
Default Create regions from markers with name

Quote:
Originally Posted by Swamp Ape View Post
I have a long, continuous piece of music that I want to break up into tracks. I want to drop markers where I want tracks to stop and start, then automatically create regions between them. Is there an action that does this, or one I can build myself?
Splitting large concert to numbered regions with song name:
1. Insert markers with song name to starting position of each song you want to render
2. If there is some unwanted material, insert markers without name to the starting position of each portion of unwanted material, typically at the end of song
3. Use script to add regions
4. Render songs using region wildcards

=====
5. Download script "Named_Markers_to_Regions.lua" into folder of your choice (..\reaper\scripts\)
6. Load script into Reaper/Actions, add keyboard shortcut of your choice (Alt-F7)
Attached Files
File Type: lua Named_Markers_to_Regions.lua (2.8 KB, 361 views)

Last edited by sasa; 03-22-2017 at 03:22 AM. Reason: New version of attached script
sasa is offline   Reply With Quote
Old 03-20-2017, 06:41 PM   #5
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,937
Default

There's also "Insert regions at markers and vice versa in time selection" in the ReaTeam Scripts repository which keeps the initial markers, affects only the time selection and works in both directions.
cfillion is offline   Reply With Quote
Old 03-22-2017, 04:00 AM   #6
sasa
Human being with feelings
 
Join Date: Sep 2008
Posts: 2
Default Very useful repository

Quote:
Originally Posted by cfillion View Post
There's also "Insert regions at markers and vice versa in time selection" in the ReaTeam Scripts repository which keeps the initial markers, affects only the time selection and works in both directions.
Thanks for maintaining scripts in repository. Tons of useful and interesting things.

I would be happy if there was my script included. It differentiates between named and unnamed markers. Creates regions from named markers only, giving them consecutive numbering.
sasa is offline   Reply With Quote
Old 03-21-2018, 12:50 PM   #7
lexaproductions
Human being with feelings
 
Join Date: Jan 2013
Posts: 1,126
Default

Quote:
Originally Posted by sasa View Post
Splitting large concert to numbered regions with song name:
1. Insert markers with song name to starting position of each song you want to render
2. If there is some unwanted material, insert markers without name to the starting position of each portion of unwanted material, typically at the end of song
3. Use script to add regions
4. Render songs using region wildcards

=====
5. Download script "Named_Markers_to_Regions.lua" into folder of your choice (..\reaper\scripts\)
6. Load script into Reaper/Actions, add keyboard shortcut of your choice (Alt-F7)
Hi Sasa.
I'm trying to get this very action but that would ignore "Action Markers" (Markers that starts with "!"). You know how to mod your script to do it?
lexaproductions is offline   Reply With Quote
Old 11-19-2019, 04:59 AM   #8
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 1,180
Default

Quote:
Originally Posted by cfillion View Post
There's also "Insert regions at markers and vice versa in time selection" in the ReaTeam Scripts repository which keeps the initial markers, affects only the time selection and works in both directions.
Hi cfillion

Is there a simple way to mod this script so that when creating a region it only takes the first marker as a reference and ignores subsequent markers (creating one region the length of the whole time selection) ?
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is offline   Reply With Quote
Old 11-19-2019, 05:10 PM   #9
Triode
Human being with feelings
 
Triode's Avatar
 
Join Date: Jan 2012
Posts: 1,180
Default

I've done two small hacky edits that seem to have served my purpose. I often create a marker with a section's name without knowing where the end point is yet. I then find that the end point is beyond other markers. This version of the script comes in handy for me when I then want to quickly change that one marker into a region defined by the length of the time selection by a quick modified double click in the ruler. Small pleasures

I'll still use the original script on a menu no doubt
Thank you

Code:
reaper.Undo_BeginBlock()

local UNDO_STATE_MISCCFG = 8

local next_index, boundaries, last_marker = 0, {}, 0
local ts_from, ts_to = reaper.GetSet_LoopTimeRange(false, false, 0, 0, false)

while true do
  -- marker = {retval, isrgn, pos, rgnend, name, markrgnindexnumber, color}
  local marker = {reaper.EnumProjectMarkers3(0, next_index)}

  next_index = marker[1]
  if next_index == 0 then break end

  if not marker[2] then -- it's not a region
    if boundaries[last_marker] then
      boundaries[last_marker].to = marker[3]
    end

    last_marker = #boundaries + 1 -- commenting this out skips up to one marker
  end

  boundaries[#boundaries + 1] = {isregion=marker[2], from=marker[3],
    to=marker[4], name=marker[5], id=marker[6], color=marker[7]}
end

local function exists(match)
  for _,boundary in ipairs(boundaries) do
    if boundary ~= match and boundary.from == match.from then
      return true
    end
  end

  return false
end

for _,boundary in ipairs(boundaries) do
  local withinTS = ts_to == 0 or (boundary.from == ts_from and boundary.to <= ts_to)
  if boundary.to > 0 and withinTS and not exists(boundary) then
    reaper.AddProjectMarker2(0, not boundary.isregion, boundary.from,
      ts_to, boundary.name, boundary.id, boundary.color)
  end
end

reaper.Undo_EndBlock('Insert regions at markers and vice versa in time selection', UNDO_STATE_MISCCFG)
__________________
Mixing / Brush and Beater Drums Online: www.outoftheboxsounds.com
Triode is offline   Reply With Quote
Old 10-30-2023, 05:08 AM   #10
Kolja
Human being with feelings
 
Join Date: Mar 2021
Posts: 4
Default Regions made of specific markers

Hi there,

is there a possibility to make regions from specific markers? I’ll give you example:

I have an audio book with many markers. Some of them marks starts and ends of chpaters (M1 and M10 for example), some of them marks mistakes etc. (M2-M9 for example). I want to make region between M1 and M10 but still want to maintain M2-M9. I know I could do this with time selection but Im searching for a way how to do that in region marker manager or something like that (just easier way). I thaught to myself that answer could be somewhere in SWS extension. Could you help me?

Thank you very much
Kolja 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 07:01 PM.


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