Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Q&A, Tips, Tricks and Howto

Reply
 
Thread Tools Display Modes
Old 04-04-2020, 08:52 AM   #41
MEMFIS_AKA
Banned
 
Join Date: Jul 2017
Posts: 192
Default

Anybody?
MEMFIS_AKA is offline   Reply With Quote
Old 04-04-2020, 09:17 AM   #42
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,903
Default

Quote:
Originally Posted by MEMFIS_AKA View Post
How can i upgrade code to ability insert FX on Master track?
try,...

Code:
FX = "ReaComp"

reaper.Undo_BeginBlock()
track = reaper.GetMasterTrack()
reaper.TrackFX_AddByName(track, FX, 0, -1 )
reaper.TrackFX_Show( track, reaper.TrackFX_GetCount( track ) - 1 , 3 )
reaper.Undo_EndBlock("Add new track FX instance - "..FX,-1)
Edgemeal is offline   Reply With Quote
Old 04-04-2020, 01:09 PM   #43
MEMFIS_AKA
Banned
 
Join Date: Jul 2017
Posts: 192
Default

Quote:
Originally Posted by Edgemeal View Post
try,...

Code:
FX = "ReaComp"

reaper.Undo_BeginBlock()
track = reaper.GetMasterTrack()
reaper.TrackFX_AddByName(track, FX, 0, -1 )
reaper.TrackFX_Show( track, reaper.TrackFX_GetCount( track ) - 1 , 3 )
reaper.Undo_EndBlock("Add new track FX instance - "..FX,-1)
Thanks! It's working for master.
But i wondering - can i upgrade my code to able insert on MCP AND Master when (MCP or Master Track) selected.

Mine add FX only to TCP
Your only to Master Track.
Plus i don't need to open and float just added FX =)
MEMFIS_AKA is offline   Reply With Quote
Old 04-04-2020, 04:47 PM   #44
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,903
Default

Quote:
Originally Posted by MEMFIS_AKA View Post
Thanks! It's working for master.
But i wondering - can i upgrade my code to able insert on MCP AND Master when (MCP or Master Track) selected.

Mine add FX only to TCP
Your only to Master Track.
Plus i don't need to open and float just added FX =)
If you don't want to show the fx after its added then just remove that 'TrackFX_Show' line of code.

To add fx to master track only if selected, try,
Code:
local track = reaper.GetMasterTrack()
local master_sel = reaper.IsTrackSelected(track)
if master_sel then reaper.TrackFX_AddByName(track, FX, 0, -1) end
Edgemeal is offline   Reply With Quote
Old 04-05-2020, 04:07 AM   #45
MEMFIS_AKA
Banned
 
Join Date: Jul 2017
Posts: 192
Default

Quote:
Originally Posted by Edgemeal View Post
If you don't want to show the fx after its added then just remove that 'TrackFX_Show' line of code.

To add fx to master track only if selected, try,
Code:
local track = reaper.GetMasterTrack()
local master_sel = reaper.IsTrackSelected(track)
if master_sel then reaper.TrackFX_AddByName(track, FX, 0, -1) end
Doesn't work, brother. I select master track and nothing add's
MEMFIS_AKA is offline   Reply With Quote
Old 04-05-2020, 04:08 AM   #46
MEMFIS_AKA
Banned
 
Join Date: Jul 2017
Posts: 192
Default

Work's like this ^_^

reaper.Undo_BeginBlock()

FX = "PLUGIN NAME"

TrackIdx = 0
TrackCount = reaper.CountSelectedTracks(0)
local track = reaper.GetMasterTrack()
local master_sel = reaper.IsTrackSelected(track)
if master_sel then reaper.TrackFX_AddByName(track, FX, 0, -1) end
while TrackIdx < TrackCount do
track = reaper.GetSelectedTrack(0, TrackIdx)
reaper.TrackFX_AddByName( track, FX, 0, -1 )
TrackIdx =TrackIdx+1
end

reaper.Undo_EndBlock("Add new track FX instance",-1)
MEMFIS_AKA is offline   Reply With Quote
Old 04-05-2020, 08:25 AM   #47
Edgemeal
Human being with feelings
 
Edgemeal's Avatar
 
Join Date: Apr 2016
Location: ASU`ogacihC
Posts: 3,903
Default

Ya, I wasn't trying to write the whole script for you.
Best you refer to the ReaScript documentation (REAPER Main Menu > Help > ReaScript documentation), once open in your web browser use its search to find keywords of functions, read what little documentation there is (if any), try to code each part of your script separately as you learn, test what works, then put it all together.

If you need help with scripting probably best to post them in the Developer Forum. I'm also not a guru coder!
Edgemeal is offline   Reply With Quote
Old 07-06-2020, 08:42 AM   #48
MEMFIS_AKA
Banned
 
Join Date: Jul 2017
Posts: 192
Default

How can i avoid that ugly gaps and align my toolbar icons?



They are same width. When i set this up first it aligns perfect.
But somehow someway after i restart Reaper it's all messed up.

Last edited by MEMFIS_AKA; 07-06-2020 at 09:48 AM.
MEMFIS_AKA 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 11:48 PM.


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