
function outsig_stereo = Stereo_Chorus(insig, fs, delay, depth1, rate1)

DELAY = round(delay*(fs/1000));     %ms converted to samples

DEPTH1 = round(depth1*(fs/1000));   %ms converted to samples
RATE1 = rate1./fs;                      %angular frequency of LFO (Long, J. 2012)


[outsig_dry,outsig_mod1] = deal(zeros(1,length(insig)-DELAY));
% (above line developed by Ella Manor) "This line defines the variables by assigning zero values
% to vectors of length equal to the resulting signal (including the delay)"

for n = 1:(length(insig)-DELAY) 
    outsig_dry(n) = insig(n);
end
for n = 1:(length(insig)-DELAY)-1
   outsig_mod1(n) = insig(n+DELAY+round(DEPTH1*sin(2*pi*n*RATE1))); 
end

outsig_stereo = [outsig_dry', outsig_mod1'];
%outsig_stereo = outsig_stereo./max(max(abs(outsig_stereo))); %normalize the resulting signal 

   
end

%%% The above function was created with assistance from Ella Manor %%%
%%% Intial code based video online: 
%%% https://www.youtube.com/watch?v=fr5S5I3oL2Y&t=260s %%%
