%%This script calls the function 'mcompdav.m' and plays the output file. 
% To run a template below, hit the run section button.

% Below are the input variables for the function.  
% for a detailed description of variables: see 'mcompdav.m'


filtchoice = 'min';
fs = 44100;
fL = 120;
fH = 600;
threshL = 0;
attack_timeL = 0;
release_timeL = 0;
slopeL = 0;
dBgainL = -6;
threshM = 0;
attack_timeM = 0;
release_timeM = 0;
slopeM = 0;
dBgainM = 0;
threshH = 0;
attack_timeH = 0;
release_timeH = 0;
slopeH = 0;
dBgainH = 0;
outlevel = 0;

[Multiout dry fs] = mcompdav('impulse.wav', outlevel, filtchoice, fL, fH, threshL, attack_timeL,...
    release_timeL, slopeL, dBgainL, threshM, attack_timeM, release_timeM,...
    slopeM, dBgainM, threshH, attack_timeH, release_timeH, slopeH, dBgainH);

sound(Multiout,fs);

% Some example settings:

%% Settings for "bass tightening" - try with 'DRUMLOOP.L.wav'

filtchoice = 'min';
fs = 44100;
fL = 120;
fH = 10000;
threshL = -30;
attack_timeL = .1;
release_timeL = 0.003;
slopeL = .8;
dBgainL = 16;
threshM = 0;
attack_timeM = 0;
release_timeM = 0;
slopeM = 0;
dBgainM = 0;
threshH = 0;
attack_timeH = 0;
release_timeH = 0;
slopeH = 0;
dBgainH = 0;
outlevel = 0;

[Multiout dry fs] = mcompdav('DRUMLOOP.L.wav', outlevel, filtchoice, fL, fH, threshL, attack_timeL,...
    release_timeL, slopeL, dBgainL, threshM, attack_timeM, release_timeM,...
    slopeM, dBgainM, threshH, attack_timeH, release_timeH, slopeH, dBgainH);

sound(Multiout,fs);

%% Loudness maximising on music mix

filtchoice = 'min';
fs = 44100;
fL = 300;
fH = 8000;
threshL = -30;
attack_timeL = 0.03;
release_timeL = 0.003;
slopeL = .7;
dBgainL = 3;
threshM = -20;
attack_timeM = 0.02;
release_timeM = 0.002;
slopeM = .8;
dBgainM = 0;
threshH = -30;
attack_timeH = 0.02;
release_timeH = 0.002;
slopeH = .8;
dBgainH = 0;
outlevel = 0;

[Multiout dry fs] = mcompdav('Mix.wav', outlevel, filtchoice, fL, fH, threshL, attack_timeL,...
    release_timeL, slopeL, dBgainL, threshM, attack_timeM, release_timeM,...
    slopeM, dBgainM, threshH, attack_timeH, release_timeH, slopeH, dBgainH);

sound(Multiout,fs);


%% Settings for "de-essing" - zero phase implementation to preserve phase in the upper frequencies

filtchoice = 'zero';
fs = 44100;
fL = 5000;
fH = 9000;
threshL = 0;
attack_timeL = 0;
release_timeL = 0;
slopeL = 0;
dBgainL = 0;
threshM = 0;
attack_timeM = 0;
release_timeM = 0;
slopeM = 0;
dBgainM = 0;
threshH = -50;
attack_timeH = 0.01;
release_timeH = 0.002;
slopeH = .9;
dBgainH = 0;
outlevel = 0;

[Multiout dry fs] = mcompdav('ESSY VOX.wav', outlevel, filtchoice, fL, fH, threshL, attack_timeL,...
    release_timeL, slopeL, dBgainL, threshM, attack_timeM, release_timeM,...
    slopeM, dBgainM, threshH, attack_timeH, release_timeH, slopeH, dBgainH);

sound(Multiout,fs);



