Skip to content

Commit

Permalink
Merge branch 'ReaTeam:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
GoranKovac authored Sep 26, 2024
2 parents 1dc3a0e + 6785aa7 commit a648dd5
Show file tree
Hide file tree
Showing 33 changed files with 6,110 additions and 927 deletions.
77 changes: 66 additions & 11 deletions FX/80icio_Floating FX bypass toggle.lua
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
-- @description Floating FX bypass toggle
-- @author 80icio
-- @version 1.0
-- @version 1.1
-- @changelog - Added toggle wet knob function
-- @about
-- This script let you toggle any visible floating FX bypass.
-- track FX, take FX, input FX or fx chain focused FX
-- Please install IMGUI library
--
-- Thanks to BirdBird & Tycho


r = reaper

dofile(r.GetResourcePath() .. '/Scripts/ReaTeam Extensions/API/imgui.lua') ('0.8.1')
Expand All @@ -29,23 +31,26 @@ TakeFX = str_to_bool(r.GetExtState(scriptname,'TakeFX') ) or false

ChainFXwndw = str_to_bool(r.GetExtState(scriptname,'ChainFXwndw') ) or false

WetToggle = str_to_bool(r.GetExtState(scriptname,'WetToggle') ) or false


function exit()
r.SetExtState(scriptname,'trkFX',tostring(trkFX),true)
r.SetExtState(scriptname,'TakeFX',tostring(TakeFX),true)
r.SetExtState(scriptname,'InpFX',tostring(InpFX),true)
r.SetExtState(scriptname,'ChainFXwndw',tostring(ChainFXwndw),true)
r.SetExtState(scriptname,'WetToggle',tostring(WetToggle),true)
end



ctx = r.ImGui_CreateContext(scriptname)

function TFB_GUI()
r.ImGui_SetNextWindowSize( ctx, 220, 105)
r.ImGui_SetNextWindowSize( ctx, 300, 80)
local visible, open = r.ImGui_Begin(ctx, scriptname, true, r.ImGui_WindowFlags_NoResize() | r.ImGui_WindowFlags_NoScrollbar())
if visible then
r.ImGui_BeginTable(ctx, 'options', 2, r.ImGui_TableFlags_SizingStretchProp() )
r.ImGui_BeginTable(ctx, 'options', 3, r.ImGui_TableFlags_SizingStretchProp() )
r.ImGui_TableNextColumn(ctx)

_, trkFX = r.ImGui_Checkbox( ctx, 'Track FX', trkFX )
Expand All @@ -55,10 +60,16 @@ function TFB_GUI()

_, TakeFX = r.ImGui_Checkbox( ctx, 'Take FX ', TakeFX )
_, ChainFXwndw = r.ImGui_Checkbox( ctx, 'Chain FX', ChainFXwndw )
r.ImGui_EndTable(ctx)

r.ImGui_TableNextColumn(ctx)

_, WetToggle = r.ImGui_Checkbox( ctx, 'Toggle Wet', WetToggle )
toggleBttn = r.ImGui_Button(ctx,'TOGGLE', -1)

r.ImGui_EndTable(ctx)




r.ImGui_End(ctx)
end
Expand All @@ -67,7 +78,7 @@ function TFB_GUI()
end
---------------------------------------END GUI--------------------------
if toggleBttn and (trkFX or InpFX or TakeFX or ChainFXwndw) then
reaper.ClearConsole()

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

Expand All @@ -84,13 +95,29 @@ reaper.ClearConsole()
if trkFX then

if r.TrackFX_GetFloatingWindow( track, index ) then
r.TrackFX_SetEnabled(track, index, not r.TrackFX_GetEnabled(track, index))
if WetToggle then
local wetparam = r.TrackFX_GetParamFromIdent( track, index, ":wet" )
local wetparam_value = r.TrackFX_GetParam(track, index, wetparam)
local wetparam_value = math.floor(wetparam_value + 0.5)
r.TrackFX_SetParam(track, index, wetparam, math.abs(wetparam_value -1) )
else
r.TrackFX_SetEnabled(track, index, not r.TrackFX_GetEnabled(track, index))
end
end
end

if ChainFXwndw then
if index == chainfltngfx then
r.TrackFX_SetEnabled(track, chainfltngfx, not r.TrackFX_GetEnabled(track, chainfltngfx))

if WetToggle then
local wetparam = r.TrackFX_GetParamFromIdent( track, chainfltngfx, ":wet" )
local wetparam_value = r.TrackFX_GetParam(track, chainfltngfx, wetparam)
local wetparam_value = math.floor(wetparam_value + 0.5)
r.TrackFX_SetParam(track, chainfltngfx, wetparam, math.abs(wetparam_value -1) )
else
r.TrackFX_SetEnabled(track, chainfltngfx, not r.TrackFX_GetEnabled(track, chainfltngfx))
end

end
end
--end
Expand All @@ -102,13 +129,27 @@ reaper.ClearConsole()
if InpFX then

if r.TrackFX_GetFloatingWindow(track, index + 0x1000000) then
r.TrackFX_SetEnabled(track, index + 0x1000000, not r.TrackFX_GetEnabled(track, index + 0x1000000 ))
if WetToggle then
local wetparam = r.TrackFX_GetParamFromIdent( track, index + 0x1000000, ":wet" )
local wetparam_value = r.TrackFX_GetParam(track, index + 0x1000000, wetparam)
local wetparam_value = math.floor(wetparam_value + 0.5)
r.TrackFX_SetParam(track, index + 0x1000000, wetparam, math.abs(wetparam_value -1) )
else
r.TrackFX_SetEnabled(track, index + 0x1000000, not r.TrackFX_GetEnabled(track, index + 0x1000000 ))
end
end
end

if ChainFXwndw then
if index == INchainfltngfx then
r.TrackFX_SetEnabled(track, INchainfltngfx + 0x1000000, not r.TrackFX_GetEnabled(track, INchainfltngfx + 0x1000000))
if WetToggle then
local wetparam = r.TrackFX_GetParamFromIdent( track, INchainfltngfx + 0x1000000, ":wet" )
local wetparam_value = r.TrackFX_GetParam(track, INchainfltngfx + 0x1000000, wetparam)
local wetparam_value = math.floor(wetparam_value + 0.5)
r.TrackFX_SetParam(track, INchainfltngfx + 0x1000000, wetparam, math.abs(wetparam_value -1) )
else
r.TrackFX_SetEnabled(track, INchainfltngfx + 0x1000000, not r.TrackFX_GetEnabled(track, INchainfltngfx + 0x1000000))
end
end
end
end
Expand All @@ -122,12 +163,26 @@ reaper.ClearConsole()
for j = 0, r.TakeFX_GetCount(take) - 1 do

if r.TakeFX_GetFloatingWindow(take, j) then
r.TakeFX_SetEnabled(take, j, not r.TakeFX_GetEnabled(take, j))
if WetToggle then
local wetparam = r.TakeFX_GetParamFromIdent( take, j, ":wet" )
local wetparam_value = r.TakeFX_GetParam(take, j, wetparam)
local wetparam_value = math.floor(wetparam_value + 0.5)
r.TakeFX_SetParam(take, j, wetparam, math.abs(wetparam_value -1) )
else
r.TakeFX_SetEnabled(take, j, not r.TakeFX_GetEnabled(take, j))
end
end

if ChainFXwndw then
if j == TKchainfltngfx then
r.TakeFX_SetEnabled(take, TKchainfltngfx, not r.TakeFX_GetEnabled(take, TKchainfltngfx))
if WetToggle then
local wetparam = r.TakeFX_GetParamFromIdent( take, TKchainfltngfx, ":wet" )
local wetparam_value = r.TakeFX_GetParam(take, TKchainfltngfx, wetparam)
local wetparam_value = math.floor(wetparam_value + 0.5)
r.TakeFX_SetParam(take, TKchainfltngfx, wetparam, math.abs(wetparam_value -1) )
else
r.TakeFX_SetEnabled(take, TKchainfltngfx, not r.TakeFX_GetEnabled(take, TKchainfltngfx))
end
end
end

Expand Down
30 changes: 25 additions & 5 deletions Items Editing/80icio_Perfect Timing! - Audio Quantizer.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
-- @description Perfect Timing! - Audio Quantizer
-- @author 80icio
-- @version 0.26
-- @version 0.27
-- @changelog
-- - Unlocked 1 bar, 1/2 bar Grid and relative triplets Divisions
-- - Changed layout for Visualizer zoom bounds reference on tracks on Main window
-- - Fixed graphic issue between mouse position indication vertical line and arrange window trigger lines
-- - Fixed arrange window trigger lines behaviour when tracks disappear in folder
-- @link Forum thread https://forum.cockos.com/showthread.php?t=288964
-- @about
-- # PERFECT TIMING!
Expand Down Expand Up @@ -1789,6 +1789,8 @@ end


function MW_drawlines()
local mouse_vert_line_on_arrange_window = false

if check_itm == true and open and quantize_state == false then

local itemsn = r.CountSelectedMediaItems(0)
Expand All @@ -1808,24 +1810,42 @@ function MW_drawlines()
local sel_tr = sel_tracks_table[trck]

local media_move_check = r.GetMediaItemInfo_Value(item, "D_LENGTH" ) - r.GetMediaItemInfo_Value(item, "D_POSITION")
local track_H = r.GetMediaTrackInfo_Value(sel_tr, "I_TCPH")

if media_move_check == first_sel_item_length - first_sel_item_start and sel_tr == r.GetMediaItemTrack(item) then

local MWzoom = r.GetHZoomLevel()
local _, scrollpos, pageSize, min, max, trackPos = r.JS_Window_GetScrollInfo( trackview, "h" )
local _, scrollpos_v = r.JS_Window_GetScrollInfo( trackview, "v" )
local _, width = r.JS_Window_GetClientSize( trackview )
local track_y = r.GetMediaTrackInfo_Value(sel_tr, "I_TCPY")
local track_H = r.GetMediaTrackInfo_Value(sel_tr, "I_TCPH")

--local track_FL_n = r.GetMediaTrackInfo_Value(sel_tr, "I_NUMFIXEDLANES")

local media_H = r.GetMediaItemInfo_Value(item, "I_LASTH" )
if r.GetToggleCommandState(43194) then
local window, _, _ = r.BR_GetMouseCursorContext()
if window == "arrange" then
mouse_vert_line_on_arrange_window = true
else
mouse_vert_line_on_arrange_window = false
end
end

local media_H = 0

if track_H ~= 0 then
media_H = r.GetMediaItemInfo_Value(item, "I_LASTH" )
end

local media_Y = r.GetMediaItemInfo_Value(item, "I_LASTY" )

--local media_FL_y = r.GetMediaItemInfo_Value(item, "F_FREEMODE_Y")
-- local media_FL_h = r.GetMediaItemInfo_Value(item, "F_FREEMODE_H")

movescreen[trck] =h_zoom_center + zoom_bounds_L + zoom_bounds_Total + r.CSurf_TrackToID( sel_tr, false ) + MWzoom + scrollpos + track_H + media_H + scrollpos_v + itemsn + track_y*2

if MW_lines_ON and (Gtolerance_slider or r.GetPlayState() ~= 0 or visualizer_rv or Offset or Detect_rv2 or Detect_rv or Visualizer_mode_rv or
if MW_lines_ON and (Gtolerance_slider or r.GetPlayState() ~= 0 or mouse_vert_line_on_arrange_window or visualizer_rv or Offset or Detect_rv2 or Detect_rv or Visualizer_mode_rv or
color_button or Sensitivity_slider or Change_grid or movescreen[trck] ~= movescreen_prev[trck]) then --or set_grid_from_script or get_grid_from_proj

if visualizer then
Expand Down
33 changes: 24 additions & 9 deletions Items Editing/amagalma_Smart Crossfade.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
-- @description Smart Crossfade
-- @author amagalma
-- @version 1.70
-- @version 1.73
-- @changelog
-- - support for fixed item lanes
-- - set default for User Setting for maximum gap allowance between two selected items that will crossfade (fill-in gaps) to the default split crossfade length
-- @link https://forum.cockos.com/showthread.php?t=195490
-- @donation https://www.paypal.me/amagalma
-- @about
Expand Down Expand Up @@ -32,6 +32,10 @@ local remove_timesel = 1 -- Set to 1 if you want to remove the time selection (e
-- Razor Edit area settings --
local remove_RE_area = 1 -- Set to 1 if you want to remove the Razor Edit area (else keep it) --
--
-- Maximum gap between two selected items (not in time selection or RE area) that can crossfade --
-- (set it to -1, if you want it to be equal to the default split crossfade length) --
local maximum_gap = -1 -- in ms. --
--
---------------------------------------------------------------------------------------------------


Expand All @@ -54,6 +58,8 @@ if xfadeshape < 0 or xfadeshape > 7 then
xfadeshape = tonumber(({reaper.get_config_var_string( "defxfadeshape" )})[2]) or 7
end

maximum_gap = maximum_gap > -1 and maximum_gap/1000 or xfadetime


-- Razor Edit
--------------------------------
Expand All @@ -65,6 +71,7 @@ if track_cnt == 0 then return reaper.defer(function() end) end
local tracks_with_RE, tr = {}, 0

local began_block = false
local reenableTrim = false

for t = 0, track_cnt - 1 do
local track = reaper.GetTrack(0, t)
Expand Down Expand Up @@ -101,6 +108,10 @@ for t = 0, track_cnt - 1 do
reaper.Undo_BeginBlock()
reaper.PreventUIRefresh( 1 )
began_block = true
if reaper.GetToggleCommandState( 41117 ) == 1 then
reaper.Main_OnCommand(41117, 0) -- Trim content behind media items when editing
reenableTrim = true
end
end
tr = tr + 1
tracks_with_RE[tr] = track
Expand All @@ -126,6 +137,9 @@ if began_block then
reaper.PreventUIRefresh( -1 )
reaper.UpdateArrange()
reaper.Undo_EndBlock( "Smart crossfade items in RE area", (remove_RE_area and 1 or 0)|4 )
if reenableTrim then
reaper.Main_OnCommand(41117, 0) -- Trim content behind media items when editing
end
return
end

Expand Down Expand Up @@ -238,10 +252,11 @@ for tr = 1, #categorized_item do -- tracks
local second_end = second_start + reaper.GetMediaItemInfo_Value(item, "D_LENGTH")
local first_start = reaper.GetMediaItemInfo_Value(prev_item, "D_POSITION")
local first_end = first_start + reaper.GetMediaItemInfo_Value(prev_item, "D_LENGTH")
if first_end < second_start - xfadetime and (sel_start == sel_end or (first_end < sel_start and second_start > sel_end)) then
if first_end < second_start - maximum_gap and (sel_start == sel_end or (first_end < sel_start and second_start > sel_end)) then
-- items do not touch and there is no time selection covering parts of both items
-- do nothing
Msg("not touch - gap greater than xfadetime")
Msg("not touch - gap greater than maximum_gap")
Msg(string.format("Gap is %f seconds", second_start - first_end))
--[[elseif geq( second_start - first_end, xfadetime) then
--leq( first_start, second_start) and geq( first_end, second_end) then
-- one item encloses the other
Expand All @@ -265,7 +280,7 @@ for tr = 1, #categorized_item do -- tracks
reaper.SetMediaItemSelected(item, false)
change = true
end
elseif geq(second_start, first_end) and leq(second_start, first_end + xfadetime)
elseif geq(second_start, first_end) and leq(second_start, first_end + maximum_gap)
then -- items are adjacent (or there is a gap smaller or equal to the crossfade time)
Msg("adjacent - gap: " .. second_start - first_end)
if not CrossfadeOK(item, prev_item, second_start, first_end) then
Expand All @@ -276,7 +291,7 @@ for tr = 1, #categorized_item do -- tracks
end
reaper.SetMediaItemSelected(prev_item, true)
reaper.ApplyNudge(0, 1, 3, 1, second_start, 0, 0)
FadeOut(prev_item, xfadetime)
FadeOut(prev_item, maximum_gap)
reaper.SetMediaItemSelected(prev_item, false)
if groupid ~= 0 then
reaper.SetMediaItemInfo_Value( prev_item, "I_GROUPID", groupid )
Expand All @@ -287,9 +302,9 @@ for tr = 1, #categorized_item do -- tracks
reaper.SetMediaItemInfo_Value( item, "I_GROUPID", 0 )
end
reaper.SetMediaItemSelected(item, true)
reaper.ApplyNudge(0, 1, 1, 1, second_start - xfadetime, 0, 0)
Msg(xfadetime)
FadeIn(item, xfadetime)
reaper.ApplyNudge(0, 1, 1, 1, second_start - maximum_gap, 0, 0)
Msg(maximum_gap)
FadeIn(item, maximum_gap)
reaper.SetMediaItemSelected(item, false)
if groupid ~= 0 then
reaper.SetMediaItemInfo_Value( item, "I_GROUPID", groupid )
Expand Down
Loading

0 comments on commit a648dd5

Please sign in to comment.