tomwalters@0: % tool tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % bleeck@3: % This external file is included as part of the 'aim-mat' distribution package bleeck@3: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org bleeck@3: tomwalters@0: tomwalters@0: function sig=transferetotune(tune,art) tomwalters@0: tomwalters@0: % Tonlength: tomwalters@0: % a=0.25 tomwalters@0: % b=0.5 tomwalters@0: % c=1 tomwalters@0: if nargin < 1 tomwalters@0: % tunes: tomwalters@0: % Yankee Doodle tomwalters@0: tune='aC5aC5aD5aE5aC5aE5aD5aG4aC5aC5aD5aE5aC5aC5aB4aG4aC5aC5aD5aE5aF5aE5aD5aC5aB4aG4aA4aB4aC5aC5aC5aC5'; tomwalters@0: % Frere Jackes tomwalters@0: tune='aC5aD5aE5aC5aC5aD5aE5aC5aE5aF5aG5aE5aF5aG5'); tomwalters@0: end tomwalters@0: tomwalters@0: if nargin<2 tomwalters@0: % art='decreaseoddamplitude'; tomwalters@0: art='decreaseoddphase'; tomwalters@0: % art='sinus'; tomwalters@0: % art='harmonic'; tomwalters@0: % art='clicktrain'; tomwalters@0: end tomwalters@0: tomwalters@0: nr=size(tune,2); tomwalters@0: duration=0.25; tomwalters@0: sr=16000; tomwalters@0: sig=signal(0,sr); tomwalters@0: tomwalters@0: count=1; tomwalters@0: notecount=0; tomwalters@0: while count < nr-2 tomwalters@0: cur=tune(count); tomwalters@0: if cur~='a' & cur~='b' & cur~='c' tomwalters@0: error('Error in tune'); tomwalters@0: else tomwalters@0: if cur=='a' duration=0.25;end tomwalters@0: if cur=='b' duration=0.5;end tomwalters@0: if cur=='c' duration=1;end tomwalters@0: end tomwalters@0: cur1=tune(count+1); tomwalters@0: if cur1=='P'; tomwalters@0: fre=0; tomwalters@0: count=count+2; tomwalters@0: else tomwalters@0: cur2=tune(count+2); tomwalters@0: if count