function wavout = cascade(dv, vv, wav)
% cascade a delay with a vibrato.

global N Fs;
global DEL_ABS DEL_E DEL_HZ DEL_MIN DEL_MAX DEL_PH DEL_AMP;
global PIT_E PIT_HZ PIT_SWAMP PIT_PH PIT_AMP;
global VIB_HZ VIB_SWAMP VIB_PH VIB_AMP;
global DELAYS PITCHES VIBS;

wavout = zeros(size(wav));
samples = size(wav,1)
%delay
    for i = 1:samples  % generating ith NEW sample
        sampind = Pitch(i,dv); % this is its adjusted 'index'
       if ((sampind < 1) | (sampind > samples))
           break
       end
        wavout(i,:) = interpolnd(wav, sampind);
    end

%vibs
     hz = VIBS(vv,VIB_HZ);
     amp = VIBS(vv,VIB_SWAMP);
     ph = VIBS(vv,VIB_PH);
     for i = 1:samples  % here we just modulate wav
     wavout(i,:) = wavout(i,:) * (1+ sin(ind2ang(i,hz, ph))*amp);
    end
wavout = wavout * VIBS(vv,VIB_AMP); % how loud?

end

