Home > utils > cent2pct.m

cent2pct

PURPOSE ^

cent2pct.m

SYNOPSIS ^

function pct = cent2pct(cent)

DESCRIPTION ^

 cent2pct.m

 Converts cents to percent

 Plots percent deviation as a function of cents deviation if a vector of cents
 values is given

 1 semitone = 100 cents

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function pct = cent2pct(cent)
0002 % cent2pct.m
0003 %
0004 % Converts cents to percent
0005 %
0006 % Plots percent deviation as a function of cents deviation if a vector of cents
0007 % values is given
0008 %
0009 % 1 semitone = 100 cents
0010 
0011 % 05/20/09 Petr Janata
0012 
0013 pct = (2.^(cent/1200)-1)*100;
0014 
0015 if length(cent) > 1
0016   plot(cent,pct)
0017   xlabel('Cents')
0018   ylabel('Percent')
0019 end

Generated on Wed 20-Mar-2019 04:00:51 by m2html © 2003