forked from ReaTeam/ReaScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspk77_Adjust all receive volumes on selected track by x dB.eel
64 lines (53 loc) · 1.43 KB
/
spk77_Adjust all receive volumes on selected track by x dB.eel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* ReaScript Name: Adjust all receive volumes on selected track by x dB
* EEL script for Cockos REAPER
* Author: spk77
* Author URI: http://forum.cockos.com/member.php?u=49553
* Licence: GPL v3
* Version: 1.0
*/
// Adjust all receive volumes on selected track by x dB
// EEL script by SPK77 25.4.2015 (requested by daxliniere)
// http://forum.cockos.com/showthread.php?t=159185
//
// Version: 0.2015.4.25
default_val = "";
function msg_s(m)
(
ShowConsoleMsg(m);
ShowConsoleMsg("\n");
);
function msg_d(m)
(
ShowConsoleMsg(sprintf(#, "%d", m)); // convert int to string
ShowConsoleMsg("\n");
);
function dialog()
(
#dialog_ret_vals = default_val;
GetUserInputs("Adjust receive volumes by x dB", 1, "Adjust receive volumes by...", #dialog_ret_vals);
);
function set_receive_volumes(track, trim) //local(tr_num_receives, i, vol, new_vol)
(
tr_num_receives = GetTrackNumSends(track, -1);
i = 1;
loop(tr_num_receives,
GetTrackReceiveUIVolPan(track, i-1, vol, 0);
new_vol = max(min(vol*trim, 4), 0);
SetTrackSendUIVol(track, -i, new_vol, 0);
i+=1;
);
);
function main() local(tr, trim, dB_val)
(
(tr = GetSelectedTrack(0,0)) ? (
dialog() ? (
match("%f", #dialog_ret_vals, dB_val) ? (
trim = pow(10, dB_val / 20.0);
set_receive_volumes(tr, trim);
);
);
Undo_OnStateChangeEx("Adjust receive volumes", -1, -1);
) : msg_s("Please select a track.");
);
main();