% Happy birthday to you (id=21) p=[57.1 58 58.5 59.5 60.1 60.4 60.1 60.4 60.1 59.5 59.8 59.5 59.8 60.1 59.2 62.6 62.6 62.6 62.2 61.8 61.5 61.5 61.5 62.2 62.2 62.6 62.2 61.8 61.5 61.1 58.9 58 58.3 58.5 59.5 60.1 60.1 59.8 60.1 60.4 60.4 59.8 59.8 59.8 64.1 65 65 65.4 65.4 65.4 65.4 65.4 65.4 65.4 65.4 65 65 64.1 64.1 64.6 65.4 65.4 65.9 65.4 65 65 65 65 65 65 65 65 65 65 64.6 64.6 63.7 58.9 58.9 58.5 58.9 59.5 60.1 60.1 59.8 59.5 59.8 59.2 59.5 59.2 65.4 63.3 63.3 62.9 62.9 62.9 62.9 62.6 62.6 62.6 62.6 62.6 62.2 61.8 61.1 59.8 59.5 59.5 59.8 60.1 60.1 59.8 59.5 59.5 59.2 59.2 59.2 66.3 67.3 67.8 67.8 67.3 67.3 67.3 67.3 67.3 67.3 67.3 67.3 67.8 66.8 66.3 65.9 65.4 65.9 66.3 66.3 65.9 65.4 65.9 65.9 65.9 65.9 65.9 65.9 65.9 65.4 63.7 59.8 59.8 60.1 60.8 60.8 60.4 59.8 60.8 59.8 60.1 60.4 60.1 70 71.2 71.8 72.4 72.4 72.4 72.4 72.4 73.1 73.1 73.1 73.1 72.4 72.4 71.2 68.8 67.8 68.3 68.8 69.4 69.4 69.4 69.4 69.4 69.4]; q=[60 60 62 60 65 64 60 60 62 60 67 65 60 60 72 69 65 64 62 70 70 69 65 67 65]; showPlot=1; figure; [minDist, dpPath]=myPvAlignSP(p, q, showPlot); return % If you want to do playback, download SAP toolbox at http://mirlab.org/jang/matlab/toolbox/sap and proceed as follows. addpath d:/users/jang/matlab/toolbox/sap % You need to change this to add SAP toolbox to the search path. % Play back of the oringal note note=[60 29 60 10 62 38 60 38 65 38 64 77 60 29 60 10 62 38 60 38 67 38 65 77 60 29 60 10 72 38 69 38 65 38 64 38 62 77 77 70 29 70 10 69 38 65 38 67 38 65 38]; notePlay(note); % Playback of the singing pitch vector pvPlay(p); % Playback of the induced singing pitch vector pvPlay(inducedP);