# HG changeset patch # User emmanouilb # Date 1366464627 -3600 # Node ID 8428a0ebd45f6d152c49070584b5d64c8cd83b73 # Parent 840a4c453edc1f53b4d498ae6dee62bb876389e7 Function for loading MELODIA output diff -r 840a4c453edc -r 8428a0ebd45f loadMelodyFile.m --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/loadMelodyFile.m Sat Apr 20 14:30:27 2013 +0100 @@ -0,0 +1,23 @@ +function [melody] = loadMelodyFile(filename) + +% Open raw file +fid = fopen(filename,'r+'); + +% Read 1st line +tline = fgetl(fid); +onset_pitch(:,1) = sscanf(tline, '%f\t%f'); + +% Read rest of the lines +i=1; +while ischar(tline) + i = i+1; + tline = fgetl(fid); + if (ischar(tline)) + onset_pitch(:,i) = sscanf(tline, '%f\t%f'); + end; +end +melody = onset_pitch; + +% Close file +fclose(fid); + diff -r 840a4c453edc -r 8428a0ebd45f wave2fft2wave.m --- a/wave2fft2wave.m Sat Apr 20 14:04:20 2013 +0100 +++ b/wave2fft2wave.m Sat Apr 20 14:30:27 2013 +0100 @@ -36,4 +36,6 @@ end +y = (max(x)/max(y))*y; % scale y to original amplitude + %wavwrite(y,44100,'test.wav'); \ No newline at end of file