% Phase Vocoder Effects by John Arroyo, ja2124@columbia.edu
% Harmonizing example using the vocoding engine created

[signal,Sr] = wavread('flute-C5.wav');

hannWindowLength = 1024;

note1 = 1.2599; %(4 steps) 1.18 (4 steps, ie C5 to E5)
note2 = 1.4983; %(7 steps)
amplitude = .8;

% .5 hop size creates a stuttering effect when the signal is stretched
signalHarm = harmonize(signal,note1,note2,amplitude,Sr,hannWindowLength);

%original sudio clip
wavplay(signal,Sr)

%time stretched signal
wavplay(signalHarm,Sr)

%wavwrite(signalHarm,Sr,16,'ToneENG2FIRE_cool_2X_256.wav')

%used only during debugging
clear encode;
clear decode;
clear robot;