Old 11-07-2020, 04:54 AM   #201
sonictim
Human being with feelings
 
sonictim's Avatar
 
Join Date: Feb 2020
Location: Los Angeles
Posts: 267
Default Move Razor Edit Edge to Edit Cursor

Just added 2 scripts to my reapack that will move any razor edits you have on your timeline to the Edit Cursor. Very handy for syncing/snapping razor edits to your edit cursor. Will also post them here for anyone who's interested


Unfortunately, I can't get them to work with mouse modifiers, as clicking on a Razor Edit area will move the cursor... Anyone have any ideas on how I can get around that?

*** Update... found a bug with Envelopes and have since updated the scripts

Last edited by sonictim; 11-07-2020 at 02:39 PM.
sonictim is offline   Reply With Quote
Old 11-07-2020, 06:51 AM   #202
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 353
Default

Quote:
Originally Posted by sonictim View Post
Just added 2 scripts to my reapack that will move any razor edits you have on your timeline to the Edit Cursor. Very handy for syncing/snapping razor edits to your edit cursor. Will also post them here for anyone who's interested


Unfortunately, I can't get them to work with mouse modifiers, as clicking on a Razor Edit area will move the cursor... Anyone have any ideas on how I can get around that?
Thanks for sharing. Where can I find you reapack link?
__________________
Arrangement/mixing
Skorobagatko is offline   Reply With Quote
Old 11-07-2020, 10:03 AM   #203
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,691
Default

Create Razor Edit from edit cursor & last touched track (or selected envelope) to track (or envelope) under mouse cursor



download here:
amagalma_Create Razor Edit from edit cursor & last touched track (or selected envelope) to track (or envelope) under mouse cursor.lua
__________________
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 11-07-2020, 11:15 AM   #204
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 353
Default

It works with shortcut. Is there a way to make it snap to grid?

Here is what happens when I assign it to Track - Alt + Left click

__________________
Arrangement/mixing
Skorobagatko is offline   Reply With Quote
Old 11-07-2020, 02:29 PM   #205
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 5,157
Default

@ amagalma: Is it true that your Razor Edit Scripts aren't in your ReaPack repository (yet) ?
__________________
Reaper - OSX (always latest version)
OSX Catalina (always latest version)
My Reaper Tips&Tricks: https://www.youtube.com/user/vanhaze2000/playlists
vanhaze is offline   Reply With Quote
Old 11-07-2020, 02:39 PM   #206
sonictim
Human being with feelings
 
sonictim's Avatar
 
Join Date: Feb 2020
Location: Los Angeles
Posts: 267
Default

Quote:
Originally Posted by Skorobagatko View Post
Thanks for sharing. Where can I find you reapack link?
https://github.com/sonictim/TJF-Scri...ster/index.xml
sonictim is offline   Reply With Quote
Old 11-07-2020, 02:56 PM   #207
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 5,157
Default

Great, thanks !
__________________
Reaper - OSX (always latest version)
OSX Catalina (always latest version)
My Reaper Tips&Tricks: https://www.youtube.com/user/vanhaze2000/playlists
vanhaze is offline   Reply With Quote
Old 11-07-2020, 03:26 PM   #208
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 353
Default

Quote:
Originally Posted by sonictim View Post
Thank you!
__________________
Arrangement/mixing
Skorobagatko is offline   Reply With Quote
Old 11-07-2020, 05:23 PM   #209
sonictim
Human being with feelings
 
sonictim's Avatar
 
Join Date: Feb 2020
Location: Los Angeles
Posts: 267
Default

Quote:
Originally Posted by Skorobagatko View Post
Thank you!
You are welcome!
__________________
My Reapack Repository: I write scripts for my own personal use.
I offer no support, but if you find one that helps you, go for it!
sonictim is offline   Reply With Quote
Old 11-08-2020, 01:52 AM   #210
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,691
Default

Quote:
Originally Posted by Skorobagatko View Post
It works with shortcut. Is there a way to make it snap to grid?

Here is what happens when I assign it to Track - Alt + Left click

Version that respects Snap to Grid setting:

amagalma_Create Razor Edit from edit cursor & last touched track (or selected envelope) to track (or envelope) under mouse cursor respecting Snap to Grid.lua


Assign scripts to key shortcuts.


Quote:
Originally Posted by vanhaze View Post
@ amagalma: Is it true that your Razor Edit Scripts aren't in your ReaPack repository (yet) ?

Yes, until RE is official no RE scripts on ReaPack from me.
__________________
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 11-08-2020, 02:27 AM   #211
vanhaze
Human being with feelings
 
vanhaze's Avatar
 
Join Date: Jul 2012
Location: Netherlands
Posts: 5,157
Default

Ok, thank you for informing me !
__________________
Reaper - OSX (always latest version)
OSX Catalina (always latest version)
My Reaper Tips&Tricks: https://www.youtube.com/user/vanhaze2000/playlists
vanhaze is offline   Reply With Quote
Old 11-08-2020, 04:03 AM   #212
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 353
Default

Quote:
Originally Posted by amagalma View Post
Version that respects Snap to Grid setting:

amagalma_Create Razor Edit from edit cursor & last touched track (or selected envelope) to track (or envelope) under mouse cursor respecting Snap to Grid.lua


Assign scripts to key shortcuts.





Yes, until RE is official no RE scripts on ReaPack from me.
Thanks a lot!
__________________
Arrangement/mixing
Skorobagatko is offline   Reply With Quote
Old 11-08-2020, 08:49 AM   #213
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 353
Default

Quote:
Originally Posted by Embass View Post
Can it be modified to return my previous modifier for the arrange right drag when it's toggle off? (marquee select items)
__________________
Arrangement/mixing
Skorobagatko is offline   Reply With Quote
Old 11-08-2020, 08:50 AM   #214
The-Zeronaut
Human being with feelings
 
Join Date: Mar 2009
Posts: 277
Default

OMG those swipe vocal comping scripts are a total game changer.

Utterly amazing. Many thanks, Embass!!!!!!

Cant wait until all this razor edit stuff is finally implemented and released to the general public >.<
The-Zeronaut is offline   Reply With Quote
Old 11-09-2020, 10:42 AM   #215
gapalil001
Human being with feelings
 
gapalil001's Avatar
 
Join Date: May 2016
Location: Kyiv, Ukraine
Posts: 56
Default

Quote:
Originally Posted by sonictim View Post


I'm not sure what to tell you.. there it is in my reapack... As I mentioned before, the script is attached in the post above, so you don't need reapack to get it...
i using your script as main fade tool, and there is one critical bug i haven't time for report before now. if you select couple of items and fade (and crossfade them) its working fine, BUT if you remove one of these items, ALL FADES of these items REMOVES without any reason

https://dropmefiles.com/lHMFx here is how it happens (100% times)

Last edited by gapalil001; 11-09-2020 at 10:48 AM.
gapalil001 is offline   Reply With Quote
Old 11-09-2020, 12:12 PM   #216
sonictim
Human being with feelings
 
sonictim's Avatar
 
Join Date: Feb 2020
Location: Los Angeles
Posts: 267
Default

Quote:
Originally Posted by gapalil001 View Post
i using your script as main fade tool, and there is one critical bug i haven't time for report before now. if you select couple of items and fade (and crossfade them) its working fine, BUT if you remove one of these items, ALL FADES of these items REMOVES without any reason

https://dropmefiles.com/lHMFx here is how it happens (100% times)
That is super interesting... I played around with my script and was unable to reproduce what you were showing in your video... the only thing I can think of, is the script exploits the autofades, not regular fades to create it's fades... so perhaps somehow the autofading is linking the files so when one goes, the others go.. (if this is the case, that's a reaper bug, not a script bug). I know I did extensive testing on which was better when I wrote the script, and I'm pretty sure choosing AUTO was the best choice, but I can't remember why now.... but you could try having it create regular fades instead.....

I'm insanely busy at work until the end of the year and since I'm not able to reproduce the behavior, here's what I suggest you try...

Make a copy of the script. Edit the new Copy...

Every time you see something like "D_FADEOUTLEN_AUTO" remove the _AUTO... try running this newly altered script again and see if that works....

if not... remind me about this in January. Also, these are my preferences for fades... perhaps try matching them and see?

__________________
My Reapack Repository: I write scripts for my own personal use.
I offer no support, but if you find one that helps you, go for it!
sonictim is offline   Reply With Quote
Old 11-11-2020, 11:41 AM   #217
gapalil001
Human being with feelings
 
gapalil001's Avatar
 
Join Date: May 2016
Location: Kyiv, Ukraine
Posts: 56
Default

Quote:
Originally Posted by sonictim View Post
That is super interesting... I played around with my script and was unable to reproduce what you were showing in your video... the only thing I can think of, is the script exploits the autofades, not regular fades to create it's fades... so perhaps somehow the autofading is linking the files so when one goes, the others go.. (if this is the case, that's a reaper bug, not a script bug). I know I did extensive testing on which was better when I wrote the script, and I'm pretty sure choosing AUTO was the best choice, but I can't remember why now.... but you could try having it create regular fades instead.....

I'm insanely busy at work until the end of the year and since I'm not able to reproduce the behavior, here's what I suggest you try...

Make a copy of the script. Edit the new Copy...

Every time you see something like "D_FADEOUTLEN_AUTO" remove the _AUTO... try running this newly altered script again and see if that works....

if not... remind me about this in January. Also, these are my preferences for fades... perhaps try matching them and see?

thank you for your answer, but that's doesn't help
gapalil001 is offline   Reply With Quote
Old 11-11-2020, 03:27 PM   #218
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 353
Default

Quote:
Originally Posted by gapalil001 View Post
i using your script as main fade tool, and there is one critical bug i haven't time for report before now. if you select couple of items and fade (and crossfade them) its working fine, BUT if you remove one of these items, ALL FADES of these items REMOVES without any reason

https://dropmefiles.com/lHMFx here is how it happens (100% times)
Strange, I use this script and it's all good. What Reaper version you have?
__________________
Arrangement/mixing
Skorobagatko is offline   Reply With Quote
Old 11-11-2020, 08:06 PM   #219
sonictim
Human being with feelings
 
sonictim's Avatar
 
Join Date: Feb 2020
Location: Los Angeles
Posts: 267
Default

Quote:
Originally Posted by gapalil001 View Post
thank you for your answer, but that's doesn't help
I’m sorry to hear.. thanks for trying it. I don’t have any other ideas, nor can I reproduce your bug so I’m afraid this script might not be for you. Also.... as this is the topic here is razor edits(not fade scripts), if you’d like to try to figure it out or continue the conversation, I’d suggest posting about it in the scripting section of the forum. Perhaps someone can help you there.
__________________
My Reapack Repository: I write scripts for my own personal use.
I offer no support, but if you find one that helps you, go for it!
sonictim is offline   Reply With Quote
Old 11-20-2020, 02:15 AM   #220
gapalil001
Human being with feelings
 
gapalil001's Avatar
 
Join Date: May 2016
Location: Kyiv, Ukraine
Posts: 56
Default

Quote:
Originally Posted by Skorobagatko View Post
Strange, I use this script and it's all good. What Reaper version you have?
I use latest pre-release versions and always checks for newest
gapalil001 is offline   Reply With Quote
Old 11-20-2020, 02:52 AM   #221
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 353
Default

Quote:
Originally Posted by gapalil001 View Post
I use latest pre-release versions and always checks for newest
Mine is dev1109.
__________________
Arrangement/mixing
Skorobagatko is offline   Reply With Quote
Old 11-26-2020, 06:30 AM   #222
gapalil001
Human being with feelings
 
gapalil001's Avatar
 
Join Date: May 2016
Location: Kyiv, Ukraine
Posts: 56
Default

Quote:
Originally Posted by Skorobagatko View Post
Mine is dev1109.
My is dev1108 now, latest pre-release versions is not available at landoleet because of rc versions. fades in/out is disappear every time when i remove items/pieces, и это полная, блин, жопа. я уже задолбался их обратно ставить

Last edited by gapalil001; 11-26-2020 at 09:32 AM.
gapalil001 is offline   Reply With Quote
Old 12-03-2020, 01:48 AM   #223
Win Conway
Human being with feelings
 
Join Date: Dec 2010
Posts: 3,739
Default

Quote:
Originally Posted by daniellumertz View Post
Try this:

there is an option to also change the items positions to the left.
Code:
 change_pos = false -- Change the postion
I was more less babysitting my cousin while writing it so somethings could need a closer look haha
97% of code is from birdbird hahaha thanksss
Code:
function literalize(str)
    return str:gsub("[%(%)%.%%%+%-%*%?%[%]%^%$]", function(c) return "%" .. c end)
end

function print(param)
  reaper.ShowConsoleMsg(tostring(param)..'\n')
end

function GetGUIDFromEnvelope(envelope)
    local ret2, envelopeChunk = reaper.GetEnvelopeStateChunk(envelope, "")
    local GUID = "{" ..  string.match(envelopeChunk, "GUID {(%S+)}") .. "}"
    return GUID
end

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

        --check if item is in area bounds
        if (itemEndPos > areaStart and itemEndPos <= areaEnd) or
            (pos >= areaStart and pos < areaEnd) or
            (pos <= areaStart and itemEndPos >= areaEnd) then
                table.insert(items,item)
        end
    end

    return items
end

function GetEnvelopePointsInRange(envelopeTrack, areaStart, areaEnd)
    local envelopePoints = {}

    for i = 1, reaper.CountEnvelopePoints(envelopeTrack) do
        local retval, time, value, shape, tension, selected = reaper.GetEnvelopePoint(envelopeTrack, i - 1)

        if time >= areaStart and time <= areaEnd then --point is in range
            envelopePoints[#envelopePoints + 1] = {
                id = i-1 ,
                time = time,
                value = value,
                shape = shape,
                tension = tension,
                selected = selected
            }
        end
    end

    return envelopePoints
end

function SetTrackRazorEdit(track, areaStart, areaEnd, clearSelection)
    if clearSelection == nil then clearSelection = false end
    
    if clearSelection then
        local ret, area = reaper.GetSetMediaTrackInfo_String(track, 'P_RAZOREDITS', '', false)
    
        --parse string, all this string stuff could probably be written better
        local str = {}
        for j in string.gmatch(area, "%S+") do
            table.insert(str, j)
        end
        
        --strip existing selections across the track
        local j = 1
        while j <= #str do
            local GUID = str[j+2]
            if GUID == '""' then 
                str[j] = ''
                str[j+1] = ''
                str[j+2] = ''
            end

            j = j + 3
        end

        --insert razor edit 
        local REstr = tostring(areaStart) .. ' ' .. tostring(areaEnd) .. ' ""'
        table.insert(str, REstr)

        local finalStr = ''
        for i = 1, #str do
            local space = i == 1 and '' or ' '
            finalStr = finalStr .. space .. str[i]
        end

        local ret, area = reaper.GetSetMediaTrackInfo_String(track, 'P_RAZOREDITS', finalStr, true)
        return ret
    else         
        local ret, area = reaper.GetSetMediaTrackInfo_String(track, 'P_RAZOREDITS', '', false)
        local str = area ~= nil and area .. ' ' or ''
        str = str .. tostring(areaStart) .. ' ' .. tostring(areaEnd) .. '  ""'
        
        local ret, area = reaper.GetSetMediaTrackInfo_String(track, 'P_RAZOREDITS', str, true)
        return ret
    end
end

function SetEnvelopeRazorEdit(envelope, areaStart, areaEnd, clearSelection, GUID)
    local GUID = GUID == nil and GetGUIDFromEnvelope(envelope) or GUID
    local track = reaper.Envelope_GetParentTrack(envelope)

    if clearSelection then
        local ret, area = reaper.GetSetMediaTrackInfo_String(track, 'P_RAZOREDITS', '', false)
    
        --parse string
        local str = {}
        for j in string.gmatch(area, "%S+") do
            table.insert(str, j)
        end
        
        --strip existing selections across the envelope
        local j = 1
        while j <= #str do
            local envGUID = str[j+2]
            if GUID ~= '""' and envGUID:sub(2,-2) == GUID then 
                str[j] = ''
                str[j+1] = ''
                str[j+2] = ''
            end

            j = j + 3
        end

        --insert razor edit
        local REstr = tostring(areaStart) .. ' ' .. tostring(areaEnd) .. ' ' .. GUID
        table.insert(str, REstr)

        local finalStr = ''
        for i = 1, #str do
            local space = i == 1 and '' or ' '
            finalStr = finalStr .. space .. str[i]
        end

        local ret, area = reaper.GetSetMediaTrackInfo_String(track, 'P_RAZOREDITS', finalStr, true)
        return ret
    else         
        local ret, area = reaper.GetSetMediaTrackInfo_String(track, 'P_RAZOREDITS', '', false)

        local str = area ~= nil and area .. ' ' or ''
        str = str .. tostring(areaStart) .. ' ' .. tostring(areaEnd) .. ' ' .. GUID
        
        local ret, area = reaper.GetSetMediaTrackInfo_String(track, 'P_RAZOREDITS', str, true)
        return ret
    end
end

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

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

function IsRazor()
  isarea = false
  for i = 0,  reaper.CountTracks(0) - 1 do
     local track = reaper.GetTrack(0, i)
     local ret, area = reaper.GetSetMediaTrackInfo_String(track, 'P_RAZOREDITS', '', false)
     if area ~= '' then isarea = true end 
  end
  return isarea
end


----------------
-----MAIN ACTION
----------------


reaper.Undo_BeginBlock()

change_pos = false -- Change the postion

if IsRazor() == true then
  local selections = GetRazorEdits()
  local items = SplitRazorEdits(selections)
  for i = 1, #items do -- Select Items Splited 
      local item = items[i]
      reaper.SetMediaItemSelected(item, true)
       if change_pos == true then 
          item_start = reaper.GetMediaItemInfo_Value( item, 'D_POSITION' )
          item_len = reaper.GetMediaItemInfo_Value( item, 'D_LENGTH' )
          reaper.SetMediaItemInfo_Value( item, 'D_POSITION', item_start-item_len )
       end
  end
  reaper.Main_OnCommand( 41051, -1 )-- Reverse Items 
else
end

reaper.Undo_EndBlock( 'Reverse at Razor Edits', -1 )
This doesnt work here, no matter if i set it to true or false it just reverese the razor edit in place, it should copy the audio in the razor area, move it to the left, then reverse it, right ?
__________________
Stop posting huge images, smaller images or thumbnail, it's not rocket science!
Win Conway is offline   Reply With Quote
Old 12-03-2020, 06:46 AM   #224
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 832
Default

Hi Win!

here what happens

if set to true


if set to false


was that you have in mind

oh the thing you want is that instead of really moving what is inside RE it does a copy of it ?

also there is an bug in the script IF you have an item selected while using RE an rare situation that can happen, I can adjust that just waiting to see if that is a bug ( Item selection and RE at the same time ) https://forum.cockos.com/showpost.ph...06&postcount=7 or if it is not a bug
daniellumertz is online now   Reply With Quote
Old 12-10-2020, 09:23 PM   #225
Win Conway
Human being with feelings
 
Join Date: Dec 2010
Posts: 3,739
Default

Thats not what happens here, but i dont have that lane stuff going, i will do a quick screengrab of the sort of thing i meant (my text explanations are terrible)
__________________
Stop posting huge images, smaller images or thumbnail, it's not rocket science!
Win Conway is offline   Reply With Quote
Old 01-07-2021, 08:44 AM   #226
Embass
Human being with feelings
 
Embass's Avatar
 
Join Date: Jan 2014
Posts: 492
Default

Glue area selection script
https://drive.google.com/file/d/1AK6...ew?usp=sharing

Embass is offline   Reply With Quote
Old 01-07-2021, 09:50 AM   #227
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 353
Default

Quote:
Originally Posted by Embass View Post
Thanks a lot!
__________________
Arrangement/mixing
Skorobagatko is offline   Reply With Quote
Old 01-07-2021, 11:14 AM   #228
Vagelis
Human being with feelings
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 1,009
Default

Very useful script Embass, thank you so much!
Vagelis is offline   Reply With Quote
Old 01-07-2021, 02:00 PM   #229
Gianfini
Human being with feelings
 
Join Date: Jan 2015
Posts: 711
Default

would it be possible to
- play items within razor edit selection through tracks
- play items within razor edit selection

to play only items portions within the selection
?
Gianfini is offline   Reply With Quote
Old 01-07-2021, 02:04 PM   #230
daniellumertz
Human being with feelings
 
daniellumertz's Avatar
 
Join Date: Dec 2017
Location: Brazil
Posts: 832
Default

That would be cool

maybe a script soloing items ?
daniellumertz is online now   Reply With Quote
Old 01-07-2021, 03:24 PM   #231
Gianfini
Human being with feelings
 
Join Date: Jan 2015
Posts: 711
Default

yep, just selecting an area and playing all that is in it through tracks and master or standalone

An if loop activated it would loop through it

dream come true

g
Gianfini is offline   Reply With Quote
Old 01-09-2021, 05:57 AM   #232
Embass
Human being with feelings
 
Embass's Avatar
 
Join Date: Jan 2014
Posts: 492
Default

lua sripts:
1.Razor edit - Select other tracks with the same color
2.Razor edit - Select other tracks with the same name
3.Razor edit - Select other tracks with the same name (first word)
4.Razor edit - Select other tracks with the same name (first character)
5.Razor edit - Select other tracks with the same name (last word)

Download link: https://drive.google.com/file/d/1G61...ew?usp=sharing

Embass is offline   Reply With Quote
Old 01-10-2021, 01:58 PM   #233
Arthur McArthur
Human being with feelings
 
Join Date: Sep 2016
Location: Toronto
Posts: 557
Default

Here's a long-requested right-click-drag to delete script I hacked together using some of the code snippets in this thread. It switches the right drag modifier to: create razor edits no snap, runs in a defer loop to delete all items in razor edit, then switches back to marquee select as the right drag modifier when closed (you can obviously change this if your right drag modifier is different.)



Code:
local r = reaper

-- Set ToolBar Button State
function SetButtonState( set )
  if not set then set = 0 end
  local is_new_value, filename, sec, cmd, mode, resolution, val = reaper.get_action_context()
  local state = reaper.GetToggleCommandStateEx( sec, cmd )
  reaper.SetToggleCommandState( sec, cmd, set ) -- Set ON
  reaper.RefreshToolbar2( sec, cmd )
end

local self = ({reaper.get_action_context()})[4]

reaper.SetToggleCommandState(0, self, 1)

function literalize(str)
    return str:gsub("[%(%)%.%%%+%-%*%?%[%]%^%$]", function(c) return "%" .. c end)
end

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

        --check if item is in area bounds
        if (itemEndPos > areaStart and itemEndPos <= areaEnd) or
            (pos >= areaStart and pos < areaEnd) or
            (pos <= areaStart and itemEndPos >= areaEnd) then
                table.insert(items,item)
        end
    end

    return items
end

function GetRazorEdits()
    local trackCount = r.CountTracks(0)
    local areaMap = {}
    for i = 0, trackCount - 1 do
        local track = r.GetTrack(0, i)
        local ret, area = r.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 = r.GetTrackEnvelopeByChunkName(track, GUID:sub(2, -2))
                    local ret, envName = r.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

    function RazorEditSelectionExists()
    
        for i=0, r.CountTracks(0)-1 do
    
            local retval, x = r.GetSetMediaTrackInfo_String(r.GetTrack(0,i), "P_RAZOREDITS", "string", false)
    
            if x ~= "" then return true end
    
        end--for
        
        return false
    
    end--RazorEditSelectionExists()
    
    function Main()
    
    if RazorEditSelectionExists() then
    
          local selections = GetRazorEdits()
          for i = 1, #selections do
              local areaData = selections[i]
              local items = areaData.items
              r.Undo_BeginBlock();
              
              for j = 1, #items do r.SetMediaItemSelected(items[j], true) end
              r.UpdateTimeline()
              r.PreventUIRefresh(1);
              r.Main_OnCommand(42406, 0)--remove razor edit
              r.Main_OnCommand(40006, 0)--remove items
             
              r.PreventUIRefresh(-1);
              r.Undo_EndBlock('Delete Item', -1)
             
          end
    end
    
    r.defer(Main)
    
    
    end
    
    
r.SetMouseModifier( 'MM_CTX_ARRANGE_RMOUSE', 0, 25)-- set right click drag to create razor edits
SetButtonState( 1 )  
 
Main()


function exit ()

r.SetMouseModifier( 'MM_CTX_ARRANGE_RMOUSE', 0, 1)-- set right click drag back to marquee select items
reaper.SetToggleCommandState(0, self, 0)
end

reaper.atexit(exit)
reaper.atexit( SetButtonState )
Arthur McArthur is offline   Reply With Quote
Old 01-13-2021, 10:41 AM   #234
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 353
Default

Quote:
Originally Posted by sonictim View Post
I couldn't get your link to work, but I've been working on a protools style implementation of fades with Razor Edit (and also time/item selection).. I put it in my reapack if you want to give it a try.... TJF Smart Fade... The defaults are set to the way I like to work in protools, so you may want to change them

LINK TO MY REAPACK REPOSITORY:
Code:
https://github.com/sonictim/TJF-Scripts/raw/master/index.xml

As the script deals with more than just razor edits, I didn't want to post the whole script here in this forum.

Also, just wanted to say thank you to BirdBird and Amagalma. I was able to develop it from code you had written in this forum... Cheers for that!
Hi. Could you please check why it's not working like it should?

__________________
Arrangement/mixing
Skorobagatko is offline   Reply With Quote
Old 01-13-2021, 06:39 PM   #235
sonictim
Human being with feelings
 
sonictim's Avatar
 
Join Date: Feb 2020
Location: Los Angeles
Posts: 267
Default

Quote:
Originally Posted by Skorobagatko View Post
Hi. Could you please check why it's not working like it should?
It looks to me like you aren't drawing your razor selection past the edge of your item. if your item is selected but there are no edges inside your razor selection rather than do nothing, it will recognize that an item selection has been made and follows the logic (the default fades) for that instead.

That said, I am unable to recreate your issue. Can you please give me more information about the context of the situation? For example, in the following image, I am running Reaper v6.19+dev0111 on macOS Catalina. I am running version 1.3 of the plugin (please update to this version, there was some serious logic rework/updates that were applied). When I drag the razor edit over the edge it fades just fine but when I don't drag the razor edit selection over the edge it doesn't do anything. Please note that in my image, my item is not selected (item turns black when selected as you can see in the first part of the gif) and all fade decisions were made via razor edit selections.

__________________
My Reapack Repository: I write scripts for my own personal use.
I offer no support, but if you find one that helps you, go for it!
sonictim is offline   Reply With Quote
Old 01-14-2021, 10:16 AM   #236
Skorobagatko
Human being with feelings
 
Skorobagatko's Avatar
 
Join Date: Mar 2017
Location: Ukraine, Kyiv
Posts: 353
Default

Quote:
Originally Posted by sonictim View Post
It looks to me like you aren't drawing your razor selection past the edge of your item. if your item is selected but there are no edges inside your razor selection rather than do nothing, it will recognize that an item selection has been made and follows the logic (the default fades) for that instead.

That said, I am unable to recreate your issue. Can you please give me more information about the context of the situation? For example, in the following image, I am running Reaper v6.19+dev0111 on macOS Catalina. I am running version 1.3 of the plugin (please update to this version, there was some serious logic rework/updates that were applied). When I drag the razor edit over the edge it fades just fine but when I don't drag the razor edit selection over the edge it doesn't do anything. Please note that in my image, my item is not selected (item turns black when selected as you can see in the first part of the gif) and all fade decisions were made via razor edit selections.

Reaper v6.19+dev0111 on Windows 10 (latest build)

Pay attention that first I'm using time selection (not razor edit), and it works ok from the left side but wrong from the right side.

Ok I got it, it works properly with the right side if I'm making time selection past the edge (but at the same time it works with left side without passing edge).
__________________
Arrangement/mixing
Skorobagatko is offline   Reply With Quote
Old 01-14-2021, 11:33 AM   #237
sonictim
Human being with feelings
 
sonictim's Avatar
 
Join Date: Feb 2020
Location: Los Angeles
Posts: 267
Default

Quote:
Originally Posted by Skorobagatko View Post
Reaper v6.19+dev0111 on Windows 10 (latest build)

Pay attention that first I'm using time selection (not razor edit), and it works ok from the left side but wrong from the right side.

Ok I got it, it works properly with the right side if I'm making time selection past the edge (but at the same time it works with left side without passing edge).
Are you bringing the time selection exactly to the edge via a specific action, or just drawing to the edge? I’ll double check the time selection logic. Cheers!

UPDATE: I was able to reproduce your bug... I found the issue and have updated the script to v1.4 on reapack. Thanks for catching it!

ALSO, This really isn't the proper place in the forum to be discussing this. As the script support razor edits, I've discussed it here, but I'm going to create a new thread in the Reascript area. Please report any future bugs or issues or discussion there. Thank you very much! https://forum.cockos.com/showthread....08#post2391508
__________________
My Reapack Repository: I write scripts for my own personal use.
I offer no support, but if you find one that helps you, go for it!

Last edited by sonictim; 01-14-2021 at 02:14 PM. Reason: Update
sonictim is offline   Reply With Quote
Old 01-18-2021, 12:45 AM   #238
sonictim
Human being with feelings
 
sonictim's Avatar
 
Join Date: Feb 2020
Location: Los Angeles
Posts: 267
Default Move Razor Edit to New Subproject

I just posted a new script "Move Razor Edits to New Subproject" in my Reapack

It was built to support a post production workflow and offers a number of configuration options inside the script that will allow the user to adjust its behavior to his or her preference (and the ability to disable some bells and whistles).

Key features:

Video Track Copy (will copy your video track for reference)
Timecode Match (will adjust your subproject timecode to match source project & can embed RPP-PROX to match now that Reaper Supports this)
Track Match (will copy track plugins, and other data)
Autoclose subproject (mimics a glue behavior)

Please note this is not a 1.0 release yet as there are still a few ideas/features for it I want to implement. However, I think it's at a point where I'm ready for people to start using it and giving some real world feedback on its function/usability.

Enjoy!

**Due to the unreleased nature of Razor Edits, the functionality of this code could break at anytime.
__________________
My Reapack Repository: I write scripts for my own personal use.
I offer no support, but if you find one that helps you, go for it!
sonictim is offline   Reply With Quote
Old 01-19-2021, 09:08 AM   #239
ferropop
Human being with feelings
 
ferropop's Avatar
 
Join Date: Jan 2016
Location: Winnipeg, CANADA
Posts: 960
Default

You gorgeous brilliant humans...this specific functionality seems like the one big thing missing from the whole Razor/Area feature. Everything else can come with time (ie, taking each Time Selection action and folding it into the more appropriate Razor/Area version) but this we need right away!

How safe is it to run this script? I'm terrified of botching some important projects and I know this is all at-your-own-risk, but scripters - are we pretty safe in using this without fear of corruption?

<3

ferropop is offline   Reply With Quote
Old 01-19-2021, 09:45 AM   #240
ferropop
Human being with feelings
 
ferropop's Avatar
 
Join Date: Jan 2016
Location: Winnipeg, CANADA
Posts: 960
Default

Also julian, shit dude dunno how I missed this. The ability to skew points (almost like photoshop's Smudge tool) is unreal.

Can we just have it all?

Quote:
Originally Posted by juliansader View Post
I have updated my Multi Tool to work across multiple automation lanes, using either razor selections, or AIs.

Perhaps the biggest difference between my script and the examples that Sexan posted here, is that my script regard razor selection as simply another way of selecting points, whereas Sexan's scripts do some extra nifty stuff with edge points and fades, which convert razor selections into isolated parts of the envelope, like a kind of "automation item":

EDIT: If edge points would be useful in my script too, I can add such a feature.

ferropop 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 09:07 PM.


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