Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Envelopes/saull_Peak envelope generator.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- @description Peak envelope generator
-- @author saul-l
-- @version 1.01
-- @changelog Removed console message, which was accidently left for autogen
-- @version 1.02
-- @changelog Fixed Smooth not working properly, unless envelope is manually selected
-- @about
-- # Peak envelope generator
--
Expand All @@ -15,6 +15,7 @@
--
-- Only works with FX envelopes at the moment


if not reaper.ImGui_GetBuiltinPath then
reaper.MB("ReaImGui required. Please install it.", "Install ReaImGui", 0)
if not pcall(function() reaper.ReaPack_BrowsePackages( "ReaImGui: ReaScript binding for Dear ImGui" ) end) then
Expand Down Expand Up @@ -131,7 +132,10 @@ function CalculateEnvelope()
reaper.InsertEnvelopePoint(env, starttime + (k-1)*ticklen*.5, scaleFunc(peak), 0, 0, true)
end

if smooth then reaper.Main_OnCommand(42208,0) end
if smooth then
if reaper.GetSelectedEnvelope(0) ~= env then reaper.SetCursorContext(2,env) end
reaper.Main_OnCommand(42208,0)
end
end
end

Expand Down