Old 08-26-2020, 06:54 AM   #1
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 229
Default Razor Edit Scripts

While the other threads are busy discussing features and implementation details I thought it would be nice to have a thread for experimenting with scripts now that we have access to API.


Here are some wrapper functions around the "basic API" that are hopefully a bit more approachable. (Lua)
This stuff will likely break in the future, but it is nice to have something that makes it easier to play around with razor edits in the meanwhile. Place this at the top of your code:
Code:
function literalize(str)
    return str:gsub("[%(%)%.%%%+%-%*%?%[%]%^%$]", function(c) return "%" .. c end)
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
Moved the explanations/examples over to this post as they no longer fit here: https://forum.cockos.com/showpost.ph...9&postcount=73

Last edited by BirdBird; 09-01-2020 at 04:03 PM.
BirdBird is online now   Reply With Quote
Old 08-26-2020, 02:47 PM   #2
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,897
Default

meo-mespotine will like this code snippets for sure :P




Thanks for sharing !
X-Raym is offline   Reply With Quote
Old 08-27-2020, 12:55 AM   #3
sonictim
Human being with feelings
 
sonictim's Avatar
 
Join Date: Feb 2020
Location: Los Angeles
Posts: 215
Default

I just wrote a very simple one that returns true or false if a Razor Edit exists anywhere in your session....... I don't know how you get those cool code snippet windows. Fortunately my script is short....

Code:
 
function RazorEditSelectionExists()

    for i=0, reaper.CountTracks(0)-1 do

        local retval, x = reaper.GetSetMediaTrackInfo_String(reaper.GetTrack(0,i), "P_RAZOREDITS", "string", false)

        if x ~= "" then return true end

    end--for
    
    return false

end--RazorEditSelectionExists()

Last edited by sonictim; 10-30-2020 at 09:12 AM. Reason: code brackets
sonictim is offline   Reply With Quote
Old 08-27-2020, 02:03 AM   #4
sonictim
Human being with feelings
 
sonictim's Avatar
 
Join Date: Feb 2020
Location: Los Angeles
Posts: 215
Default Link Razor Edit with Item Selection

BirdBird! Thank you...

Using your code, and the code I just posted, I just wrote a quick defer function that will link area selection with item selection. Now I'm using my Razor Edit also as a Marquee Selection! I'm a novice coder (was my first time using defer) so if anyone notices any problems with it, please let me know

Code:
 
function Main()

if RazorEditSelectionExists() then

      local selections = GetRazorEdits()
      for i = 1, #selections do
          local areaData = selections[i]
          local items = areaData.items
          for j = 1, #items do reaper.SetMediaItemSelected(items[j], true) end
      end
end--if

reaper.defer(Main)


end--Main()


Main()
Attached Files
File Type: lua TJF LINK Razor Edit and Item Selection.lua (3.7 KB, 55 views)

Last edited by sonictim; 08-27-2020 at 02:36 PM. Reason: updating code
sonictim is offline   Reply With Quote
Old 08-27-2020, 06:47 AM   #5
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 1,604
Default

Quote:
Originally Posted by X-Raym View Post
meo-mespotine will like this code snippets for sure :P




Thanks for sharing !
How did you know that?


@sonictim

please put [CODE] brackets arounds your code. Just select the code and hit the #-button in the editor. Otherwise, the forum's layouting could break things.
And it's better readable that way.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1294 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 08-27-2020, 06:47 AM   #6
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,897
Default

@sonictim


to emebed mua code on fprum post use [ code][ /code] syntax without spaces. :P
X-Raym is offline   Reply With Quote
Old 08-27-2020, 09:03 AM   #7
foxAsteria
Human being with feelings
 
foxAsteria's Avatar
 
Join Date: Dec 2009
Location: Oblivion
Posts: 7,796
Default

I can't find other threads discussing the feature...what is razor edit?
__________________
My Wyyyrd Music
foxAsteria is online now   Reply With Quote
Old 08-27-2020, 09:11 AM   #8
Funkybot
Human being with feelings
 
Join Date: Jul 2007
Posts: 1,752
Default

Quote:
Originally Posted by foxAsteria View Post
I can't find other threads discussing the feature...what is razor edit?
It's what "Area Selection" was renamed to. You can see the Area Selection discussion thread for more info.
Funkybot is online now   Reply With Quote
Old 08-27-2020, 09:11 AM   #9
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 1,604
Default

If I understood it right, it's the new name of the pre-release-feature formerly known as area-selection.
__________________
Use you/she/her, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1294 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 08-27-2020, 10:16 AM   #10
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 6,897
Default

Here Schwa about this renaming : https://forum.cockos.com/showpost.ph...&postcount=498
X-Raym is offline   Reply With Quote
Old 08-27-2020, 10:36 AM   #11
juan_r
Human being with feelings
 
juan_r's Avatar
 
Join Date: Oct 2019
Posts: 275
Default

It's Area Selection renamed and somewhat repurposed.

OOPS late reply, sorry I left the window open and sent the post later.

Last edited by juan_r; 08-27-2020 at 10:36 AM. Reason: LATE! :)
juan_r is offline   Reply With Quote
Old 08-27-2020, 02:37 PM   #12
sonictim
Human being with feelings
 
sonictim's Avatar
 
Join Date: Feb 2020
Location: Los Angeles
Posts: 215
Default Code brackets

Thanks for telling me how to do that! It works!
sonictim is offline   Reply With Quote
Old 08-29-2020, 12:02 PM   #13
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 229
Default

Something in progress.
BirdBird is online now   Reply With Quote
Old 08-29-2020, 03:30 PM   #14
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 3,988
Default

Fantastic Birdy!
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please consider donating to amagalma cfillion FeedTheCat HeDa Julian Sader lb0 nofish Sexan X-Raym
_Stevie_ is offline   Reply With Quote
Old 08-29-2020, 04:01 PM   #15
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Location: Theeble, GA
Posts: 2,644
Default

that's so cool. this will be an amazingly fast way to slice up and improvise with tempo-mapped phrases. i can't help but imagine ultimately doing this kind of slicing/copying/loop mangling with a control surface, and then diving in with the mouse for the deeper edits.
__________________
FR: option: move AI only when selected, like normal items
** the bugs that bite the hardest - one crustacean's compilation**
MIDI editor: allow scripts/actions to work on all editable takes, as described
mccrabney is offline   Reply With Quote
Old 08-29-2020, 04:30 PM   #16
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 13,120
Default

Quote:
Originally Posted by BirdBird View Post
Something in progress.
Amazing!

I'd love to try this if possible when you're ready to share it!

Do you think it's possible to make a version that when the script is activated uses the currently selected item's start and end points as the start and end of the razor edit?

The reason being is that I often use an empty midi item (or just an empty item) to represent the "contents" of the folder in that area and I was looking for a way to double click this item to activate a script that then selects all the child track items within the same time area as this empty midi item that's on the parent folder track.

Emulating the way folder tracks work in Cubase/Nuendo kind of

If it's possible it could do that or have a version that can automatically "fit" to the selected parent track item, that would be amazing and a dream come true for working with folders in reaper!
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 08-29-2020, 04:41 PM   #17
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 13,120
Default

Hmm. Or maybe you could post that gif in the latest pre release thread and we could ask Justin/Scwha to put this in directly as a mouse modifier as it basically fills in for folders which is one of the last things missing from Reaper that is in most other DAWs now

Basically it's this that I do and then have to move things manually which isn't great. Would love this to be native and razor edits might allow the devs to finally add folders in fully!

__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 08-29-2020, 05:25 PM   #18
Embass
Human being with feelings
 
Embass's Avatar
 
Join Date: Jan 2014
Posts: 468
Default

swipe comping script:
https://drive.google.com/file/d/1ZHE...ew?usp=sharing

Embass is offline   Reply With Quote
Old 08-30-2020, 02:17 AM   #19
Win Conway
Human being with feelings
 
Join Date: Dec 2010
Posts: 3,734
Default

Quote:
Originally Posted by musicbynumbers View Post
Amazing!

I'd love to try this if possible when you're ready to share it!

Do you think it's possible to make a version that when the script is activated uses the currently selected item's start and end points as the start and end of the razor edit?

The reason being is that I often use an empty midi item (or just an empty item) to represent the "contents" of the folder in that area and I was looking for a way to double click this item to activate a script that then selects all the child track items within the same time area as this empty midi item that's on the parent folder track.

Emulating the way folder tracks work in Cubase/Nuendo kind of

If it's possible it could do that or have a version that can automatically "fit" to the selected parent track item, that would be amazing and a dream come true for working with folders in reaper!
A script that takes a visual render of the folder contents peaks and then loads it into an empty item would work fine too.
__________________
Stop posting huge images, smaller images or thumbnail, it's not rocket science!
Win Conway is offline   Reply With Quote
Old 08-30-2020, 02:38 AM   #20
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Posts: 3,988
Default

Quote:
Originally Posted by Embass View Post
Holy Batman!!!!!
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please consider donating to amagalma cfillion FeedTheCat HeDa Julian Sader lb0 nofish Sexan X-Raym
_Stevie_ is offline   Reply With Quote
Old 08-30-2020, 03:08 AM   #21
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 13,120
Default

Quote:
Originally Posted by Win Conway View Post
A script that takes a visual render of the folder contents peaks and then loads it into an empty item would work fine too.
That would be a nice extra yes.

As long as we get to define the start and end of the parent folder's start and end still as I wouldn't want any gaps in the child items breaking the parent folder item into multiple smaller ones.

Say if the folder contained a few drum hits, I wouldn't want the gaps in between to break up the parent folder into smaller bits.

It must act as a container/manager for all the "little bits"
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 08-30-2020, 03:08 AM   #22
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 13,120
Default

Quote:
Originally Posted by Embass View Post
That looks awesome!

Hope you will consider putting it in Reapack when razor edit is released.
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.

Last edited by musicbynumbers; 08-30-2020 at 03:56 AM.
musicbynumbers is offline   Reply With Quote
Old 08-30-2020, 03:22 AM   #23
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,877
Default

Some testing fun with envelopes:




Last edited by Sexan; 08-30-2020 at 03:55 AM.
Sexan is offline   Reply With Quote
Old 08-30-2020, 03:52 AM   #24
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 13,120
Default

Nice work Sexan! Looks very useful
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 08-30-2020, 04:07 AM   #25
Embass
Human being with feelings
 
Embass's Avatar
 
Join Date: Jan 2014
Posts: 468
Default

Quote:
Originally Posted by musicbynumbers View Post
The reason being is that I often use an empty midi item (or just an empty item) to represent the "contents" of the folder in that area and I was looking for a way to double click this item to activate a script that then selects all the child track items within the same time area as this empty midi item that's on the parent folder track.
Select 1 media item and run this script.

Code:
-- Author: Embass
-- v0.1

-- enable this option if you want to select automation too.. 
-- Options: Move envelope points with media items and razor edits

local media_items_count = reaper.CountSelectedMediaItems(0)
if media_items_count ~= 1 then  
	local mouse_x, mouse_y = reaper.GetMousePosition()
	reaper.TrackCtl_SetToolTip("Select 1 media item", mouse_x + 15, mouse_y, true)
	return -- terminate script
end

local media_item = reaper.GetSelectedMediaItem(0, 0)
if media_item == nil then return end -- terminate script

local track = reaper.GetMediaItem_Track(media_item)
if track == nil then return end -- terminate script

local media_item_start = reaper.GetMediaItemInfo_Value(media_item, "D_POSITION")
local media_item_len = reaper.GetMediaItemInfo_Value(media_item, "D_LENGTH")
local media_item_end = media_item_start + media_item_len

if media_item_len == 0 then return end -- terminate script

function get_folder_tracks(folder_track) --> folder_tracks
	local all_tracks = {}
	table.insert(all_tracks, folder_track)
	if reaper.GetMediaTrackInfo_Value(folder_track, "I_FOLDERDEPTH") ~= 1 then
		return all_tracks -- exit, track not a folder
	end
	local tracks_count = reaper.CountTracks(0)
	local folder_track_depth = reaper.GetTrackDepth(folder_track)	
	local track_index = reaper.GetMediaTrackInfo_Value(folder_track, "IP_TRACKNUMBER")
	for i = track_index, tracks_count - 1 do
		local track = reaper.GetTrack(0, i)
		local track_depth = reaper.GetTrackDepth(track)
		if track_depth > folder_track_depth then			
			table.insert(all_tracks, track)
		else
			break -- exit loop
		end
	end
	return all_tracks
end

local folder_tracks = get_folder_tracks(track)

reaper.PreventUIRefresh(1)
reaper.Undo_BeginBlock()

	reaper.Main_OnCommand(42406, 0) -- Razor edit: Clear all areas
	local str_area = string.format([[%s %s '']], media_item_start, media_item_end)
	for i, track in ipairs(folder_tracks) do
		reaper.GetSetMediaTrackInfo_String(track, "P_RAZOREDITS", str_area, true)	
	end

reaper.Undo_EndBlock("Set area selection", -1)
reaper.PreventUIRefresh(-1)
reaper.UpdateArrange()
Embass is offline   Reply With Quote
Old 08-30-2020, 04:11 AM   #26
Win Conway
Human being with feelings
 
Join Date: Dec 2010
Posts: 3,734
Default

Quote:
Originally Posted by musicbynumbers View Post
That would be a nice extra yes.

As long as we get to define the start and end of the parent folder's start and end still as I wouldn't want any gaps in the child items breaking the parent folder item into multiple smaller ones.

Say if the folder contained a few drum hits, I wouldn't want the gaps in between to break up the parent folder into smaller bits.

It must act as a container/manager for all the "little bits"
Yeah, it would be one of my most used scripts for sure.
__________________
Stop posting huge images, smaller images or thumbnail, it's not rocket science!
Win Conway is offline   Reply With Quote
Old 08-30-2020, 04:19 AM   #27
Win Conway
Human being with feelings
 
Join Date: Dec 2010
Posts: 3,734
Default

Quote:
Originally Posted by Sexan View Post
Some testing fun with envelopes:

ImgSnip
Oh crap, do a version of this that automagically does grid based REs across an automation item, then just shows a simple panel with on/off switches for each RE (off = 0, on = left as is) you just created the ultimate trance/step gate maker!!
__________________
Stop posting huge images, smaller images or thumbnail, it's not rocket science!
Win Conway is offline   Reply With Quote
Old 08-30-2020, 05:05 AM   #28
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,877
Default

Sexan is offline   Reply With Quote
Old 08-30-2020, 05:23 AM   #29
Odys
Human being with feelings
 
Join Date: Dec 2019
Posts: 133
Default

This RE thing gonna be a NUKE Love you guys <3
Odys is offline   Reply With Quote
Old 08-30-2020, 06:28 AM   #30
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 13,120
Default

Quote:
Originally Posted by Embass View Post
Select 1 media item and run this script.
Thank you so much! That's made my year!

I added it to mouse modifiers so double clicking on an item's bottom half activates the script and it works amazingly well!

Happy to donate if you have a donation page!
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 08-30-2020, 06:48 AM   #31
Vagelis
Human being with feelings
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 994
Default

You guys are nuts! Freaking amazing start!
Vagelis is offline   Reply With Quote
Old 08-30-2020, 07:24 AM   #32
Vagelis
Human being with feelings
 
Join Date: Oct 2017
Location: Larisa, Greece
Posts: 994
Default

@Embass,could you make the swipe comping script so that it mute each part below after comping it? This would be useful when playback to listen only the top lane.
Vagelis is offline   Reply With Quote
Old 08-30-2020, 07:34 AM   #33
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 13,120
Default

Quote:
Originally Posted by Vagelis View Post
@Embass,could you make the swipe comping script so that it mute each part below after comping it? This would be useful when playback to listen only the top lane.
Wouldn't this then have to cut the item to then mute it which would make further edits a bit messier.

I too though was thinking of the best way to use it and if you put the takes in as child tracks and turn the child track volumes down (or mute) then you would only hear the parent destination track anyway.

Then when finished just collapse the folder and done

Also, you could use the SWS action to solo audition the item under the mouse to hear the takes on their own before selecting them although not that useful out of context maybe

The other thing was to then create crossfades afterwards on the destination items but I think we have scripts for that too.
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 08-30-2020, 08:43 AM   #34
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,877
Default



Adding compress/expand as we speak
Sexan is offline   Reply With Quote
Old 08-30-2020, 08:49 AM   #35
Funkybot
Human being with feelings
 
Join Date: Jul 2007
Posts: 1,752
Default

Great stuff in here! Particularly impressed with the swipe comping (just wish it worked in lanes) and Sexan's envelope transform scripts.
Funkybot is online now   Reply With Quote
Old 08-30-2020, 09:31 AM   #36
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 229
Default

Quote:
Originally Posted by musicbynumbers View Post
Amazing!

I'd love to try this if possible when you're ready to share it!
Ill attach it down below, it is just a proof of concept so there might be bugs

Quote:
Do you think it's possible to make a version that when the script is activated uses the currently selected item's start and end points as the start and end of the razor edit?

The reason being is that I often use an empty midi item (or just an empty item) to represent the "contents" of the folder in that area and I was looking for a way to double click this item to activate a script that then selects all the child track items within the same time area as this empty midi item that's on the parent folder track.

Emulating the way folder tracks work in Cubase/Nuendo kind of


If it's possible it could do that or have a version that can automatically "fit" to the selected parent track item, that would be amazing and a dream come true for working with folders in reaper!
It should be possible to make but I am not sure if it is possible to get it to a usable state with items without too many "hacks", at which point id probably not use it myself.

Last edited by BirdBird; 08-30-2020 at 10:06 AM.
BirdBird is online now   Reply With Quote
Old 08-30-2020, 09:52 AM   #37
mccrabney
Human being with feelings
 
mccrabney's Avatar
 
Join Date: Aug 2015
Location: Theeble, GA
Posts: 2,644
Default

sexan, would those envelope scripts work with AI in medialane?
__________________
FR: option: move AI only when selected, like normal items
** the bugs that bite the hardest - one crustacean's compilation**
MIDI editor: allow scripts/actions to work on all editable takes, as described
mccrabney is offline   Reply With Quote
Old 08-30-2020, 09:55 AM   #38
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 13,120
Default

Thanks BirdBird!

Embass script is basically fulfilling my needs regarding using an item to represent the folder overview but your script definitely has uses too for various other things so I'll give it a try too when time.
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 08-30-2020, 10:31 AM   #39
Sexan
Human being with feelings
 
Sexan's Avatar
 
Join Date: Jun 2009
Location: Croatia
Posts: 2,877
Default

Quote:
Originally Posted by mccrabney View Post
sexan, would those envelope scripts work with AI in medialane?
Its not working on AIs, API does not provide AI.

Anyway if anyone wants to play around (its early version, maybe buggy)

Needs JS API, add shortcut to it. It works on press and hold so:

press and hold shortcut and do stuff, release to stop

Mouse in RE = trim envelope
Mouse outside RE (left or right) wraps envelope
Attached Files
File Type: lua RazorENV.lua (12.1 KB, 52 views)

Last edited by Sexan; 08-30-2020 at 10:53 AM.
Sexan is offline   Reply With Quote
Old 08-30-2020, 10:51 AM   #40
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 10,026
Default

Quote:
Originally Posted by Sexan View Post
API does not provide AI.
For sure Reaper has an API to work with AI (e.g. CountAutomationItems, GetSetAutomationItemInfo, SetEnvelopePointEx etc.) or did I misunderstand?
nofish 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 10:44 PM.


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