function [] = fix_offset(melody,melodyps)
%e.g. fix_offset('melody.wav','melody_ps12.wav');

x = wavread(melody);
y = wavread(melodyps);

ind1 = find(x>0, 1, 'last');
ind2 = find(y>0, 1, 'last');

y = [zeros(ind1-ind2,1); y];
wavwrite(y,44100,melodyps);