|
|
|
05-10-2019, 02:15 PM
|
#1
|
Human being with feelings
Join Date: Jul 2008
Location: Putnam County, NY, USA
Posts: 3,950
|
Reposition/move a region
Hi-
I can reposition a marker using the "Markers: Add/move marker 1 to play/edit cursor" action. With AutoHotkey, I can use SendMessage,0x0111,40657,0,,ahk_class REAPERwnd.
I need to be able to reposition a region (without contents) similarly so the start is at the play/edit cursor.
I didn't see anything in the Action List or ReaPack that addressed this, but if I missed it please let me know.
Thanks!
-Susan
|
|
|
05-11-2019, 03:49 AM
|
#2
|
Human being with feelings
Join Date: Sep 2014
Posts: 2,643
|
Have a look in the ReaTrak scripts, there's one for copy selected regions and one for paste.
There's also a function in the chord sheet and circle of fifths to copy and paste regions with or without items. Once you have copied and pasted the regions you can delete the old.
https://forum.cockos.com/showthread.php?t=212645
EDIT:
ReaTrak Copy project markers and regions in time selection.lua
ReaTrak Paste project markers and regions at edit cursor.lua
https://forum.cockos.com/showthread.php?t=201983#8
Last edited by MusoBob; 05-11-2019 at 03:58 AM.
|
|
|
05-11-2019, 07:17 AM
|
#3
|
Human being with feelings
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
|
sounds like it would be a good idea to put those region scripts up to ReaPack as thier own things... yes? Especially the one that will move a region without the contents. Please?
|
|
|
05-11-2019, 08:53 AM
|
#4
|
Human being with feelings
Join Date: Jul 2008
Location: Putnam County, NY, USA
Posts: 3,950
|
Quote:
Originally Posted by MusoBob
Have a look in the ReaTrak scripts, there's one for copy selected regions and one for paste.
There's also a function in the chord sheet and circle of fifths to copy and paste regions with or without items. Once you have copied and pasted the regions you can delete the old.
https://forum.cockos.com/showthread.php?t=212645
EDIT:
ReaTrak Copy project markers and regions in time selection.lua
ReaTrak Paste project markers and regions at edit cursor.lua
https://forum.cockos.com/showthread.php?t=201983#8
|
Those look handy, but wouldn't work for my purpose.
I want the region in question moved so it starts where my cursor is, i.e. just the way the Move Marker works except with a region instead. I don't want to have to change the time selection to select the region first; that would defeat the purpose. In fact, anything that's not as fast as Move Marker wouldn't be worth it.
Thanks!
-Susan
|
|
|
05-11-2019, 01:31 PM
|
#5
|
Human being with feelings
Join Date: Sep 2014
Posts: 2,643
|
Quote:
Originally Posted by hopi
sounds like it would be a good idea to put those region scripts up to ReaPack as thier own things... yes? Especially the one that will move a region without the contents. Please?
|
You could modify it to move the region number to the cursor position,
or create a new script to get the length and color of the region number in a user input prompt, delete that region then create a new region at the cursor position.
|
|
|
05-11-2019, 01:44 PM
|
#6
|
Human being with feelings
Join Date: Jun 2012
Location: Spain
Posts: 7,268
|
Quote:
Originally Posted by Susan G
Hi-
I can reposition a marker using the "Markers: Add/move marker 1 to play/edit cursor" action. With AutoHotkey, I can use SendMessage,0x0111,40657,0,,ahk_class REAPERwnd.
I need to be able to reposition a region (without contents) similarly so the start is at the play/edit cursor.
I didn't see anything in the Action List or ReaPack that addressed this, but if I missed it please let me know.
Thanks!
-Susan
|
Hi Susan,
you can just drag the region with ALT key. This won't move contents.
But to automatically position the start to edit cursor, would require a small script I think. But how to tell the script which region do you want to move? I think it is better to just ALT drag the region with snap enabled.
|
|
|
05-11-2019, 01:59 PM
|
#7
|
Human being with feelings
Join Date: Sep 2014
Posts: 2,643
|
This works but you need to enter the region number
Code:
retval_region,region_number = reaper.GetUserInputs("Region To Move", 1, "Enter Region Number", "")
if not retval_region then goto finish end
retval, isrgn, rgnpos, rgnend, name, markrgnindexnumber, color = reaper.EnumProjectMarkers3(0, region_number-1)
length = (rgnend-rgnpos)
reaper.DeleteProjectMarker(0, region_number, true)
cur_pos = reaper.GetCursorPosition()
reaper.AddProjectMarker2( 0, true, cur_pos, cur_pos+length, name, -1, color )
::finish::
Last edited by MusoBob; 05-11-2019 at 02:16 PM.
|
|
|
05-11-2019, 02:54 PM
|
#8
|
Human being with feelings
Join Date: Jul 2008
Location: Putnam County, NY, USA
Posts: 3,950
|
Quote:
Originally Posted by heda
Hi Susan,
you can just drag the region with ALT key. This won't move contents.
But to automatically position the start to edit cursor, would require a small script I think. But how to tell the script which region do you want to move? I think it is better to just ALT drag the region with snap enabled.
|
Dragging wouldn't work because I don't want to leave my current cursor position and time selection.
I've already assigned the region a fixed number, so it can be referenced in a script.
Thanks-
-Susan
|
|
|
05-11-2019, 07:03 PM
|
#9
|
Human being with feelings
Join Date: Jul 2008
Location: Putnam County, NY, USA
Posts: 3,950
|
Quote:
Originally Posted by MusoBob
This works but you need to enter the region number
Code:
retval_region,region_number = reaper.GetUserInputs("Region To Move", 1, "Enter Region Number", "")
if not retval_region then goto finish end
retval, isrgn, rgnpos, rgnend, name, markrgnindexnumber, color = reaper.EnumProjectMarkers3(0, region_number-1)
length = (rgnend-rgnpos)
reaper.DeleteProjectMarker(0, region_number, true)
cur_pos = reaper.GetCursorPosition()
reaper.AddProjectMarker2( 0, true, cur_pos, cur_pos+length, name, -1, color )
::finish::
|
Thanks for this. I'll keep fiddling with it, but I couldn't get it to work. The region I want to move is number 100, which is greater than the last actual region number in the project. Maybe that's part of the problem, but even when I used other numbers, the length of the region was always zero, and neither the name nor color came along.
I want to move Region #100 (or any other fixed number,) which is always 5 seconds long, to the current cursor position without changing the current time selection or cursor position.
Frustrating, because Move Marker works perfectly, so I wish for a Move Region!
Thanks again-
-Susan
|
|
|
05-11-2019, 08:44 PM
|
#10
|
Human being with feelings
Join Date: Sep 2014
Posts: 2,643
|
Try this
Code:
retval_region,region_number = reaper.GetUserInputs("Region To Move", 1, "Enter Region Number", "")
if not retval_region then goto finish end
retval, num_markers, num_regions = reaper.CountProjectMarkers(0)
for i = 0 , num_regions -1 do
retval, isrng, pos, rgnend, name, markrgnindexnumber, color = reaper.EnumProjectMarkers3(0, i)
if tonumber(markrgnindexnumber) == tonumber(region_number) then
length = (rgnend-pos)
reaper.DeleteProjectMarker(0, markrgnindexnumber, true)
cur_pos = reaper.GetCursorPosition()
reaper.AddProjectMarker2( 0, true, cur_pos, cur_pos+length, name, region_number, color )
end
end
::finish::
|
|
|
05-12-2019, 09:06 AM
|
#11
|
Human being with feelings
Join Date: Oct 2008
Location: Right Hear
Posts: 15,618
|
Thanks Bob... that works nicely!
|
|
|
05-14-2019, 11:30 AM
|
#12
|
Human being with feelings
Join Date: Jul 2008
Location: Putnam County, NY, USA
Posts: 3,950
|
Quote:
Originally Posted by MusoBob
Try this
|
Hi MusoBob-
This works great, thanks!
Note to self, mostly:
I wanted to use a constant for the region number so the script wouldn't require any input. REAPER allows you to set the Region ID manually and originally I'd chosen 100 arbitrarily for my 5 sec Region ID (the one that gets moved.) Once I realized the ID had to be within the index range of the regions in the project, I changed the ID so that it was & the script works like a charm.
This will save me quite a bit of time. Thanks very much again!
-Susan
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 03:46 AM.
|