To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Revision:

root / _chroma / pitch2octave.m

History | View | Annotate | Download (191 Bytes)

1
function strout = pitch2octave(pitch)
2
octave = floor((pitch-60)/12);
3
if octave < 0
4
    sig = '-';
5
else
6
    sig = '''';
7
end
8
strout = '';
9
for iOct = 1:abs(octave)
10
    strout = [strout,sig];
11
end