1
1
-- @description Floating FX bypass toggle
2
2
-- @author 80icio
3
- -- @version 1.0
3
+ -- @version 1.1
4
+ -- @changelog - Added toggle wet knob function
4
5
-- @about
5
6
-- This script let you toggle any visible floating FX bypass.
6
7
-- track FX, take FX, input FX or fx chain focused FX
7
8
-- Please install IMGUI library
8
9
--
9
10
-- Thanks to BirdBird & Tycho
10
11
12
+
11
13
r = reaper
12
14
13
15
dofile (r .GetResourcePath () .. ' /Scripts/ReaTeam Extensions/API/imgui.lua' ) (' 0.8.1' )
@@ -29,23 +31,26 @@ TakeFX = str_to_bool(r.GetExtState(scriptname,'TakeFX') ) or false
29
31
30
32
ChainFXwndw = str_to_bool (r .GetExtState (scriptname ,' ChainFXwndw' ) ) or false
31
33
34
+ WetToggle = str_to_bool (r .GetExtState (scriptname ,' WetToggle' ) ) or false
35
+
32
36
33
37
function exit ()
34
38
r .SetExtState (scriptname ,' trkFX' ,tostring (trkFX ),true )
35
39
r .SetExtState (scriptname ,' TakeFX' ,tostring (TakeFX ),true )
36
40
r .SetExtState (scriptname ,' InpFX' ,tostring (InpFX ),true )
37
41
r .SetExtState (scriptname ,' ChainFXwndw' ,tostring (ChainFXwndw ),true )
42
+ r .SetExtState (scriptname ,' WetToggle' ,tostring (WetToggle ),true )
38
43
end
39
44
40
45
41
46
42
47
ctx = r .ImGui_CreateContext (scriptname )
43
48
44
49
function TFB_GUI ()
45
- r .ImGui_SetNextWindowSize ( ctx , 220 , 105 )
50
+ r .ImGui_SetNextWindowSize ( ctx , 300 , 80 )
46
51
local visible , open = r .ImGui_Begin (ctx , scriptname , true , r .ImGui_WindowFlags_NoResize () | r .ImGui_WindowFlags_NoScrollbar ())
47
52
if visible then
48
- r .ImGui_BeginTable (ctx , ' options' , 2 , r .ImGui_TableFlags_SizingStretchProp () )
53
+ r .ImGui_BeginTable (ctx , ' options' , 3 , r .ImGui_TableFlags_SizingStretchProp () )
49
54
r .ImGui_TableNextColumn (ctx )
50
55
51
56
_ , trkFX = r .ImGui_Checkbox ( ctx , ' Track FX' , trkFX )
@@ -55,10 +60,16 @@ function TFB_GUI()
55
60
56
61
_ , TakeFX = r .ImGui_Checkbox ( ctx , ' Take FX ' , TakeFX )
57
62
_ , ChainFXwndw = r .ImGui_Checkbox ( ctx , ' Chain FX' , ChainFXwndw )
58
- r .ImGui_EndTable (ctx )
59
63
64
+ r .ImGui_TableNextColumn (ctx )
65
+
66
+ _ , WetToggle = r .ImGui_Checkbox ( ctx , ' Toggle Wet' , WetToggle )
60
67
toggleBttn = r .ImGui_Button (ctx ,' TOGGLE' , - 1 )
61
68
69
+ r .ImGui_EndTable (ctx )
70
+
71
+
72
+
62
73
63
74
r .ImGui_End (ctx )
64
75
end
@@ -67,7 +78,7 @@ function TFB_GUI()
67
78
end
68
79
---- -----------------------------------END GUI--------------------------
69
80
if toggleBttn and (trkFX or InpFX or TakeFX or ChainFXwndw ) then
70
- reaper . ClearConsole ()
81
+
71
82
r .Undo_BeginBlock2 (0 )
72
83
for i = - 1 , r .CountTracks (0 ) - 1 do
73
84
@@ -84,13 +95,29 @@ reaper.ClearConsole()
84
95
if trkFX then
85
96
86
97
if r .TrackFX_GetFloatingWindow ( track , index ) then
87
- r .TrackFX_SetEnabled (track , index , not r .TrackFX_GetEnabled (track , index ))
98
+ if WetToggle then
99
+ local wetparam = r .TrackFX_GetParamFromIdent ( track , index , " :wet" )
100
+ local wetparam_value = r .TrackFX_GetParam (track , index , wetparam )
101
+ local wetparam_value = math.floor (wetparam_value + 0.5 )
102
+ r .TrackFX_SetParam (track , index , wetparam , math.abs (wetparam_value - 1 ) )
103
+ else
104
+ r .TrackFX_SetEnabled (track , index , not r .TrackFX_GetEnabled (track , index ))
105
+ end
88
106
end
89
107
end
90
108
91
109
if ChainFXwndw then
92
110
if index == chainfltngfx then
93
- r .TrackFX_SetEnabled (track , chainfltngfx , not r .TrackFX_GetEnabled (track , chainfltngfx ))
111
+
112
+ if WetToggle then
113
+ local wetparam = r .TrackFX_GetParamFromIdent ( track , chainfltngfx , " :wet" )
114
+ local wetparam_value = r .TrackFX_GetParam (track , chainfltngfx , wetparam )
115
+ local wetparam_value = math.floor (wetparam_value + 0.5 )
116
+ r .TrackFX_SetParam (track , chainfltngfx , wetparam , math.abs (wetparam_value - 1 ) )
117
+ else
118
+ r .TrackFX_SetEnabled (track , chainfltngfx , not r .TrackFX_GetEnabled (track , chainfltngfx ))
119
+ end
120
+
94
121
end
95
122
end
96
123
-- end
@@ -102,13 +129,27 @@ reaper.ClearConsole()
102
129
if InpFX then
103
130
104
131
if r .TrackFX_GetFloatingWindow (track , index + 0x1000000 ) then
105
- r .TrackFX_SetEnabled (track , index + 0x1000000 , not r .TrackFX_GetEnabled (track , index + 0x1000000 ))
132
+ if WetToggle then
133
+ local wetparam = r .TrackFX_GetParamFromIdent ( track , index + 0x1000000 , " :wet" )
134
+ local wetparam_value = r .TrackFX_GetParam (track , index + 0x1000000 , wetparam )
135
+ local wetparam_value = math.floor (wetparam_value + 0.5 )
136
+ r .TrackFX_SetParam (track , index + 0x1000000 , wetparam , math.abs (wetparam_value - 1 ) )
137
+ else
138
+ r .TrackFX_SetEnabled (track , index + 0x1000000 , not r .TrackFX_GetEnabled (track , index + 0x1000000 ))
139
+ end
106
140
end
107
141
end
108
142
109
143
if ChainFXwndw then
110
144
if index == INchainfltngfx then
111
- r .TrackFX_SetEnabled (track , INchainfltngfx + 0x1000000 , not r .TrackFX_GetEnabled (track , INchainfltngfx + 0x1000000 ))
145
+ if WetToggle then
146
+ local wetparam = r .TrackFX_GetParamFromIdent ( track , INchainfltngfx + 0x1000000 , " :wet" )
147
+ local wetparam_value = r .TrackFX_GetParam (track , INchainfltngfx + 0x1000000 , wetparam )
148
+ local wetparam_value = math.floor (wetparam_value + 0.5 )
149
+ r .TrackFX_SetParam (track , INchainfltngfx + 0x1000000 , wetparam , math.abs (wetparam_value - 1 ) )
150
+ else
151
+ r .TrackFX_SetEnabled (track , INchainfltngfx + 0x1000000 , not r .TrackFX_GetEnabled (track , INchainfltngfx + 0x1000000 ))
152
+ end
112
153
end
113
154
end
114
155
end
@@ -122,12 +163,26 @@ reaper.ClearConsole()
122
163
for j = 0 , r .TakeFX_GetCount (take ) - 1 do
123
164
124
165
if r .TakeFX_GetFloatingWindow (take , j ) then
125
- r .TakeFX_SetEnabled (take , j , not r .TakeFX_GetEnabled (take , j ))
166
+ if WetToggle then
167
+ local wetparam = r .TakeFX_GetParamFromIdent ( take , j , " :wet" )
168
+ local wetparam_value = r .TakeFX_GetParam (take , j , wetparam )
169
+ local wetparam_value = math.floor (wetparam_value + 0.5 )
170
+ r .TakeFX_SetParam (take , j , wetparam , math.abs (wetparam_value - 1 ) )
171
+ else
172
+ r .TakeFX_SetEnabled (take , j , not r .TakeFX_GetEnabled (take , j ))
173
+ end
126
174
end
127
175
128
176
if ChainFXwndw then
129
177
if j == TKchainfltngfx then
130
- r .TakeFX_SetEnabled (take , TKchainfltngfx , not r .TakeFX_GetEnabled (take , TKchainfltngfx ))
178
+ if WetToggle then
179
+ local wetparam = r .TakeFX_GetParamFromIdent ( take , TKchainfltngfx , " :wet" )
180
+ local wetparam_value = r .TakeFX_GetParam (take , TKchainfltngfx , wetparam )
181
+ local wetparam_value = math.floor (wetparam_value + 0.5 )
182
+ r .TakeFX_SetParam (take , TKchainfltngfx , wetparam , math.abs (wetparam_value - 1 ) )
183
+ else
184
+ r .TakeFX_SetEnabled (take , TKchainfltngfx , not r .TakeFX_GetEnabled (take , TKchainfltngfx ))
185
+ end
131
186
end
132
187
end
133
188
0 commit comments