function semitonename = freqtosemitone(f)
semitone = round((12*log(f/55)-24*log(2))/log(2));
mod_semitone = mod(semitone, 12);
names = { 'a' '^a' 'b' 'c' '^c' 'd' '^d' 'e' 'f' '^f' 'g' '^g' };
semitonename = names(1 + mod_semitone);





