% Adaptive Tremolo Script %

[input,fs] = audioread('Em_arpeggio.wav'); % load mono audio file

ascending = 1; % set to 1 modulation rate ascends with increasing pitch
% set to 0 modulation rate descends with increasing pitch

depth = 50; % depth of tremolo between 0 and 100

figs = 1; % create plots for detected fundamental frequencies and
% time-varying amplitude modulator

output = adaptivetremolo(input,fs,ascending,depth,figs); % apply effect
output = output / max(abs(output));

audiowrite('Am_pent_pos5_asc_depth0.wav',output,fs); % write audio to
% a wav file