Old 03-30-2021, 05:18 PM   #361
Egxon
Human being with feelings
 
Join Date: Feb 2021
Posts: 10
Default

Quote:
Originally Posted by mccrabney View Post
^ edgemeal posted a snippet that does this here

https://forum.cockos.com/showthread.php?t=251499
thank you very much
Egxon is offline   Reply With Quote
Old 03-31-2021, 04:01 AM   #362
mikavarto
Human being with feelings
 
Join Date: Mar 2021
Posts: 1
Default

Quote:
Originally Posted by sonictim View Post
I'm having trouble with your razor fade tool (Pro tools kind of fade). It works perfectly when I don't have time selection, but if I have a time selection then it creates fades in every item in that time selection. I guess this is not the way it's supposed to work?
mikavarto is offline   Reply With Quote
Old 03-31-2021, 07:17 AM   #363
Egxon
Human being with feelings
 
Join Date: Feb 2021
Posts: 10
Default Insert midi Item at Razor edit area

Insert midi Item at Razor edit area---does anyone have this script thank you.
Egxon is offline   Reply With Quote
Old 03-31-2021, 08:13 AM   #364
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,913
Default

Quote:
Originally Posted by Egxon View Post
Insert midi Item at Razor edit area---does anyone have this script thank you.
If you launch the "Insert new MIDI item" action REAPER adds a new MIDI item to each Razor Edit area.

You can call that action from script,...
Code:
reaper.Main_OnCommand(40214, 0) -- Insert new MIDI item...
Edgemeal is offline   Reply With Quote
Old 03-31-2021, 08:54 AM   #365
Egxon
Human being with feelings
 
Join Date: Feb 2021
Posts: 10
Default

Quote:
Originally Posted by Edgemeal View Post
If you launch the "Insert new MIDI item" action REAPER adds a new MIDI item to each Razor Edit area.

You can call that action from script,...
Code:
reaper.Main_OnCommand(40214, 0) -- Insert new MIDI item...
that worked thank you very much
Egxon is offline   Reply With Quote
Old 03-31-2021, 10:03 AM   #366
ferropop
Human being with feelings
 
ferropop's Avatar
 
Join Date: Jan 2016
Location: Los Angeles, CA
Posts: 3,116
Default

JulianSader:

Would you consider allowing your MultiTool to automatically zoom to the necessary level to get all the functionality? Very often you make a selection and it will only give the limited set of functions because it's not zoomed in enough. If you then zoom in, the selection disappears and you have to redo the whole process.

It just gets in the way of smooth operation, and seems like an easy fix so I thought I'd bring it up!
ferropop is offline   Reply With Quote
Old 04-01-2021, 06:15 AM   #367
Egxon
Human being with feelings
 
Join Date: Feb 2021
Posts: 10
Default No fade in/out when copying or duplicating items under razor edit

the fade in and out is there only if the item copied/duplicated item has them already in it otherwis if i try to copy/duplicate the middle of item the fades are gone.
Egxon is offline   Reply With Quote
Old 04-01-2021, 08:27 AM   #368
benmrx
Human being with feelings
 
benmrx's Avatar
 
Join Date: Aug 2010
Posts: 396
Default

Any of the fine people here have a script that will automatically select tracks with razor edit areas? I saw a script that will select all tracks with Razor edits, but I'm hoping there's a way to make that happen automatically as the Razor edits are created.

Also, is there a script for removing all fades within a razor edit area?

Last edited by benmrx; 04-01-2021 at 08:33 AM.
benmrx is offline   Reply With Quote
Old 04-01-2021, 01:25 PM   #369
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,714
Default

Quote:
Originally Posted by ferropop View Post
JulianSader:

Would you consider allowing your MultiTool to automatically zoom to the necessary level to get all the functionality? Very often you make a selection and it will only give the limited set of functions because it's not zoomed in enough. If you then zoom in, the selection disappears and you have to redo the whole process.

It just gets in the way of smooth operation, and seems like an easy fix so I thought I'd bring it up!
Good idea! I will include this in the next update.
juliansader is offline   Reply With Quote
Old 04-02-2021, 08:08 AM   #370
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Posts: 3,668
Default

does "split items on razor edit edges" exist yet?

i've been trying to write this one but haven't been successful.
nevermind, found it.
__________________
mccrabney scripts: MIDI edits from the Arrange screen ala jjos/MPC sequencer
|sis - - - anacru| isn't what we performed: pls no extra noteons in loop recording
| - - - - - anacru|sis <==this is what we actually performed.

Last edited by mccrabney; 04-02-2021 at 08:18 AM.
mccrabney is online now   Reply With Quote
Old 04-02-2021, 10:54 AM   #371
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Posts: 3,668
Default

Quote:
GetRazorEdits()
Returns a table that contains all the selections individually.
Every element in the table has the properties:
* areaStart ----> starting point of the selection
* areaEnd ----> end point of the selection
* track ----> track that the selection is on
* items ----> items in range between areaStart <--> areaEnd, will be empty on envelopes
Birdbird, i'm having trouble with the items param from GetRazorEdits, stemming from something in GetItemsInRange, i think...

the issue is demonstrated by TJF's script, "LINK Razor Edit with Item Selection" pasted elsewhere in this thread.

essentially, items get selected that are not within the RE bounds if they share a common boundary with RE-inclusive items. i took a look at all of the greater/lesser/equal thans in "GetItemsinRange" and couldn't make any changes that worked.

here's the behavior in gif:

__________________
mccrabney scripts: MIDI edits from the Arrange screen ala jjos/MPC sequencer
|sis - - - anacru| isn't what we performed: pls no extra noteons in loop recording
| - - - - - anacru|sis <==this is what we actually performed.
mccrabney is online now   Reply With Quote
Old 04-02-2021, 02:02 PM   #372
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Quote:
Originally Posted by benmrx View Post
Also, is there a script for removing all fades within a razor edit area?

Try amagalma_Remove all item fades within Razor Edit areas.lua in ReaPack
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 04-02-2021, 02:14 PM   #373
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Quote:
Originally Posted by mccrabney View Post
Birdbird, i'm having trouble with the items param from GetRazorEdits, stemming from something in GetItemsInRange, i think...

the issue is demonstrated by TJF's script, "LINK Razor Edit with Item Selection" pasted elsewhere in this thread.

essentially, items get selected that are not within the RE bounds if they share a common boundary with RE-inclusive items. i took a look at all of the greater/lesser/equal thans in "GetItemsinRange" and couldn't make any changes that worked.

here's the behavior in gif:


Try this one:
Code:
function GetItemsInRange(track, areaStart, areaEnd)
    local items, it = {}, 0
    for k = 0, reaper.CountTrackMediaItems(track) - 1 do 
        local item = reaper.GetTrackMediaItem(track, k)
        local pos = reaper.GetMediaItemInfo_Value(item, "D_POSITION")
        local itemEndPos = pos + reaper.GetMediaItemInfo_Value(item, "D_LENGTH")

        --check if item is in area bounds
        if pos >= areaEnd or itemEndPos <= areaStart then
          -- outside, do nothing
        else -- inside
          it = it + 1
          items[it] = item
        end
    end
    
    return items
end
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 04-02-2021, 02:31 PM   #374
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Posts: 3,668
Default

hmm, that results has the same/similar behavior as the original GetItemsInRange -- items that share a border with REs end up getting put into the item table.

Code:
function muteREcontents()
    if RazorEditSelectionExists() then    
        local areas = GetRazorEdits()
        SplitRazorEdits(areas)
        for i = 1, #areas do
            local areaData = areas [i]
            local items = areaData.items
            for j = 1, #items do 
                reaper.SetMediaItemSelected(items[j], true)
            end
        end    
        reaper.Main_OnCommand(40183, 0)  -- toggle mute 
    else  
    end
end
here, i'm calling GetRazorEdits, which in turn calls your version of GetItemsInRange.



note that when i truncate the item so their bounds are not touching, the 2nd item is no longer selected.
__________________
mccrabney scripts: MIDI edits from the Arrange screen ala jjos/MPC sequencer
|sis - - - anacru| isn't what we performed: pls no extra noteons in loop recording
| - - - - - anacru|sis <==this is what we actually performed.

Last edited by mccrabney; 04-02-2021 at 02:38 PM.
mccrabney is online now   Reply With Quote
Old 04-02-2021, 03:04 PM   #375
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Then perhaps your item is inside? Zoom in as much as possible and check it.

If not, then it is a problem of float point maths. So, use this:
Code:
local function leq( a, b ) -- a less than or equal to b
  return a < b + 0.00001
end

local function geq( a, b ) -- a greater than or equal to b
  return a + 0.00001 > b 
end

local function GetItemsInRange(track, areaStart, areaEnd)
    local items, it = {}, 0
    for k = 0, reaper.CountTrackMediaItems(track) - 1 do 
        local item = reaper.GetTrackMediaItem(track, k)
        local pos = reaper.GetMediaItemInfo_Value(item, "D_POSITION")
        local itemEndPos = pos + reaper.GetMediaItemInfo_Value(item, "D_LENGTH")

        --check if item is in area bounds
        if geq(pos, areaEnd) or leq(itemEndPos, areaStart) then
          -- outside, do nothing
        else -- inside
          it = it + 1
          items[it] = item
        end
    end
    
    return items
end
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 04-02-2021, 03:33 PM   #376
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Posts: 3,668
Default

Quote:
Then perhaps your item is inside? Zoom in as much as possible and check it.
nope, i call SplitRazorEdits just before, so the items get trimmed to RE size. then, i count through the razor edit areas and call SetMediaItemSelected on the items returned from GetRazorEdits.

with your latest GetItemsInRange, i'm seeing this behavior:



__________________
mccrabney scripts: MIDI edits from the Arrange screen ala jjos/MPC sequencer
|sis - - - anacru| isn't what we performed: pls no extra noteons in loop recording
| - - - - - anacru|sis <==this is what we actually performed.
mccrabney is online now   Reply With Quote
Old 04-02-2021, 04:03 PM   #377
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

You mix and match functions that work differently then.. Haven't seen the rest of the actions..
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 04-02-2021, 04:51 PM   #378
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Posts: 3,668
Default

this is from BirdBird's post early in this thread:

Code:
function GetRazorEdits()
    local trackCount = reaper.CountTracks(0)
    local areaMap = {}
    for i = 0, trackCount - 1 do
        local track = reaper.GetTrack(0, i)
        local ret, area = reaper.GetSetMediaTrackInfo_String(track, 'P_RAZOREDITS', '', false)
        if area ~= '' then
            --PARSE STRING
            local str = {}
            for j in string.gmatch(area, "%S+") do
                table.insert(str, j)  
            end
        
            --FILL AREA DATA
            local j = 1
            while j <= #str do
                --area data
                local areaStart = tonumber(str[j])
                local areaEnd = tonumber(str[j+1])
                local GUID = str[j+2]
                local isEnvelope = GUID ~= '""'

                --get item/envelope data
                local items = {}
                local envelopeName, envelope
                local envelopePoints
                
                if not isEnvelope then
                    items = GetItemsInRange(track, areaStart, areaEnd)
                else
                    envelope = reaper.GetTrackEnvelopeByChunkName(track, GUID:sub(2, -2))
                    local ret, envName = reaper.GetEnvelopeName(envelope)

                    envelopeName = envName
                    envelopePoints = GetEnvelopePointsInRange(envelope, areaStart, areaEnd)
                end

                local areaData = {
                    areaStart = areaStart,
                    areaEnd = areaEnd,
                    
                    track = track,
                    items = items,
                    
                    --envelope data
                    isEnvelope = isEnvelope,
                    envelope = envelope,
                    envelopeName = envelopeName,
                    envelopePoints = envelopePoints,
                    GUID = GUID:sub(2, -2)
                }

                table.insert(areaMap, areaData)

                j = j + 3
            end
        end
    end

    return areaMap
end
^ that code calls GetItemsInRange, which i've been replacing with your alternates

my function is as follows. the goal is to split any items at razor edit edge, select all items inside all razor edits, and mute them.

Code:
function muteREcontents()
    if RazorEditSelectionExists() then    
        local areas = GetRazorEdits()
        SplitRazorEdits(areas)
        for i = 1, #areas do
            local areaData = areas [i]
            local items = areaData.items
            for j = 1, #items do 
                reaper.SetMediaItemSelected(items[j], true)
            end
        end    
        reaper.Main_OnCommand(40183, 0)  -- toggle mute 
    else  
    end
end
my function also calls this one:

Code:
function SplitRazorEdits(razorEdits)
    local areaItems = {}
    local tracks = {}
    reaper.PreventUIRefresh(1)
    for i = 1, #razorEdits do
        local areaData = razorEdits[i]
        if not areaData.isEnvelope then
            local items = areaData.items
            
            --recalculate item data for tracks with previous splits
            if tracks[areaData.track] ~= nil then 
                items = GetItemsInRange(areaData.track, areaData.areaStart, areaData.areaEnd)
            end
            
            for j = 1, #items do 
                local item = items[j]
                --split items 
                local newItem = reaper.SplitMediaItem(item, areaData.areaStart)
                if newItem == nil then
                    reaper.SplitMediaItem(item, areaData.areaEnd)
                    table.insert(areaItems, item)
                else
                    reaper.SplitMediaItem(newItem, areaData.areaEnd)
                    table.insert(areaItems, newItem)
                end
            end

            tracks[areaData.track] = 1
        end
    end
    reaper.PreventUIRefresh(-1)
    
    return areaItems
end
__________________
mccrabney scripts: MIDI edits from the Arrange screen ala jjos/MPC sequencer
|sis - - - anacru| isn't what we performed: pls no extra noteons in loop recording
| - - - - - anacru|sis <==this is what we actually performed.
mccrabney is online now   Reply With Quote
Old 04-03-2021, 08:27 AM   #379
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 425
Default

Quote:
Originally Posted by mccrabney View Post
my function is as follows. the goal is to split any items at razor edit edge, select all items inside all razor edits, and mute them.
GetRazorEdits() would have to be called again after calling SplitRazorEdits() as the item data in the area changes. So this should (hopefully) work:

Code:
function muteREcontents()
    if RazorEditSelectionExists() then    
        local areas = GetRazorEdits()
        SplitRazorEdits(areas)
        areas = GetRazorEdits() //recalculate area data
        for i = 1, #areas do
            local areaData = areas [i]
            local items = areaData.items
            for j = 1, #items do 
                reaper.SetMediaItemSelected(items[j], true)
            end
        end    
        reaper.Main_OnCommand(40183, 0)  -- toggle mute 
    else  
    end
end
Keeping amagalma's floating precision fix is probably a good idea in the meanwhile. (I'll add it to the functions on the first page eventually as it causes issues sometimes)




Edit: I forgot that SplitRazorEdits() returns the items. So the following should also work:
Code:
        local areas = GetRazorEdits()
        items = SplitRazorEdits(areas)
        for j = 1, #items do 
            reaper.SetMediaItemSelected(items[j], true)
        end
        reaper.Main_OnCommand(40183, 0)  -- toggle mute
__________________
ReaScript Discord Server | Scripts | JSFX

Last edited by BirdBird; 04-03-2021 at 08:42 AM.
BirdBird is offline   Reply With Quote
Old 04-03-2021, 08:59 AM   #380
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Posts: 3,668
Default

thank you both! the function is working nicely now.
__________________
mccrabney scripts: MIDI edits from the Arrange screen ala jjos/MPC sequencer
|sis - - - anacru| isn't what we performed: pls no extra noteons in loop recording
| - - - - - anacru|sis <==this is what we actually performed.
mccrabney is online now   Reply With Quote
Old 04-03-2021, 10:40 AM   #381
benmrx
Human being with feelings
 
benmrx's Avatar
 
Join Date: Aug 2010
Posts: 396
Default

Quote:
Originally Posted by amagalma View Post
Try amagalma_Remove all item fades within Razor Edit areas.lua in ReaPack
Thanks. This seems to work as expected for fade in and out, but when using this to remove a crossfade it's leaving items overlapped in the background. Almost like the behavior you get if you have "Trim content behind media items when editing' unchecked.
benmrx is offline   Reply With Quote
Old 04-05-2021, 03:21 AM   #382
tapemelancholy
Human being with feelings
 
Join Date: Sep 2018
Posts: 92
Default

I am curious if someone can create a script that allows filling time selection with razor edits?

It will be super handy

tapemelancholy is offline   Reply With Quote
Old 04-05-2021, 05:05 AM   #383
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Quote:
Originally Posted by tapemelancholy View Post
I am curious if someone can create a script that allows filling time selection with razor edits?

It will be super handy

This?
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 04-05-2021, 05:12 AM   #384
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 3,451
Default

Quote:
Originally Posted by benmrx View Post
Thanks. This seems to work as expected for fade in and out, but when using this to remove a crossfade it's leaving items overlapped in the background. Almost like the behavior you get if you have "Trim content behind media items when editing' unchecked.
That is how crossfades work in Reaper. They are not a special case. If two items overlap and at the portion they overlap, the earlier item has a fade out and the later has a fade in, then they are said to crossfade. A dedicated script could be written that trims the end of the earlier item to the start of the later and trims the start of the later to the end of the earlier...
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 04-05-2021, 10:55 AM   #385
benmrx
Human being with feelings
 
benmrx's Avatar
 
Join Date: Aug 2010
Posts: 396
Default

Quote:
Originally Posted by amagalma View Post
That is how crossfades work in Reaper. They are not a special case. If two items overlap and at the portion they overlap, the earlier item has a fade out and the later has a fade in, then they are said to crossfade. A dedicated script could be written that trims the end of the earlier item to the start of the later and trims the start of the later to the end of the earlier...
Yeah, I saw that was happening by dragging the two items to different tracks. Sounds like a scripting solution is do-able, but would require a bit more work as I would hope to be able to create a selection around multiple items on multiple tracks and have confidence that the fades were properly removed without creating any overlaps.

EDIT: Removed comments not related to Razor Edits.

Last edited by benmrx; 04-05-2021 at 04:32 PM.
benmrx is offline   Reply With Quote
Old 04-06-2021, 06:47 AM   #386
tapemelancholy
Human being with feelings
 
Join Date: Sep 2018
Posts: 92
Default

Quote:
Originally Posted by amagalma View Post
Yes, exactly!
That's great, thanks!
tapemelancholy is offline   Reply With Quote
Old 04-10-2021, 08:45 AM   #387
MrTsonts
Human being with feelings
 
MrTsonts's Avatar
 
Join Date: Apr 2019
Location: Ukraine, Kyiv
Posts: 173
Default

Thanks juliansader for the code!
It turned out to make toggle razor area under mouse cursor)))


Code:
reaper.Undo_BeginBlock2(0)
         reaper.Main_OnCommand(42406,0) -- Razor edit: Clear all areas
         window, segment, details = reaper.BR_GetMouseCursorContext()
         if details == "item" then
            item =  reaper.BR_GetMouseCursorContext_Item()
            sel_item =  reaper.IsMediaItemSelected( item )
         if sel_item == false then
            reaper.SetMediaItemSelected( item, true )
         else
              reaper.SetMediaItemSelected( item, false )
         end
         end
         tS = {}
        for i = 0, reaper.CountSelectedMediaItems(0)-1 do
            item = reaper.GetSelectedMediaItem(0, i)
            left = reaper.GetMediaItemInfo_Value(item, "D_POSITION")
            right = left + reaper.GetMediaItemInfo_Value(item, "D_LENGTH")
            track = reaper.GetMediaItemTrack(item)
            tS[track] = (tS[track] or "") .. string.format([[%.16f %.16f "" ]], left, right)
        end
        for track, str in pairs(tS) do
            reaper.GetSetMediaTrackInfo_String(track, "P_RAZOREDITS", str, true)
            end
reaper.UpdateArrange()
reaper.Undo_EndBlock2(0, "Toggle enclose media items under mouse in minimal razor area", -1)

Last edited by MrTsonts; 04-10-2021 at 08:54 AM.
MrTsonts is online now   Reply With Quote
Old 04-10-2021, 08:54 AM   #388
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Posts: 3,668
Default

ah, good work! that was on my to-do list. thank you!
__________________
mccrabney scripts: MIDI edits from the Arrange screen ala jjos/MPC sequencer
|sis - - - anacru| isn't what we performed: pls no extra noteons in loop recording
| - - - - - anacru|sis <==this is what we actually performed.
mccrabney is online now   Reply With Quote
Old 04-10-2021, 09:16 AM   #389
MrTsonts
Human being with feelings
 
MrTsonts's Avatar
 
Join Date: Apr 2019
Location: Ukraine, Kyiv
Posts: 173
Default

Quote:
Originally Posted by mccrabney View Post
ah, good work! that was on my to-do list. thank you!
Unfortunately, without automation items.
MrTsonts is online now   Reply With Quote
Old 04-10-2021, 04:33 PM   #390
MrTsonts
Human being with feelings
 
MrTsonts's Avatar
 
Join Date: Apr 2019
Location: Ukraine, Kyiv
Posts: 173
Default

Thanks mccrabney and juliansader for the codes! Now I have Solo and loop razor edit area))


Code:
reaper.Undo_BeginBlock2(0)
reaper.Main_OnCommand(40340,0)
reaper.SetTrackSelected(reaper.GetMasterTrack(0), false)
for t = 0, reaper.CountTracks(0)-1 do
    local track = reaper.GetTrack(0, t)
    local razorOK, razorStr = reaper.GetSetMediaTrackInfo_String(track, "P_RAZOREDITS", "", false)
    if razorOK and #razorStr ~= 0 
    then reaper.SetMediaTrackInfo_Value(track, "I_SOLO" ,1 )
end
end 
function SetActionEnabled(action, state)
    if reaper.GetToggleCommandState(action) == 1 ~= state then
    reaper.Main_OnCommand(action, 0)
end
end
left, right = math.huge, -math.huge
for t = 0, reaper.CountTracks(0)-1 do
    local track = reaper.GetTrack(0, t)
    local razorOK, razorStr = reaper.GetSetMediaTrackInfo_String(track, "P_RAZOREDITS", "", false)
    if razorOK and #razorStr ~= 0 then
    for razorLeft, razorRight, envGuid in razorStr:gmatch([[([%d%.]+) ([%d%.]+) "([^"]*)"]]) do
    local razorLeft, razorRight = tonumber(razorLeft), tonumber(razorRight)
    if razorLeft  < left  then left  = razorLeft end
    if razorRight > right then right = razorRight end
end
end
end
    if left <= right then
    reaper.PreventUIRefresh(1)
    reaper.GetSet_LoopTimeRange2(0, true, false, left, right, false)
    reaper.SetEditCurPos(left, true, false)
    SetActionEnabled(1068, true)
    reaper.PreventUIRefresh(-1)
end
reaper.UpdateArrange()
reaper.Undo_EndBlock2(0, "Solo and loop razor edit area", -1)

Last edited by MrTsonts; 04-10-2021 at 04:46 PM.
MrTsonts is online now   Reply With Quote
Old 04-10-2021, 05:08 PM   #391
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

This thread could be moved to the scripts sub-forum now that razor edit is released officially for a while. :P
nofish is offline   Reply With Quote
Old 04-12-2021, 01:15 PM   #392
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 4,812
Default

Quote:
Originally Posted by nofish View Post
This thread could be moved to the scripts sub-forum now that razor edit is released officially for a while. :P
it happened! now maybe worth a sticky?
__________________
🙏🏻
deeb is offline   Reply With Quote
Old 04-15-2021, 05:46 AM   #393
dukati
Human being with feelings
 
Join Date: Aug 2007
Location: Burlington, ON
Posts: 96
Default

Quote:
Originally Posted by Embass View Post
Can you quickly walk me through this? Are these separate tracks being comped into one take, or are these takes which are part of the Uponor take system?
dukati is offline   Reply With Quote
Old 04-15-2021, 12:12 PM   #394
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 1,992
Default

it is a script that when turned on copy what is behind RE to the group track. I recommend you using mine version of this script to have a GUI and other options

https://forum.cockos.com/showpost.ph...&postcount=329
daniellumertz is offline   Reply With Quote
Old 04-15-2021, 03:05 PM   #395
DrRick
Human being with feelings
 
Join Date: Aug 2019
Posts: 6
Default

Quote:
Originally Posted by juliansader View Post
Good idea! I will include this in the next update.
Inspired by this thread, and my desire to alter envelope segments with the razor, I just installed your multi tool. Took me a minute to figure it out, because I'm old and tired, but man. THANK YOU. It's gone on the key that used to be "insert four envelope points at time selection", because that is RETIRED.
DrRick is offline   Reply With Quote
Old 04-15-2021, 03:39 PM   #396
ferropop
Human being with feelings
 
ferropop's Avatar
 
Join Date: Jan 2016
Location: Los Angeles, CA
Posts: 3,116
Default

Quote:
Originally Posted by DrRick View Post
Inspired by this thread, and my desire to alter envelope segments with the razor, I just installed your multi tool. Took me a minute to figure it out, because I'm old and tired, but man. THANK YOU. It's gone on the key that used to be "insert four envelope points at time selection", because that is RETIRED.
Exactly the same as me lol.

This is a compliment to juliansader, but this needs to be native like, 10 years ago.
ferropop is offline   Reply With Quote
Old 04-19-2021, 01:11 AM   #397
Pink Wool
Human being with feelings
 
Pink Wool's Avatar
 
Join Date: Apr 2020
Posts: 1,500
Default

Quote:
Originally Posted by Sexan View Post
Adjusting fades on right click drag, edge limiting and etc
I'm sorry but I tried looking through the thread and couldn't figure out if this script has been released or not?

Last edited by Pink Wool; 04-19-2021 at 01:19 AM.
Pink Wool is online now   Reply With Quote
Old 04-20-2021, 01:41 PM   #398
benmrx
Human being with feelings
 
benmrx's Avatar
 
Join Date: Aug 2010
Posts: 396
Default

I've been working on a bunch of custom RE scripts and thought others may get some use out of these two. The goal has been to get a workflow for area selections that more closely resembles PT and Nuendo behavior.

Revilo_Toggle_AddRemove_ExistingRazorArea_OnTrackU nderMouse

This script will add or remove an existing razor area on the track under the mouse. If no razor area exists, these scripts do nothing. If a razor area exists on the track under the mouse, it will remove the razor area. If no razor area exists on the track under the mouse, it will add a razor area to the track.


Revilo_ExtendExistingRazorArea_FromTrackStart_ToTr ackUnderMouse
This script will extend an existing razor area to the track under the mouse. For example, if you have a razor edit on track 1, and your mouse is over track 10, this script will create razor areas on tracks 2-10. If you have a razor area on track 5, and your mouse is over track 1, it will create razor areas on tracks 4, 3, 2, 1.


Note, this is my first time sharing reaper scripts. I'm totally new to the API and there may be better ways of accomplishing the same end goal. Big thanks to all the script postings here. Both of these use snippets from posts in this thread. Also note, I'm brand new to the lua language. I'm coming from C#, so take it easy on me if these scripts seem like a mess.lol.
benmrx is offline   Reply With Quote
Old 04-20-2021, 02:55 PM   #399
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 1,992
Default

Welcome to the reaper scripts please keep posting if you do something that would like to sharing
daniellumertz is offline   Reply With Quote
Old 04-20-2021, 04:26 PM   #400
Vagelis
Human being with feelings
 
Vagelis's Avatar
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 3,795
Default

@Benrmx I have asked the devs multiple times to add these functions as native modifiers but never happened. Big thanks for these scripts
Vagelis 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 03:59 AM.


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