
%% script to call reverse_reverb.m function
load space_echo_IR
fs = 44100 ;% specify the sampling rate
[drysignal, fs, nbits] = wavread('snare.wav'); % Import the dry signal (e.g 'snare.wav') 

% BPM
impulse = bpm150; %choose the speed of the delay in bpm (e.g bpm70 or bpm170)

% reverse switch
r = 1; % specify if you want a reverse delay effect (r=1 is no, r=3 is yes-use 100% wet)
if (r<2)
    impulse = impulse;
end

if (r>2);
    impulse = flipud(impulse);
end

% predelay
predelay = 200; %specify the amount of predelay in milliseconds

% mix
wet = 0.2; % the ratio of delayed signal 

dry = 0.8;% the ratio of the dry signal (both should equal 1)



outsig = space_echo(drysignal, impulse,predelay,wet,dry); % call the reverse_reverb.m function

wavwrite(outsig, fs, nbits, 'test.wav'); % output the reverse reverb signal as a wave file

sound(outsig,fs); % play the output signal



















