%% scale_length.txt %% Created by Laurence D. Finston (LDF) Fri 08 Jul 2022 04:52:28 AM CEST %% * (1) Copyright and License. %%%% Copyright (C) 2022 Laurence Finston %%%% You can redistribute this file and/or modify %%%% it under the terms of the GNU General Public License as published by %%%% the Free Software Foundation; either version 3 of the License, or %%%% (at your option) any later version. %%%% This file is distributed in the hope that it will be useful, %%%% but WITHOUT ANY WARRANTY; without even the implied warranty of %%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %%%% GNU General Public License for more details. %%%% You should have received a copy of the GNU General Public License %%%% along with this file; if not, write to the Free Software %%%% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA %%%% The author can be contacted at: %%%% Laurence Finston %%%% Laurence.Finston@gmx.de \input eplain \input epsf \input colordvi %% * (1) \special{papersize=420mm, 297mm} %% DIN A3 Landscape \hsize=420mm \vsize=297mm \advance\voffset by -1in \advance\hoffset by -1in \advance\voffset by 1cm \advance\hoffset by 1cm \advance\hsize by -1cm \advance\vsize by -1cm \parindent=0pt \parskip=0pt \headline={\hfil {\tt \timestamp}\hskip2cm} \font\largebx=cmbx12 scaled \magstephalf \font\small=cmr9 \font\smalltt=cmtt9 \pageno=-1 \begingroup \advance\hsize by -12cm \advance\hoffset by .25cm \parskip=.5\baselineskip \centerline{{\largebx Scale Length Example}} \vskip\baselineskip \small Copyright (C) 2022 Laurence Finston \setbox0=\hbox{Last updated:\quad} \leavevmode\hbox to \wd0{Created:\hfil}July 8, 2022 \leavevmode\box0 July 10, 2022 %% Updated You can redistribute this file and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with This file; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA See the GNU Free Documentation License for the copying conditions that apply to this document. You should have received a copy of the GNU Free Documentation License along with this file; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA The author can be contacted at: Laurence Finston\hfil\break {\smalltt Laurence.Finston@gmx.de} \endgroup \vskip2\baselineskip {\bf See following page.} \vfil\eject \centerline{{\bf Scale Length Example}} \vskip2\baselineskip \leftline{\epsffile{scale_length001.eps}} \vskip\baselineskip \leftline{\epsffile{scale_length002.eps}} \vskip\baselineskip \leftline{\epsffile{scale_length003.eps}} \bye %% using namespace std; %% int %% main(int argc, char *arv[]) %% { %% printf("Entering `main'.\n"); %% float f = powf(2.0F, 1.0F/12.0F); %% double d = pow(2.0D, 1.0D/12.0D); %% long double ld = powl(2.0L, 1.0L/12.0L); %% cout << setprecision(128) %% << "f == " << f << endl %% << "d == " << d << endl %% << "ld == " << ld << endl; %% // f == 1.05946314334869384765625 %% // d == 1.0594630943592953098431053149397484958171844482421875 %% // (length "1.0594630943592953098431053149397484958171844482421875") == 54 %% // ld == 1.05946309435929526452345450504566315430565737187862396240234375 %% // (length "1.05946309435929526452345450504566315430565737187862396240234375") == 64 %% // Emacs-Lisp 1.0594630943592953 %% return 0; %% } %% (length "0594630943592953")16 %% %% This is a bit more technical, in case anyone is interested in the %% details (and doesn't know this already). %% The reason for using the %% 12th root of 2 is in order to lay out a scale using equal temperament. %% The reason for using the proportion 18/17 was because of the %% impracticality of doing it using direct calculation or a better %% approximation using the ratio of larger whole numbers before there %% were pocket calculators and computers. Nowadays, of course, we can %% let the computer do the calculations for us. %% So, why did I use %% 1.0595? Well, just in order to be able to use the values in the book %% by Benade. It would have been just as easy to let the computer use a %% better approximation. %% So, what would these approximations be? If %% I evaluate the Emacs-Lisp expression (expt 2 (/ 1 12.0)) in an Emacs %% buffer, I get the value 1.0594630943592953 with 16 places after the %% decimal point. It might be possible to get more decimal places, but I %% haven't bothered to look them up because Emacs-Lisp isn't really %% letting me get "close to the machine". One way to do this is to use %% the programming language C. %% In C, corresponding to the %% possibilites the hardware has of performing arithmetic, there are %% three kinds of "floating point" numbers for representing numbers with %% places to the right of the decimal point. They are called "float", %% "double" and "long double" and they have increasing degrees of %% precision. %% float f = powf(2.0F, 1.0F/12.0F); %% double d = pow(2.0D, 1.0D/12.0D); %% long double ld = powl(2.0L, 1.0L/12.0L); %% cout << setprecision(128) %% << "f == " << f << endl %% << "d == " << d << endl %% << "ld == " << ld << endl; %% // f == 1.05946314334869384765625 %% // d == 1.0594630943592953098431053149397484958171844482421875 %% // (length "1.0594630943592953098431053149397484958171844482421875") == 54 %% // ld == 1.05946309435929526452345450504566315430565737187862396240234375 %% // (length "1.05946309435929526452345450504566315430565737187862396240234375") == 64 %% // Emacs-Lisp 1.0594630943592953 \bye %% ** (2) %% * (1) Local variables for Emacs. %% Local Variables: %% mode:TeX %% eval:(outline-minor-mode t) %% eval:(read-abbrev-file abbrev-file-name) %% abbrev-mode:t %% outline-regexp:"%% [*\f]+" %% auto-fill-function:nil %% End: