function res = shiftpitch(s,sf,r,dur)
%shiftpitch(sound,sf, relativepitch, dur)
s = s(:);
duration = length(s)./sf;
newsamps = (r*(1:(length(s)./r)));
nsound = interp1(1:length(s),s, newsamps);
nsamps = floor(dur*sf);
res = [];
if nsamps <= length(nsound)
   res = nsound(1:nsamps);
else
   res = nsound;
   warning('Duration not yet implemented.');
end