%% scale_length_5.ldf
%% Created by Laurence D. Finston (LDF) Sun 17 Jul 2022 08:04:24 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


%% * (1) Top

verbatim_metapost "prologues := 3;\noutputtemplate := \"%j_%3c.eps\";";

input "plainldf.lmc";
input "scale_layouts.lmc";

pen medium_pen;
medium_pen := pencircle scaled (.5mm, .5mm, .5mm);

pen small_pen;
small_pen := pencircle scaled (.333mm, .333mm, .333mm);

pen dot_pen;
dot_pen := pencircle scaled (2.5mm, 2.5mm, 2.5mm);

pen tiny_pen;
tiny_pen := pencircle scaled (.175mm, .175mm, .175mm);

pickup medium_pen;

numeric wd;
numeric n[];

picture v[];

numeric alpha;
alpha := 2 root 12;

numeric ref_fret;
ref_fret := 24;

%% With float, there are only 23 places to the right
%% of the decimal point.
%% LDF 2022.07.10.
%%
% message "alpha:";
% show alpha fixed 23;

%% * (1)



%% * (1) Fig. 0.  Dummy figure.

beginfig(0);
  drawdot origin;
endfig with_projection parallel_x_y;

%% * (1) Fig. 1.  Equal temperament, Scale length 45cm

beginfig(1); 

  point p[];
  path q[];         

  p0 := origin;
  q0 := nullpath;
  point_vector pv;

  boolean do_scriptstyle;
  do_scriptstyle := false;

  layout  {p0, %% ttop
           q0, %% path Q
           pv, %% point_vector PV
           45, %% llength         
           12, %% ffret_ctr       
          2mm, %% ffret_thickness        
            0, %% sstart
           12, %% eend,
            0, %% oovershoot_top	
            0, %% oovershoot_bot
            do_scriptstyle
    };

  clear pv;

endfig with_projection parallel_x_y;

%% * (1) Fig. 2.  Werckmeister III, Scale length 45cm

beginfig(2); 
  numeric scale_length;
  point p[];
  
  scale_length := 45cm;
  
  werckmeister_three {scale_length};

  
endfig with_projection parallel_x_y;

% beginfig(2);
%   drawdot origin;
% endfig with_projection parallel_x_y;


end_mp;
end;

  
%% ** (2) End of 3DLDF code.

%% * (1) Emacs-Lisp code for use in indirect buffers when using the          
%%       GNU Emacs editor.  The local variable list is not evaluated when an 
%%       indirect buffer is visited, %% %% so it's necessary to evaluate the       
%%       following s-expression in order to use the facilities normally      
%%       accessed via the local variables list.                              
%%       \initials{LDF 2004.02.12}.                                          


%% (progn (metapost-mode) (outline-minor-mode t) (setq fill-column 80))    

%% * (1) Local variables for Emacs.

%% Local Variables:
%% mode:MetaPost
%% eval:(outline-minor-mode t)
%% eval:(read-abbrev-file abbrev-file-name)
%% outline-regexp:"%% [*\f]+"
%% End:
