Skip to content

Commit

Permalink
Add files via upload (ReaTeam#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
reaperblog authored and jalovatt committed Apr 27, 2018
1 parent 86ef828 commit c61ce2e
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* ReaScript Name: +3dB trim send levels on selected track
* EEL script for Cockos REAPER
* Author: spk77, modified by REAPER Blog
* Author URI: http://forum.cockos.com/member.php?u=49553
* Licence: GPL v3
* Version: 1.0
* comment: slight modification of spk77_Adjust all send volumes on selected track by x dB.eel

*/

dB_val = 3; // Add 3 decibels to all sends on selected tracks

trim = pow(10, dB_val / 20.0);

function set_send_volumes(track, trim) local(tr_num_hw_outs, tr_num_sends, i, vol, new_vol)
(
tr_num_hw_outs = GetTrackNumSends(track, 1);
tr_num_sends = GetTrackNumSends(track, 0);
i = 0;
loop(tr_num_sends,
GetTrackSendUIVolPan(track, tr_num_hw_outs + i, vol, 0);
new_vol = max(min(vol*trim, 4), 0);
SetTrackSendUIVol(track, tr_num_hw_outs + i, new_vol, 0);
i += 1;
);
);


function main() local(i, tr)
(
i = 0;
loop(CountSelectedTracks(0),
(tr = GetSelectedTrack(0, i)) ? (
set_send_volumes(tr, trim);
);
i += 1;
);
Undo_OnStateChangeEx("Adjust send volumes", -1, -1);
);

main();
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* ReaScript Name: -3dB trim send levels on selected track
* EEL script for Cockos REAPER
* Author: spk77, modified by REAPER Blog
* Author URI: http://forum.cockos.com/member.php?u=49553
* Licence: GPL v3
* Version: 1.0
* comment: slight modification of spk77_Adjust all send volumes on selected track by x dB.eel

*/

dB_val = -3; // reduce 3 decibels to all sends on selected tracks

trim = pow(10, dB_val / 20.0);

function set_send_volumes(track, trim) local(tr_num_hw_outs, tr_num_sends, i, vol, new_vol)
(
tr_num_hw_outs = GetTrackNumSends(track, 1);
tr_num_sends = GetTrackNumSends(track, 0);
i = 0;
loop(tr_num_sends,
GetTrackSendUIVolPan(track, tr_num_hw_outs + i, vol, 0);
new_vol = max(min(vol*trim, 4), 0);
SetTrackSendUIVol(track, tr_num_hw_outs + i, new_vol, 0);
i += 1;
);
);


function main() local(i, tr)
(
i = 0;
loop(CountSelectedTracks(0),
(tr = GetSelectedTrack(0, i)) ? (
set_send_volumes(tr, trim);
);
i += 1;
);
Undo_OnStateChangeEx("Adjust send volumes", -1, -1);
);

main();

0 comments on commit c61ce2e

Please sign in to comment.