|
|
|
08-08-2019, 07:23 AM
|
#1
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,793
|
Action / API to enable master track volume
Is there a way to enable the master track volume ? I don't see an action or a function in the API listings. Thanks !
|
|
|
08-08-2019, 07:51 AM
|
#2
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
|
This should set Volume envelope active on Master track...
EDIT This is probably better, uses API to get envelope type..
Code:
local track = reaper.GetMasterTrack(0)
if track then
local env_count = reaper.CountTrackEnvelopes(track)
for j = 0, env_count-1 do
local env = reaper.GetTrackEnvelope(track, j)
local br_env = reaper.BR_EnvAlloc(env, false)
local active, visible, armed, inLane, laneHeight, defaultShape, _, _, _, env_type, faderScaling = reaper.BR_EnvGetProperties(br_env)
if (env_type == 0) then -- 0->Volume, 1->Volume (Pre-FX), 2->Pan, 3->Pan (Pre-FX), etc..
if not active then
reaper.BR_EnvSetProperties(br_env, true, visible, armed, inLane, laneHeight, defaultShape, faderScaling)
reaper.BR_EnvFree(br_env, true)
else
reaper.BR_EnvFree(br_env, false)
end
break
else
reaper.BR_EnvFree(br_env, false)
end
end
end
First draft, detect env by name,..
Code:
local track = reaper.GetMasterTrack(0)
if track then
local env_count = reaper.CountTrackEnvelopes(track)
for j = 0, env_count-1 do
local env = reaper.GetTrackEnvelope(track, j)
local _, name = reaper.GetEnvelopeName(env, "")
if name == 'Volume' then
local br_env = reaper.BR_EnvAlloc(env, false)
local active, visible, armed, inLane, laneHeight, defaultShape, _, _, _, _, faderScaling = reaper.BR_EnvGetProperties(br_env)
if not active then
reaper.BR_EnvSetProperties(br_env, true, visible, armed, inLane, laneHeight, defaultShape, faderScaling)
reaper.BR_EnvFree(br_env, true)
else
reaper.BR_EnvFree(br_env, false)
end
break
end
end
end
Last edited by Edgemeal; 08-08-2019 at 08:59 AM.
Reason: FIX first script
|
|
|
08-08-2019, 08:56 AM
|
#3
|
Human being with feelings
Join Date: Oct 2010
Location: Charleston, SC
Posts: 12,793
|
wow, you are amazing. Thanks a million for the killer script. It works great !!
|
|
|
08-08-2019, 09:01 AM
|
#4
|
Human being with feelings
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,921
|
LOL! Updated 1st script again. It be amazing if I could post correct code on first try.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 05:54 PM.
|