Mercurial > hg > ishara
view pitch/pitch2name.m @ 61:eff6bddf82e3 tip
Finally implemented perceptual brightness thing.
author | samer |
---|---|
date | Sun, 11 Oct 2015 10:20:42 +0100 |
parents | 82075c94eed1 |
children |
line wrap: on
line source
function names=pitch2name(p,oct) if nargin<2,oct=0; end if iscell(p), p=cell2mat(p); end nm={'A' 'A#' 'B' 'C' 'C#' 'D' 'D#' 'E' 'F' 'F#' 'G' 'G#'}; for k=1:length(p) if isfinite(p(k)), names{k}=nm{1+mod(p(k),12)}; if oct, names{k}=[ names{k} num2str(floor((p(k)+57)/12))]; end else names{k}='-'; end end