tomwalters@0: % tool tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % tomwalters@0: % 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=dots2sig(dots,nr_bins) tomwalters@0: % usage: sig=dots2sig(dots) tomwalters@0: % makes a signal from the dots by adding them to bins according to their octave shift tomwalters@0: % the dots must have pitchstrength in the region from 0 to 1 tomwalters@0: % the outsignal has nr_bins points and a length of 1 tomwalters@0: tomwalters@0: tomwalters@0: if nargin < 2 tomwalters@0: nr_bins=100; tomwalters@0: end tomwalters@0: tomwalters@0: sig=signal(1,nr_bins); tomwalters@0: tomwalters@0: nr=max(size(dots)); tomwalters@0: for i=1:nr tomwalters@0: shift=dots{i}.octave_shift; tomwalters@0: old_val=gettimevalue(sig,shift); tomwalters@0: new_val=dots{i}.pitchstrength; tomwalters@0: sig=settimevalue(sig,shift,old_val+new_val); tomwalters@0: end