Skip to content

Commit

Permalink
Committing changes from script
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvonkaenel committed Dec 11, 2024
1 parent 1e3af56 commit 0a6bfa6
Show file tree
Hide file tree
Showing 110 changed files with 129 additions and 79 deletions.
Binary file modified AUTODOPPLER/Data/functions.dat
Binary file not shown.
Binary file modified AUTODOPPLER/Data/scripts/autodoppler/data/gui.dat
Binary file not shown.
Binary file modified AUTODOPPLER/Data53/functions.dat
Binary file not shown.
Binary file modified CREATE/Data/scripts/create/data/soundminer.dat
Binary file not shown.
Binary file modified CREATE/Data/scripts/create/main.dat
Binary file not shown.
Binary file modified CREATE/Data53/scripts/create/data/soundminer.dat
Binary file not shown.
Binary file modified CREATE/Data53/scripts/create/main.dat
Binary file not shown.
2 changes: 1 addition & 1 deletion CREATE/nvk_CREATE.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--[[
Description: nvk_CREATE
Version: 1.9.0
Version: 1.9.1
About:
# nvk_CREATE
Expand Down
Binary file modified FOLDER_ITEMS/Data/folder_items.dat
Binary file not shown.
Binary file modified FOLDER_ITEMS/Data/functions.dat
Binary file not shown.
Binary file modified FOLDER_ITEMS/Data/scripts/rename/data/input.dat
Binary file not shown.
Binary file modified FOLDER_ITEMS/Data/scripts/rename/data/targets.dat
Binary file not shown.
Binary file modified FOLDER_ITEMS/Data/scripts/render_smart/data/render_list.dat
Binary file not shown.
Binary file modified FOLDER_ITEMS/Data/scripts/settings/data/tabs.dat
Binary file not shown.
Binary file modified FOLDER_ITEMS/Data53/folder_items.dat
Binary file not shown.
Binary file modified FOLDER_ITEMS/Data53/functions.dat
Binary file not shown.
Binary file modified FOLDER_ITEMS/Data53/scripts/rename/data/input.dat
Binary file not shown.
Binary file modified FOLDER_ITEMS/Data53/scripts/rename/data/targets.dat
Binary file not shown.
Binary file modified FOLDER_ITEMS/Data53/scripts/render_smart/data/render_list.dat
Binary file not shown.
Binary file modified FOLDER_ITEMS/Data53/scripts/settings/data/tabs.dat
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ run(function()
end
end
local track_folder_items = track:FolderItems(columns)
local name, name_id -- name id not used since we aren't worry about markers
local name -- name id not used since we aren't worry about markers
for _, col in ipairs(columns) do
local folder_item = track_folder_items:ColumnOverlap(col)
if folder_item then
name, name_id = FolderItem.NameFormat(folder_item.name, names)
FolderItem.Create(track, col, disableAutoName and folder_item.name or name, folder_item)
name = FolderItem.NameFormat(folder_item.name, names)
FolderItem.Create(track, col, FOLDER_ITEMS_DISABLE_AUTO_NAMING and folder_item.name or name, folder_item)
else
name, name_id = FolderItem.NameFormat(disableAutoName and ' ' or name, names)
name = FolderItem.NameFormat(FOLDER_ITEMS_DISABLE_AUTO_NAMING and ' ' or name, names)
folder_item = FolderItem.Create(track, col, name)
end
end
Expand Down
39 changes: 24 additions & 15 deletions FOLDER_ITEMS/nvk_FOLDER_ITEMS - Fade in.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,21 @@ dofile(DATA_PATH .. 'functions.dat')
if not functionsLoaded then return end
-- SCRIPT ---
local r = reaper
---@param item Item
---@param cursorPos number
local function fadein(item, cursorPos)
if cursorPos > item.e then
item.fadeinpos = item.e - defaultFadeLen
item.fadeinpos = item.e - FADE_LENGTH_MIN
elseif cursorPos < item.pos then
item.fadeinlen = defaultFadeLen
item.fadeinlen = FADE_LENGTH_MIN
else
item.fadeinpos = cursorPos
end
if not item.folder and FADE_OVERSHOOT then item:FadeOvershoot() end
end

---@param track MediaTrack
---@return TrackEnvelope
local function get_vol_env(track)
local env = r.GetTrackEnvelopeByName(track, 'Volume')
if not env then
Expand All @@ -32,13 +36,14 @@ local function get_vol_env(track)
return env
end

---@param item Item
local function fadein_auto(item)
local itemFadeIn = item.fadeinlen >= item.len and item.len - 0.00001 or item.fadeinlen
local itemFadeOut = item.fadeoutlen >= item.len and item.len - 0.00001 or item.fadeoutlen
local itemFadeInDir = item.fadeindir * 0.75
local itemFadeOutDir = item.fadeoutdir * 0.75
if itemFadeOut == defaultFadeLen then itemFadeOut = 0 end
if itemFadeIn == defaultFadeLen then itemFadeIn = 0 end
if itemFadeOut == FADE_LENGTH_MIN then itemFadeOut = 0 end
if itemFadeIn == FADE_LENGTH_MIN then itemFadeIn = 0 end
local fadeInEnd = item.pos + itemFadeIn
local fadeOutStart = item.pos + item.len - itemFadeOut
local track = item.track.track
Expand All @@ -47,17 +52,21 @@ local function fadein_auto(item)
if autoitemIdx then
r.Main_OnCommand(40769, 0) -- unselect all tracks/items/env
r.GetSetAutomationItemInfo(env, autoitemIdx, 'D_UISEL', 1, true)
---@diagnostic disable-next-line
local retval, time, value, shape, tension, selected = r.GetEnvelopePointEx(env, autoitemIdx, 3)
if retval then
---@diagnostic disable-next-line
retval, time, value, shape, tension, selected = r.GetEnvelopePointEx(env, autoitemIdx, 2)
if retval then
itemFadeOut = item.e - time
fadeOutStart = time
itemFadeOutDir = tension
end
else
---@diagnostic disable-next-line
retval, time, value, shape, tension, selected = r.GetEnvelopePointEx(env, autoitemIdx, 2)
if retval then
---@diagnostic disable-next-line
retval, time, value, shape, tension, selected = r.GetEnvelopePointEx(env, autoitemIdx, 1)
itemFadeOutDir = tension
end
Expand All @@ -72,9 +81,9 @@ local function fadein_auto(item)
local fadeInCurve = itemFadeInDir == 0 and 0 or 5
local fadeOutCurve = itemFadeOutDir == 0 and 0 or 5
if itemFadeIn > 0 then
r.InsertEnvelopePointEx(env, autoitemIdx, item.pos, 0, fadeInCurve, itemFadeInDir, 0, true)
r.InsertEnvelopePointEx(env, autoitemIdx, item.pos, 0, fadeInCurve, itemFadeInDir, false, true)
if fadeOutStart > fadeInEnd then
r.InsertEnvelopePointEx(env, autoitemIdx, fadeInEnd, 1, 0, 0, 0, true)
r.InsertEnvelopePointEx(env, autoitemIdx, fadeInEnd, 1, 0, 0, false, true)
else
r.InsertEnvelopePointEx(env, autoitemIdx, fadeInEnd, 1, fadeOutCurve, itemFadeOutDir, false, true)
end
Expand All @@ -90,20 +99,20 @@ local function fadein_auto(item)
end

run(function()
local item, cursorPos = Item.NearestToMouse()
if not item or not cursorPos then return end
if item.folder then
local mouseItem, cursorPos = Item.NearestToMouse()
if not mouseItem or not cursorPos then return end
if mouseItem.folder then
if FADE_FOLDER_ENVELOPE then
item.fadeinpos = cursorPos
fadein(item, cursorPos)
fadein_auto(item)
item:GroupSelect(true, true)
mouseItem.fadeinpos = cursorPos
fadein(mouseItem, cursorPos)
fadein_auto(mouseItem)
mouseItem:GroupSelect(true, true)
return
else
item:GroupSelect(true, true)
mouseItem:GroupSelect(true, true)
end
else
item:Select(true)
mouseItem:Select(true)
end

local items = Items.Selected()
Expand Down
37 changes: 22 additions & 15 deletions FOLDER_ITEMS/nvk_FOLDER_ITEMS - Fade out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ dofile(DATA_PATH .. 'functions.dat')
if not functionsLoaded then return end
-- SCRIPT ---
local r = reaper

---@param item Item
---@param cursorPos number
local function fadeout(item, cursorPos)
if cursorPos < item.s then
item.fadeoutpos = item.s + defaultFadeLen
item.fadeoutpos = item.s + FADE_LENGTH_MIN
elseif cursorPos > item.e then
item.fadeoutlen = defaultFadeLen
item.fadeoutlen = FADE_LENGTH_MIN
else
item.fadeoutpos = cursorPos
end
if not item.folder and FADE_OVERSHOOT then item:FadeOvershoot() end
end
---@param track MediaTrack
---@return TrackEnvelope
local function get_vol_env(track)
local env = r.GetTrackEnvelopeByName(track, 'Volume')
if not env then
Expand All @@ -32,13 +35,14 @@ local function get_vol_env(track)
return env
end

---@param item Item
local function fadeout_auto(item)
local itemFadeIn = item.fadeinlen >= item.len and item.len - 0.00001 or item.fadeinlen
local itemFadeOut = item.fadeoutlen >= item.len and item.len - 0.00001 or item.fadeoutlen
local itemFadeInDir = item.fadeindir * 0.5
local itemFadeOutDir = item.fadeoutdir * 0.5
if itemFadeOut == defaultFadeLen then itemFadeOut = 0 end
if itemFadeIn == defaultFadeLen then itemFadeIn = 0 end
if itemFadeOut == FADE_LENGTH_MIN then itemFadeOut = 0 end
if itemFadeIn == FADE_LENGTH_MIN then itemFadeIn = 0 end
local fadeInEnd = item.pos + itemFadeIn
local fadeOutStart = item.pos + item.len - itemFadeOut
local track = item.track.track
Expand All @@ -47,10 +51,13 @@ local function fadeout_auto(item)
if autoitemIdx then
r.Main_OnCommand(40769, 0) -- unselect all tracks/items/env
r.GetSetAutomationItemInfo(env, autoitemIdx, 'D_UISEL', 1, true)
---@diagnostic disable-next-line
local retval, time, value, shape, tension, selected = r.GetEnvelopePointEx(env, autoitemIdx, 2)
if retval then
---@diagnostic disable-next-line
retval, time, value, shape, tension, selected = r.GetEnvelopePointEx(env, autoitemIdx, 0)
if retval then itemFadeInDir = tension end
---@diagnostic disable-next-line
retval, time, value, shape, tension, selected = r.GetEnvelopePointEx(env, autoitemIdx, 1)
if retval then
itemFadeIn = time - item.pos
Expand Down Expand Up @@ -85,21 +92,21 @@ local function fadeout_auto(item)
end

run(function()
local item, cursorPos = Item.NearestToMouse()
if not item or not cursorPos then return end
if item.folder then
local mouseItem, cursorPos = Item.NearestToMouse()
if not mouseItem or not cursorPos then return end
if mouseItem.folder then
if FADE_FOLDER_ENVELOPE then
item.fadeoutpos = cursorPos
fadeout(item, cursorPos)
fadeout_auto(item)
item:GroupSelect(true, true)
item.sel = true
mouseItem.fadeoutpos = cursorPos
fadeout(mouseItem, cursorPos)
fadeout_auto(mouseItem)
mouseItem:GroupSelect(true, true)
mouseItem.sel = true
return
else
item:GroupSelect(true, true)
mouseItem:GroupSelect(true, true)
end
else
item:Select(true)
mouseItem:Select(true)
end

local items = Items.Selected()
Expand Down
2 changes: 1 addition & 1 deletion FOLDER_ITEMS/nvk_FOLDER_ITEMS - Remove.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if not functionsLoaded then return end
run(function()
local x, y = r.GetMousePosition()
local item = Item(r.GetItemFromPoint(x, y, false))
if item then return item:DeleteVolumeAutoItem():GroupItems(true):Delete() end
if item then return item:DeleteVolumeAutoItem():ChildItems(true):Delete() end
local mediaTrack, info = r.GetThingFromPoint(x, y)
if mediaTrack and info then
local track = Track(mediaTrack)
Expand Down
22 changes: 10 additions & 12 deletions FOLDER_ITEMS/nvk_FOLDER_ITEMS - Split.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ if not functionsLoaded then return end
-- SCRIPT --
local r = reaper
run(function()
cursorPos = r.GetCursorPosition()
item = GetItemUnderMouseCursor()
if item then
r.Main_OnCommand(40289, 0) -- unselect all items
r.SetMediaItemSelected(item, true)
groupSelect(item)
local items = Items()
r.Main_OnCommand(40513, 0) -- move edit cursor to mouse cursor
r.Main_OnCommand(40757, 0) -- split items at edit cursor (select right)
r.SetEditCurPos(cursorPos, false, false)
items.sel = false
else
local cursorPos = r.GetCursorPosition()
local item = Item.UnderMouse()
if not item then
r.Main_OnCommand(40759, 0) -- split at edit cursor (select right)
return
end
item:GroupSelect(true, true)
local items = Items()
r.Main_OnCommand(40513, 0) -- move edit cursor to mouse cursor
r.Main_OnCommand(40757, 0) -- split items at edit cursor (select right)
r.SetEditCurPos(cursorPos, false, false)
items:Unselect()
end)
12 changes: 6 additions & 6 deletions FOLDER_ITEMS/nvk_FOLDER_ITEMS - Trim left edge.lua
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ run(function()
item.sel = true
local diff = item.s - cursorPos
local newFadeIn = item.fadeinlen + diff
if newFadeIn < 0 then newFadeIn = defaultFadeLen end
if newFadeIn < 0 then newFadeIn = FADE_LENGTH_MIN end

if i > 1 then
if item.e <= cursorPos then
Expand All @@ -76,17 +76,17 @@ run(function()
end

TrimVolumeAutomationItemFromLeft(item.item, cursorPos, initItemPos)
if (keepFadeOutTimeWhenExtending and diff > 0) or keepFadeOutTimeAlways then
if relativeFadeTime then
if item.fadeinlen > defaultFadeLen then
if (FADE_PRESERVE_LENGTH_EXTENDING and diff > 0) or FADE_PRESERVE_LENGTH_ALWAYS then
if FADE_RELATIVE then
if item.fadeinlen > FADE_LENGTH_MIN then
item.fadeinlen = item.fadeinlen * (item.len / initItemLen)
end
if item.fadeoutlen > defaultFadeLen then
if item.fadeoutlen > FADE_LENGTH_MIN then
item.fadeoutlen = item.fadeoutlen * (item.len / initItemLen)
end
end
else
if item.fadeinlen > defaultFadeLen then item.fadeinlen = newFadeIn end
if item.fadeinlen > FADE_LENGTH_MIN then item.fadeinlen = newFadeIn end
end
end
if (#items > 1 and i > 1) or (#items == 1 and not item.folder) then
Expand Down
12 changes: 6 additions & 6 deletions FOLDER_ITEMS/nvk_FOLDER_ITEMS - Trim right edge.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ run(function()
local itemLength = item.len
local diff = item.e - cursorPos
local newFadeOut = item.fadeoutlen - diff
if newFadeOut < 0 then newFadeOut = defaultFadeLen end
if newFadeOut < 0 then newFadeOut = FADE_LENGTH_MIN end
if i > 1 and item.s >= cursorPos then
item.automute = true
else
Expand All @@ -72,17 +72,17 @@ run(function()
item.len = itemLength - diff
end
TrimVolumeAutomationItem(item.item)
if keepFadeOutTimeWhenExtending and diff < 0 or keepFadeOutTimeAlways then
if relativeFadeTime then
if item.fadeinlen > defaultFadeLen then
if FADE_PRESERVE_LENGTH_EXTENDING and diff < 0 or FADE_PRESERVE_LENGTH_ALWAYS then
if FADE_RELATIVE then
if item.fadeinlen > FADE_LENGTH_MIN then
item.fadeinlen = item.fadeinlen * (item.len / itemLength)
end
if item.fadeoutlen > defaultFadeLen then
if item.fadeoutlen > FADE_LENGTH_MIN then
item.fadeoutlen = item.fadeoutlen * (item.len / itemLength)
end
end
else
if item.fadeoutlen > defaultFadeLen then item.fadeoutlen = newFadeOut end
if item.fadeoutlen > FADE_LENGTH_MIN then item.fadeoutlen = newFadeOut end
end
end
end
Expand Down
14 changes: 10 additions & 4 deletions FOLDER_ITEMS/nvk_FOLDER_ITEMS.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--[[
Description: nvk_FOLDER_ITEMS
Version: 2.9.5
Version: 2.9.7
About:
# nvk_FOLDER_ITEMS
Expand All @@ -10,6 +10,12 @@ Links:
Store Page https://gum.co/nvk_WORKFLOW
User Guide https://nvk.tools/docs/workflow/folder_items
Changelog:
2.9.7
Capitalize first no longer capitalizes letters after numbers (i.e. 9mm was being capitalized to 9Mm)
Disable hyphens in UCS since it breaks the parser (this probably shouldn't be allowed by the spec anyways)
2.9.6
Refactoring - make sure to update all other scripts to latest
Removing logic in render item selection that prevented items on muted tracks from being selected since it could prevent items on tracks with certain types of automation from being selected
2.9.5
Added option to disable numbering for single item in rename script
2.9.4
Expand Down Expand Up @@ -104,17 +110,17 @@ local function Main()
SETTINGS_LOADED = false
end
local itemCount = r.CountSelectedMediaItems(0)
if itemCount == 1 and context == 1 and autoSelect and mouseState == 1 then -- if mouse down
if itemCount == 1 and context == 1 and FOLDER_ITEMS_AUTO_SELECT and mouseState == 1 then -- if mouse down
GroupSelectCheck(r.GetSelectedMediaItem(0, 0))
elseif projUpdate and mouseState == 0 then -- if mouse is not down
if autoSelect and context >= 0 then
if FOLDER_ITEMS_AUTO_SELECT and context >= 0 then
for i = 0, itemCount - 1 do
GroupSelectCheck(r.GetSelectedMediaItem(0, i))
end
end
end
if projUpdate and itemCount == r.CountSelectedMediaItems(0) then
if disableFolderItems then
if FOLDER_ITEMS_DISABLE then
if settingsChanged then FolderItems.ClearMarkers() end
else
FolderItems.Fix(true)
Expand Down
Binary file modified ITEMS/Data/functions.dat
Binary file not shown.
Binary file modified ITEMS/Data53/functions.dat
Binary file not shown.
2 changes: 1 addition & 1 deletion ITEMS/nvk_ITEMS - Copy item positions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ if not functionsLoaded then return end
run(function()
local items = Items()
if #items == 0 then return end
r.SetExtState('nvk_copyPaste', 'itemPositions', table.concat(items.pos, ','), false)
r.SetExtState('nvk_copyPaste', 'itemPositions', table.concat(items.positions, ','), false)
end)
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if mousePos >= 0 then
local track = Track.UnderMouse()
local items = track and track:Items():Selected()
if items and #items > 0 then
local nearestEdge, isEnd = items:NearestEdge(mousePos)
local nearestEdge, isEnd = items:NearestEdge(mousePos, true)
if nearestEdge then MOUSEWHEEL_FADECURVE_OUT = isEnd end
end
end
Expand Down
2 changes: 1 addition & 1 deletion ITEMS/nvk_ITEMS - Fade curve SMART (mousewheel).lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if mousePos >= 0 then
local track = Track.UnderMouse()
local items = track and track:Items():Selected()
if items and #items > 0 then
local nearestEdge, isEnd = items:NearestEdge(mousePos)
local nearestEdge, isEnd = items:NearestEdge(mousePos, true)
if nearestEdge then MOUSEWHEEL_FADECURVE_OUT = isEnd end
end
end
Expand Down
Loading

0 comments on commit 0a6bfa6

Please sign in to comment.