home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / applications / wp / pmtex.lha / pmtex / src / pmtexb.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-05  |  150.2 KB  |  5,802 lines

  1. #line 1 "pmtexb2.f"
  2. /* pmtexb2.f -- translated by f2c (version 19940615).
  3.    You must link the resulting object file with the libraries:
  4.     f2c.lib math=standard   (in that order)
  5. */
  6.  
  7. #include "f2c.h"
  8.  
  9. #line 1 "pmtexb2.f"
  10. /* Common Block Declarations */
  11.  
  12. struct {
  13.     integer mult[1000]    /* was [5][200] */, iv, list[800]    /* was [4][
  14.         200] */, nnl[5], nv, ibar, ipl[1000]    /* was [5][200] */, 
  15.         ibm1[40]    /* was [5][8] */, ibm2[40]    /* was [5][8] */, 
  16.         nolev[1000]    /* was [5][200] */, ibmcnt[5], nodur[1000]    /* 
  17.         was [5][200] */, ncmid[5], jn, lenbar, iccount, nbars, itsofar[5],
  18.          nib[75]    /* was [5][15] */, nn[5];
  19.     logical rest[1000]    /* was [5][200] */, beamon[5];
  20.     integer lenbar0, lenbar1;
  21.     logical firstline;
  22.     real slfac;
  23.     integer musicsize;
  24.     real stemmax, stemmin, stemlen;
  25.     char acc[1000]    /* was [5][200] */, ul[40]    /* was [5][8] */, hb[
  26.         40]    /* was [5][8] */, orn[1000]    /* was [5][200] */, fig[1200],
  27.          sepsym[1], s[1];
  28. } all_;
  29.  
  30. #define all_1 all_
  31.  
  32. struct {
  33.     integer ifigdrop[50], iline;
  34.     logical figbass;
  35. } comfig_;
  36.  
  37. #define comfig_1 comfig_
  38.  
  39. struct {
  40.     logical lastchar;
  41. } comget_;
  42.  
  43. #define comget_1 comget_
  44.  
  45. struct {
  46.     integer lenbeam;
  47. } combeam_;
  48.  
  49. #define combeam_1 combeam_
  50.  
  51. struct {
  52.     integer itopfacteur, ibotfacteur, interfacteur, isig;
  53.     real fracindent;
  54.     integer imeter, mtrnum, mtrden, iwaskpt;
  55.     real widthpt, height;
  56.     char iname[120];
  57. } comtop_;
  58.  
  59. #define comtop_1 comtop_
  60.  
  61. /* Table of constant values */
  62.  
  63. static integer c__1 = 1;
  64. static integer c__3 = 3;
  65. static integer c__2 = 2;
  66. static integer c__4 = 4;
  67. static integer c__8 = 8;
  68. static integer c__9 = 9;
  69. static integer c__5 = 5;
  70. static integer c__6 = 6;
  71. static integer c__0 = 0;
  72. static integer c__7 = 7;
  73. static integer c__10 = 10;
  74. static doublereal c_b763 = 2.;
  75.  
  76. /* cccccccccccccccccccccccccccccc */
  77. /* c                           cc */
  78. /* c  pmtexb.for Version 1.0   cc */
  79. /* c                           cc */
  80. /* cccccccccccccccccccccccccccccc */
  81. /* c */
  82. /* c  file pmtex.inc */
  83. /* c */
  84. /* c      common /all/ mult(5,200),iv,list(4,200),nnl(5),nv,ibar, */
  85. /* c     *   ipl(5,200),ibm1(5,8),ibm2(5,8),nolev(5,200),ibmcnt(5), */
  86. /* c     *   nodur(5,200),ncmid(5),jn,lenbar,iccount,nbars,itsofar(5), */
  87. /* c     *   nib(5,15),nn(5), */
  88. /* c     *   rest(5,200),beamon(5) ,lenbar0,lenbar1,firstline, */
  89. /* c     *   slfac,musicsize,stemmax,stemmin,stemlen */
  90. /* c      common /all/ acc(5,200),ul(5,8),hb(5,8),orn(5,200), */
  91. /* c     *   fig(200),sepsym,s */
  92. /* c      character*6 fig */
  93. /* c      character*1 acc,ul,hb,orn,sepsym,s */
  94. /* c      logical beamon,rest,firstline */
  95. /* c */
  96. /* ccccccccccccccccccccccccccccc */
  97. /* ccccccccccc */
  98. /* c */
  99. /* c  pmtex.inc */
  100. /* c */
  101. /* ccccccccccc */
  102. /* Main program */ MAIN__(void)
  103. {
  104.     /* System generated locals */
  105.     address a__1[2], a__2[3], a__3[8], a__4[4], a__5[4];
  106.     integer i__1[2], i__2, i__3[3], i__4[8], i__5[4], i__6, i__7[4], i__8;
  107.     char ch__1[28], ch__2[68], ch__3[27], ch__4[20], ch__5[6], ch__6[16], 
  108.         ch__7[10], ch__8[11], ch__9[80];
  109.     olist o__1;
  110.     cllist cl__1;
  111.  
  112.     /* Builtin functions */
  113.     integer f_open(olist *), s_rsfe(cilist *), do_fio(integer *, char *, 
  114.         ftnlen), e_rsfe(void), s_rsle(cilist *), do_lio(integer *, 
  115.         integer *, char *, ftnlen), e_rsle(void);
  116.     /* Subroutine */ int s_cat(char *, char **, integer *, integer *, ftnlen);
  117.     integer i_indx(char *, char *, ftnlen, ftnlen), s_wsfe(cilist *), e_wsfe(
  118.         void);
  119.     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
  120.     integer s_wsle(cilist *), e_wsle(void), s_rsfi(icilist *), e_rsfi(void), 
  121.         f_clos(cllist *);
  122.  
  123.     /* Local variables */
  124.     static char clef[1*5];
  125.     static integer ifig;
  126.     extern /* Subroutine */ int makeabar_(void);
  127.     static integer ioff;
  128.     static char line[80], basename[24];
  129.     static logical loop;
  130.     static real xmtrnum0;
  131.     static char pathname[40], autoline[24];
  132.     static integer j, lbase, lpath, iauto, ielperbar, ibarperln;
  133.     static real slfac1;
  134.     static integer ibcoff, ip;
  135.     extern integer ncmidf_(char *, ftnlen);
  136.     static integer noinst, lenbeat, lpp, ibarcnt;
  137.     extern /* Subroutine */ int topfile_(char *, integer *, integer *, char *,
  138.          integer *, integer *, logical *, ftnlen, ftnlen), getnote_(
  139.         logical *);
  140.     extern integer ifnodur_(integer *, char *, ftnlen);
  141.     static integer nstaves;
  142.  
  143.     /* Fortran I/O blocks */
  144.     static cilist io___2 = { 0, 12, 0, "(a)", 0 };
  145.     static cilist io___4 = { 0, 12, 0, 0, 0 };
  146.     static cilist io___6 = { 0, 12, 0, 0, 0 };
  147.     static cilist io___8 = { 0, 10, 0, 0, 0 };
  148.     static cilist io___13 = { 0, 10, 0, "(a24)", 0 };
  149.     static cilist io___14 = { 0, 10, 0, "(a80)", 0 };
  150.     static cilist io___17 = { 0, 10, 0, "(a)", 0 };
  151.     static cilist io___20 = { 0, 13, 0, 0, 0 };
  152.     static cilist io___22 = { 0, 14, 0, "(a)", 0 };
  153.     static cilist io___25 = { 0, 11, 0, "(a)", 0 };
  154.     static cilist io___29 = { 0, 6, 0, 0, 0 };
  155.     static cilist io___30 = { 0, 11, 0, "(a5,i3)", 0 };
  156.     static cilist io___31 = { 0, 11, 0, "(a6)", 0 };
  157.     static cilist io___32 = { 0, 14, 0, "(a16,i2,a10)", 0 };
  158.     static cilist io___33 = { 0, 12, 0, "(a24)", 0 };
  159.     static icilist io___35 = { 0, autoline, 0, "(7x,i2,2x,i2)", 24, 1 };
  160.     static cilist io___38 = { 0, 11, 0, "(a24)", 0 };
  161.     static cilist io___39 = { 0, 12, 0, 0, 0 };
  162.     static cilist io___42 = { 0, 14, 0, "(a16,i2,a10)", 0 };
  163.     static cilist io___43 = { 0, 6, 0, 0, 0 };
  164.  
  165.  
  166.  
  167. /* iccount: pointer in string from input file.  Just before calling getcha
  168. r,*/
  169. /*          it points to the last character retrieved. */
  170. /*  nnl    : # of notes in a line (//) */
  171. /*  itsofar: time in current line from start of line */
  172.  
  173. #line 40 "pmtexb2.f"
  174.     comtop_1.widthpt = 524.f;
  175. #line 41 "pmtexb2.f"
  176.     comtop_1.iwaskpt = 3;
  177. #line 42 "pmtexb2.f"
  178.     comtop_1.height = 770.f;
  179. #line 43 "pmtexb2.f"
  180.     slfac1 = .00569f;
  181. #line 44 "pmtexb2.f"
  182.     all_1.stemmax = 8.2f;
  183. #line 45 "pmtexb2.f"
  184.     all_1.stemmin = 3.9f;
  185. #line 46 "pmtexb2.f"
  186.     all_1.stemlen = 6.f;
  187. /*  Platform-independent backslash */
  188. #line 48 "pmtexb2.f"
  189.     *all_1.s = '\\';
  190. #line 49 "pmtexb2.f"
  191.     o__1.oerr = 0;
  192. #line 49 "pmtexb2.f"
  193.     o__1.ounit = 12;
  194. #line 49 "pmtexb2.f"
  195.     o__1.ofnmlen = 9;
  196. #line 49 "pmtexb2.f"
  197.     o__1.ofnm = "pmtex.dat";
  198. #line 49 "pmtexb2.f"
  199.     o__1.orl = 0;
  200. #line 49 "pmtexb2.f"
  201.     o__1.osta = 0;
  202. #line 49 "pmtexb2.f"
  203.     o__1.oacc = 0;
  204. #line 49 "pmtexb2.f"
  205.     o__1.ofm = 0;
  206. #line 49 "pmtexb2.f"
  207.     o__1.oblnk = 0;
  208. #line 49 "pmtexb2.f"
  209.     f_open(&o__1);
  210. #line 50 "pmtexb2.f"
  211.     s_rsfe(&io___2);
  212. #line 50 "pmtexb2.f"
  213.     do_fio(&c__1, basename, 24L);
  214. #line 50 "pmtexb2.f"
  215.     e_rsfe();
  216. #line 51 "pmtexb2.f"
  217.     s_rsle(&io___4);
  218. #line 51 "pmtexb2.f"
  219.     do_lio(&c__3, &c__1, (char *)&lbase, (ftnlen)sizeof(integer));
  220. #line 51 "pmtexb2.f"
  221.     e_rsle();
  222. #line 52 "pmtexb2.f"
  223.     s_rsle(&io___6);
  224. #line 52 "pmtexb2.f"
  225.     do_lio(&c__3, &c__1, (char *)&comtop_1.itopfacteur, (ftnlen)sizeof(
  226. #line 52 "pmtexb2.f"
  227.         integer));
  228. #line 52 "pmtexb2.f"
  229.     do_lio(&c__3, &c__1, (char *)&comtop_1.ibotfacteur, (ftnlen)sizeof(
  230. #line 52 "pmtexb2.f"
  231.         integer));
  232. #line 52 "pmtexb2.f"
  233.     do_lio(&c__3, &c__1, (char *)&comtop_1.interfacteur, (ftnlen)sizeof(
  234. #line 52 "pmtexb2.f"
  235.         integer));
  236. #line 52 "pmtexb2.f"
  237.     do_lio(&c__3, &c__1, (char *)&iauto, (ftnlen)sizeof(integer));
  238. #line 52 "pmtexb2.f"
  239.     e_rsle();
  240. #line 53 "pmtexb2.f"
  241.     o__1.oerr = 0;
  242. #line 53 "pmtexb2.f"
  243.     o__1.ounit = 10;
  244. #line 53 "pmtexb2.f"
  245.     o__1.ofnmlen = lbase + 4;
  246. /* Writing concatenation */
  247. #line 53 "pmtexb2.f"
  248.     i__1[0] = lbase, a__1[0] = basename;
  249. #line 53 "pmtexb2.f"
  250.     i__1[1] = 4, a__1[1] = ".inp";
  251. #line 53 "pmtexb2.f"
  252.     s_cat(ch__1, a__1, i__1, &c__2, 28L);
  253. #line 53 "pmtexb2.f"
  254.     o__1.ofnm = ch__1;
  255. #line 53 "pmtexb2.f"
  256.     o__1.orl = 0;
  257. #line 53 "pmtexb2.f"
  258.     o__1.osta = 0;
  259. #line 53 "pmtexb2.f"
  260.     o__1.oacc = 0;
  261. #line 53 "pmtexb2.f"
  262.     o__1.ofm = 0;
  263. #line 53 "pmtexb2.f"
  264.     o__1.oblnk = 0;
  265. #line 53 "pmtexb2.f"
  266.     f_open(&o__1);
  267. #line 54 "pmtexb2.f"
  268.     s_rsle(&io___8);
  269. #line 54 "pmtexb2.f"
  270.     do_lio(&c__3, &c__1, (char *)&all_1.nv, (ftnlen)sizeof(integer));
  271. #line 54 "pmtexb2.f"
  272.     do_lio(&c__3, &c__1, (char *)&noinst, (ftnlen)sizeof(integer));
  273. #line 54 "pmtexb2.f"
  274.     do_lio(&c__3, &c__1, (char *)&comtop_1.mtrnum, (ftnlen)sizeof(integer));
  275. #line 54 "pmtexb2.f"
  276.     do_lio(&c__3, &c__1, (char *)&comtop_1.mtrden, (ftnlen)sizeof(integer));
  277. #line 54 "pmtexb2.f"
  278.     do_lio(&c__3, &c__1, (char *)&comtop_1.imeter, (ftnlen)sizeof(integer));
  279. #line 54 "pmtexb2.f"
  280.     do_lio(&c__4, &c__1, (char *)&xmtrnum0, (ftnlen)sizeof(real));
  281. #line 54 "pmtexb2.f"
  282.     do_lio(&c__3, &c__1, (char *)&comtop_1.isig, (ftnlen)sizeof(integer));
  283. #line 54 "pmtexb2.f"
  284.     do_lio(&c__3, &c__1, (char *)&lpp, (ftnlen)sizeof(integer));
  285. #line 54 "pmtexb2.f"
  286.     do_lio(&c__3, &c__1, (char *)&nstaves, (ftnlen)sizeof(integer));
  287. #line 54 "pmtexb2.f"
  288.     do_lio(&c__3, &c__1, (char *)&all_1.musicsize, (ftnlen)sizeof(integer));
  289. #line 54 "pmtexb2.f"
  290.     do_lio(&c__4, &c__1, (char *)&comtop_1.fracindent, (ftnlen)sizeof(real));
  291. #line 54 "pmtexb2.f"
  292.     e_rsle();
  293.  
  294. /* imeter = 0 for fraction        noinst = 0  if several voices, 1 inst */
  295. /*          2,3,4  single-digit            nv if separate inst's */
  296. /*          5 for cut time */
  297. /*          6 for common time */
  298.  
  299. #line 62 "pmtexb2.f"
  300.     i__2 = all_1.nv;
  301. #line 62 "pmtexb2.f"
  302.     for (all_1.iv = 1; all_1.iv <= i__2; ++all_1.iv) {
  303. #line 63 "pmtexb2.f"
  304.     s_rsfe(&io___13);
  305. #line 63 "pmtexb2.f"
  306.     do_fio(&c__1, comtop_1.iname + (all_1.iv - 1) * 24, 24L);
  307. #line 63 "pmtexb2.f"
  308.     e_rsfe();
  309. #line 64 "pmtexb2.f"
  310. /* L6: */
  311. #line 64 "pmtexb2.f"
  312.     }
  313. #line 65 "pmtexb2.f"
  314.     s_rsfe(&io___14);
  315. #line 65 "pmtexb2.f"
  316.     do_fio(&c__1, line, 80L);
  317. #line 65 "pmtexb2.f"
  318.     e_rsfe();
  319. #line 66 "pmtexb2.f"
  320.     i__2 = all_1.nv;
  321. #line 66 "pmtexb2.f"
  322.     for (all_1.iv = 1; all_1.iv <= i__2; ++all_1.iv) {
  323. #line 67 "pmtexb2.f"
  324.     clef[all_1.iv - 1] = line[all_1.iv - 1];
  325. #line 68 "pmtexb2.f"
  326. /* L7: */
  327. #line 68 "pmtexb2.f"
  328.     }
  329. #line 69 "pmtexb2.f"
  330.     s_rsfe(&io___17);
  331. #line 69 "pmtexb2.f"
  332.     do_fio(&c__1, pathname, 40L);
  333. #line 69 "pmtexb2.f"
  334.     e_rsfe();
  335. #line 70 "pmtexb2.f"
  336.     lpath = i_indx(pathname, " ", 40L, 1L) - 1;
  337. #line 71 "pmtexb2.f"
  338.     o__1.oerr = 0;
  339. #line 71 "pmtexb2.f"
  340.     o__1.ounit = 13;
  341. #line 71 "pmtexb2.f"
  342.     o__1.ofnmlen = 9;
  343. #line 71 "pmtexb2.f"
  344.     o__1.ofnm = "pmtex.fig";
  345. #line 71 "pmtexb2.f"
  346.     o__1.orl = 0;
  347. #line 71 "pmtexb2.f"
  348.     o__1.osta = 0;
  349. #line 71 "pmtexb2.f"
  350.     o__1.oacc = 0;
  351. #line 71 "pmtexb2.f"
  352.     o__1.ofm = 0;
  353. #line 71 "pmtexb2.f"
  354.     o__1.oblnk = 0;
  355. #line 71 "pmtexb2.f"
  356.     f_open(&o__1);
  357. #line 72 "pmtexb2.f"
  358.     comfig_1.figbass = FALSE_;
  359. #line 73 "pmtexb2.f"
  360.     s_rsle(&io___20);
  361. #line 73 "pmtexb2.f"
  362.     do_lio(&c__3, &c__1, (char *)&ifig, (ftnlen)sizeof(integer));
  363. #line 73 "pmtexb2.f"
  364.     e_rsle();
  365. #line 74 "pmtexb2.f"
  366.     if (ifig == 1) {
  367. #line 75 "pmtexb2.f"
  368.     comfig_1.figbass = TRUE_;
  369. #line 76 "pmtexb2.f"
  370.     comfig_1.iline = 1;
  371. #line 77 "pmtexb2.f"
  372.     comfig_1.ifigdrop[0] = 4;
  373. #line 78 "pmtexb2.f"
  374.     o__1.oerr = 0;
  375. #line 78 "pmtexb2.f"
  376.     o__1.ounit = 14;
  377. #line 78 "pmtexb2.f"
  378.     o__1.ofnmlen = lpath + lbase + 4;
  379. /* Writing concatenation */
  380. #line 78 "pmtexb2.f"
  381.     i__3[0] = lpath, a__2[0] = pathname;
  382. #line 78 "pmtexb2.f"
  383.     i__3[1] = lbase, a__2[1] = basename;
  384. #line 78 "pmtexb2.f"
  385.     i__3[2] = 4, a__2[2] = ".fig";
  386. #line 78 "pmtexb2.f"
  387.     s_cat(ch__2, a__2, i__3, &c__3, 68L);
  388. #line 78 "pmtexb2.f"
  389.     o__1.ofnm = ch__2;
  390. #line 78 "pmtexb2.f"
  391.     o__1.orl = 0;
  392. #line 78 "pmtexb2.f"
  393.     o__1.osta = 0;
  394. #line 78 "pmtexb2.f"
  395.     o__1.oacc = 0;
  396. #line 78 "pmtexb2.f"
  397.     o__1.ofm = 0;
  398. #line 78 "pmtexb2.f"
  399.     o__1.oblnk = 0;
  400. #line 78 "pmtexb2.f"
  401.     f_open(&o__1);
  402. #line 79 "pmtexb2.f"
  403.     s_wsfe(&io___22);
  404. /* Writing concatenation */
  405. #line 79 "pmtexb2.f"
  406.     i__4[0] = 1, a__3[0] = all_1.s;
  407. #line 79 "pmtexb2.f"
  408.     i__4[1] = 3, a__3[1] = "def";
  409. #line 79 "pmtexb2.f"
  410.     i__4[2] = 1, a__3[2] = all_1.s;
  411. #line 79 "pmtexb2.f"
  412.     i__4[3] = 8, a__3[3] = "fixdrop{";
  413. #line 79 "pmtexb2.f"
  414.     i__4[4] = 1, a__3[4] = all_1.s;
  415. #line 79 "pmtexb2.f"
  416.     i__4[5] = 6, a__3[5] = "ifcase";
  417. #line 79 "pmtexb2.f"
  418.     i__4[6] = 1, a__3[6] = all_1.s;
  419. #line 79 "pmtexb2.f"
  420.     i__4[7] = 6, a__3[7] = "sysno%";
  421. #line 79 "pmtexb2.f"
  422.     s_cat(ch__3, a__3, i__4, &c__8, 27L);
  423. #line 79 "pmtexb2.f"
  424.     do_fio(&c__1, ch__3, 27L);
  425. #line 79 "pmtexb2.f"
  426.     e_wsfe();
  427. #line 81 "pmtexb2.f"
  428.     }
  429. #line 82 "pmtexb2.f"
  430.     comget_1.lastchar = FALSE_;
  431. /*  Bar count offset */
  432. #line 84 "pmtexb2.f"
  433.     ibcoff = 0;
  434. #line 85 "pmtexb2.f"
  435.     if (xmtrnum0 > 0.f) {
  436. #line 85 "pmtexb2.f"
  437.     ibcoff = -1;
  438. #line 85 "pmtexb2.f"
  439.     }
  440. #line 86 "pmtexb2.f"
  441.     o__1.oerr = 0;
  442. #line 86 "pmtexb2.f"
  443.     o__1.ounit = 11;
  444. #line 86 "pmtexb2.f"
  445.     o__1.ofnmlen = lpath + lbase + 4;
  446. /* Writing concatenation */
  447. #line 86 "pmtexb2.f"
  448.     i__3[0] = lpath, a__2[0] = pathname;
  449. #line 86 "pmtexb2.f"
  450.     i__3[1] = lbase, a__2[1] = basename;
  451. #line 86 "pmtexb2.f"
  452.     i__3[2] = 4, a__2[2] = ".tex";
  453. #line 86 "pmtexb2.f"
  454.     s_cat(ch__2, a__2, i__3, &c__3, 68L);
  455. #line 86 "pmtexb2.f"
  456.     o__1.ofnm = ch__2;
  457. #line 86 "pmtexb2.f"
  458.     o__1.orl = 0;
  459. #line 86 "pmtexb2.f"
  460.     o__1.osta = 0;
  461. #line 86 "pmtexb2.f"
  462.     o__1.oacc = 0;
  463. #line 86 "pmtexb2.f"
  464.     o__1.ofm = 0;
  465. #line 86 "pmtexb2.f"
  466.     o__1.oblnk = 0;
  467. #line 86 "pmtexb2.f"
  468.     f_open(&o__1);
  469. #line 87 "pmtexb2.f"
  470.     *all_1.sepsym = '|';
  471. #line 88 "pmtexb2.f"
  472.     if (noinst > 1) {
  473. #line 88 "pmtexb2.f"
  474.     *all_1.sepsym = '&';
  475. #line 88 "pmtexb2.f"
  476.     }
  477. #line 89 "pmtexb2.f"
  478.     topfile_(basename, &lbase, &all_1.nv, clef, &noinst, &all_1.musicsize, &
  479. #line 89 "pmtexb2.f"
  480.         comfig_1.figbass, 24L, 1L);
  481. #line 90 "pmtexb2.f"
  482.     lenbeat = ifnodur_(&comtop_1.mtrden, "x", 1L);
  483. #line 91 "pmtexb2.f"
  484.     all_1.lenbar = comtop_1.mtrnum * lenbeat;
  485. #line 92 "pmtexb2.f"
  486.     all_1.lenbar1 = comtop_1.mtrnum * lenbeat;
  487. #line 93 "pmtexb2.f"
  488.     all_1.lenbar0 = xmtrnum0 * lenbeat + .5f;
  489. #line 94 "pmtexb2.f"
  490.     if (all_1.lenbar0 != 0) {
  491. #line 95 "pmtexb2.f"
  492.     s_wsfe(&io___25);
  493. /* Writing concatenation */
  494. #line 95 "pmtexb2.f"
  495.     i__5[0] = 1, a__4[0] = all_1.s;
  496. #line 95 "pmtexb2.f"
  497.     i__5[1] = 7, a__4[1] = "advance";
  498. #line 95 "pmtexb2.f"
  499.     i__5[2] = 1, a__4[2] = all_1.s;
  500. #line 95 "pmtexb2.f"
  501.     i__5[3] = 11, a__4[3] = "barno by -1";
  502. #line 95 "pmtexb2.f"
  503.     s_cat(ch__4, a__4, i__5, &c__4, 20L);
  504. #line 95 "pmtexb2.f"
  505.     do_fio(&c__1, ch__4, 20L);
  506. #line 95 "pmtexb2.f"
  507.     e_wsfe();
  508. #line 96 "pmtexb2.f"
  509.     all_1.lenbar = all_1.lenbar0;
  510. #line 97 "pmtexb2.f"
  511.     } else {
  512. #line 98 "pmtexb2.f"
  513.     all_1.lenbar = all_1.lenbar1;
  514. #line 99 "pmtexb2.f"
  515.     }
  516. /* ### The following may need revision for different time sig's. */
  517. #line 101 "pmtexb2.f"
  518.     if (comtop_1.mtrden == 4) {
  519. #line 102 "pmtexb2.f"
  520.     combeam_1.lenbeam = 24;
  521. #line 103 "pmtexb2.f"
  522.     } else if (comtop_1.mtrden == 8) {
  523. #line 104 "pmtexb2.f"
  524.     combeam_1.lenbeam = 36;
  525. #line 105 "pmtexb2.f"
  526.     }
  527. #line 106 "pmtexb2.f"
  528.     ibarcnt = 0;
  529. #line 107 "pmtexb2.f"
  530.     all_1.iccount = 80;
  531. #line 108 "pmtexb2.f"
  532.     i__2 = all_1.nv;
  533. #line 108 "pmtexb2.f"
  534.     for (all_1.iv = 1; all_1.iv <= i__2; ++all_1.iv) {
  535. #line 109 "pmtexb2.f"
  536.     all_1.ncmid[all_1.iv - 1] = ncmidf_(clef + (all_1.iv - 1), 1L);
  537. #line 110 "pmtexb2.f"
  538. /* L1: */
  539. #line 110 "pmtexb2.f"
  540.     }
  541.  
  542. /*  Initialize for loop over lines */
  543.  
  544. #line 114 "pmtexb2.f"
  545.     all_1.firstline = TRUE_;
  546. #line 115 "pmtexb2.f"
  547. L30:
  548. #line 115 "pmtexb2.f"
  549.     loop = TRUE_;
  550. #line 116 "pmtexb2.f"
  551.     all_1.nbars = 0;
  552. #line 117 "pmtexb2.f"
  553. /* L3: */
  554. #line 117 "pmtexb2.f"
  555.     i__2 = all_1.nv;
  556. #line 117 "pmtexb2.f"
  557.     for (all_1.iv = 1; all_1.iv <= i__2; ++all_1.iv) {
  558. #line 118 "pmtexb2.f"
  559.     all_1.itsofar[all_1.iv - 1] = 0;
  560. #line 119 "pmtexb2.f"
  561.     all_1.nnl[all_1.iv - 1] = 0;
  562. #line 120 "pmtexb2.f"
  563.     for (j = 1; j <= 200; ++j) {
  564. #line 121 "pmtexb2.f"
  565.         all_1.rest[all_1.iv + j * 5 - 6] = FALSE_;
  566. #line 122 "pmtexb2.f"
  567.         all_1.acc[all_1.iv + j * 5 - 6] = 'x';
  568. #line 123 "pmtexb2.f"
  569.         all_1.orn[all_1.iv + j * 5 - 6] = 'x';
  570. #line 124 "pmtexb2.f"
  571.         if (all_1.iv == 1) {
  572. #line 124 "pmtexb2.f"
  573.         s_copy(all_1.fig + (j - 1) * 6, "x", 6L, 1L);
  574. #line 124 "pmtexb2.f"
  575.         }
  576. #line 125 "pmtexb2.f"
  577. /* L5: */
  578. #line 125 "pmtexb2.f"
  579.     }
  580. #line 126 "pmtexb2.f"
  581. /* L4: */
  582. #line 126 "pmtexb2.f"
  583.     }
  584. #line 127 "pmtexb2.f"
  585.     all_1.iv = 1;
  586. #line 128 "pmtexb2.f"
  587. L2:
  588. #line 128 "pmtexb2.f"
  589.     if (loop) {
  590.  
  591. /* Within this loop, nv voices are filled up for the duration of the l
  592. ine.*/
  593. /*  On exit (loop=.false.) the following are set: nnl(nv),itsofar(nv) 
  594. */
  595. /*  nolev(nv,nnl(nv)),nodur(..),acc(..),rest(..).  nnl will later be 
  596. */
  597. /*  increased and things slid around as accidental skips are added. */
  598.  
  599. #line 135 "pmtexb2.f"
  600.     getnote_(&loop);
  601. #line 136 "pmtexb2.f"
  602.     if (comget_1.lastchar) {
  603. #line 136 "pmtexb2.f"
  604.         goto L40;
  605. #line 136 "pmtexb2.f"
  606.     }
  607. #line 137 "pmtexb2.f"
  608.     goto L2;
  609. #line 138 "pmtexb2.f"
  610.     }
  611. #line 139 "pmtexb2.f"
  612.     all_1.firstline = FALSE_;
  613. #line 140 "pmtexb2.f"
  614.     i__2 = all_1.nbars;
  615. #line 140 "pmtexb2.f"
  616.     for (all_1.ibar = 1; all_1.ibar <= i__2; ++all_1.ibar) {
  617. #line 141 "pmtexb2.f"
  618.     ++ibarcnt;
  619. #line 142 "pmtexb2.f"
  620.     s_wsle(&io___29);
  621. #line 142 "pmtexb2.f"
  622.     do_lio(&c__9, &c__1, "Now processing bar #", 20L);
  623. #line 142 "pmtexb2.f"
  624.     i__6 = ibarcnt + ibcoff;
  625. #line 142 "pmtexb2.f"
  626.     do_lio(&c__3, &c__1, (char *)&i__6, (ftnlen)sizeof(integer));
  627. #line 142 "pmtexb2.f"
  628.     e_wsle();
  629. #line 143 "pmtexb2.f"
  630.     s_wsfe(&io___30);
  631. #line 143 "pmtexb2.f"
  632.     do_fio(&c__1, "% bar", 5L);
  633. #line 143 "pmtexb2.f"
  634.     i__6 = ibarcnt + ibcoff;
  635. #line 143 "pmtexb2.f"
  636.     do_fio(&c__1, (char *)&i__6, (ftnlen)sizeof(integer));
  637. #line 143 "pmtexb2.f"
  638.     e_wsfe();
  639. #line 144 "pmtexb2.f"
  640.     if (ibarcnt > 1) {
  641. #line 145 "pmtexb2.f"
  642.         s_wsfe(&io___31);
  643. /* Writing concatenation */
  644. #line 145 "pmtexb2.f"
  645.         i__1[0] = 1, a__1[0] = all_1.s;
  646. #line 145 "pmtexb2.f"
  647.         i__1[1] = 5, a__1[1] = "barre";
  648. #line 145 "pmtexb2.f"
  649.         s_cat(ch__5, a__1, i__1, &c__2, 6L);
  650. #line 145 "pmtexb2.f"
  651.         do_fio(&c__1, ch__5, 6L);
  652. #line 145 "pmtexb2.f"
  653.         e_wsfe();
  654. #line 146 "pmtexb2.f"
  655.         if (ibarcnt == iauto && comfig_1.figbass) {
  656. #line 147 "pmtexb2.f"
  657.         s_wsfe(&io___32);
  658. /* Writing concatenation */
  659. #line 147 "pmtexb2.f"
  660.         i__5[0] = 1, a__4[0] = all_1.s;
  661. #line 147 "pmtexb2.f"
  662.         i__5[1] = 6, a__4[1] = "global";
  663. #line 147 "pmtexb2.f"
  664.         i__5[2] = 1, a__4[2] = all_1.s;
  665. #line 147 "pmtexb2.f"
  666.         i__5[3] = 8, a__4[3] = "figdrop=";
  667. #line 147 "pmtexb2.f"
  668.         s_cat(ch__6, a__4, i__5, &c__4, 16L);
  669. #line 147 "pmtexb2.f"
  670.         do_fio(&c__1, ch__6, 16L);
  671. #line 147 "pmtexb2.f"
  672.         do_fio(&c__1, (char *)&comfig_1.ifigdrop[comfig_1.iline - 1], 
  673. #line 147 "pmtexb2.f"
  674.             (ftnlen)sizeof(integer));
  675. /* Writing concatenation */
  676. #line 147 "pmtexb2.f"
  677.         i__7[0] = 1, a__5[0] = all_1.s;
  678. #line 147 "pmtexb2.f"
  679.         i__7[1] = 5, a__5[1] = "relax";
  680. #line 147 "pmtexb2.f"
  681.         i__7[2] = 1, a__5[2] = all_1.s;
  682. #line 147 "pmtexb2.f"
  683.         i__7[3] = 3, a__5[3] = "or%";
  684. #line 147 "pmtexb2.f"
  685.         s_cat(ch__7, a__5, i__7, &c__4, 10L);
  686. #line 147 "pmtexb2.f"
  687.         do_fio(&c__1, ch__7, 10L);
  688. #line 147 "pmtexb2.f"
  689.         e_wsfe();
  690. #line 150 "pmtexb2.f"
  691.         ++comfig_1.iline;
  692. #line 151 "pmtexb2.f"
  693.         comfig_1.ifigdrop[comfig_1.iline - 1] = 4;
  694. #line 152 "pmtexb2.f"
  695.         }
  696. #line 153 "pmtexb2.f"
  697.     }
  698. #line 154 "pmtexb2.f"
  699.     if (ibarcnt == iauto) {
  700. #line 155 "pmtexb2.f"
  701.         s_rsfe(&io___33);
  702. #line 155 "pmtexb2.f"
  703.         do_fio(&c__1, autoline, 24L);
  704. #line 155 "pmtexb2.f"
  705.         e_rsfe();
  706. #line 156 "pmtexb2.f"
  707.         s_rsfi(&io___35);
  708. #line 156 "pmtexb2.f"
  709.         do_fio(&c__1, (char *)&ielperbar, (ftnlen)sizeof(integer));
  710. #line 156 "pmtexb2.f"
  711.         do_fio(&c__1, (char *)&ibarperln, (ftnlen)sizeof(integer));
  712. #line 156 "pmtexb2.f"
  713.         e_rsfi();
  714. #line 157 "pmtexb2.f"
  715.         all_1.slfac = slfac1 * all_1.musicsize * ielperbar * ibarperln;
  716. #line 158 "pmtexb2.f"
  717.         s_wsfe(&io___38);
  718. #line 158 "pmtexb2.f"
  719.         do_fio(&c__1, autoline, 24L);
  720. #line 158 "pmtexb2.f"
  721.         e_wsfe();
  722. #line 159 "pmtexb2.f"
  723.         s_rsle(&io___39);
  724. #line 159 "pmtexb2.f"
  725.         do_lio(&c__3, &c__1, (char *)&iauto, (ftnlen)sizeof(integer));
  726. #line 159 "pmtexb2.f"
  727.         e_rsle();
  728. #line 160 "pmtexb2.f"
  729.     }
  730. #line 161 "pmtexb2.f"
  731.     if (all_1.ibar > 1) {
  732.  
  733. /*  For bars after first, slide all stuff down to beginning of arr
  734. ays */
  735.  
  736. #line 165 "pmtexb2.f"
  737.         i__6 = all_1.nv;
  738. #line 165 "pmtexb2.f"
  739.         for (all_1.iv = 1; all_1.iv <= i__6; ++all_1.iv) {
  740. #line 166 "pmtexb2.f"
  741.         ioff = all_1.nib[all_1.iv + (all_1.ibar - 1) * 5 - 6];
  742. #line 167 "pmtexb2.f"
  743.         i__8 = all_1.nib[all_1.iv + all_1.ibar * 5 - 6] - ioff;
  744. #line 167 "pmtexb2.f"
  745.         for (ip = 1; ip <= i__8; ++ip) {
  746. #line 168 "pmtexb2.f"
  747.             all_1.nolev[all_1.iv + ip * 5 - 6] = all_1.nolev[all_1.iv 
  748. #line 168 "pmtexb2.f"
  749.                 + (ip + ioff) * 5 - 6];
  750. #line 169 "pmtexb2.f"
  751.             all_1.nodur[all_1.iv + ip * 5 - 6] = all_1.nodur[all_1.iv 
  752. #line 169 "pmtexb2.f"
  753.                 + (ip + ioff) * 5 - 6];
  754. #line 170 "pmtexb2.f"
  755.             all_1.acc[all_1.iv + ip * 5 - 6] = all_1.acc[all_1.iv + (
  756. #line 170 "pmtexb2.f"
  757.                 ip + ioff) * 5 - 6];
  758. #line 171 "pmtexb2.f"
  759.             all_1.rest[all_1.iv + ip * 5 - 6] = all_1.rest[all_1.iv + 
  760. #line 171 "pmtexb2.f"
  761.                 (ip + ioff) * 5 - 6];
  762. #line 172 "pmtexb2.f"
  763.             all_1.orn[all_1.iv + ip * 5 - 6] = all_1.orn[all_1.iv + (
  764. #line 172 "pmtexb2.f"
  765.                 ip + ioff) * 5 - 6];
  766. #line 173 "pmtexb2.f"
  767.             if (all_1.iv == 1) {
  768. #line 173 "pmtexb2.f"
  769.             s_copy(all_1.fig + (ip - 1) * 6, all_1.fig + (ip + 
  770. #line 173 "pmtexb2.f"
  771.                 ioff - 1) * 6, 6L, 6L);
  772. #line 173 "pmtexb2.f"
  773.             }
  774. #line 174 "pmtexb2.f"
  775. /* L12: */
  776. #line 174 "pmtexb2.f"
  777.         }
  778. #line 175 "pmtexb2.f"
  779. /* L11: */
  780. #line 175 "pmtexb2.f"
  781.         }
  782. #line 176 "pmtexb2.f"
  783.     }
  784. #line 177 "pmtexb2.f"
  785.     makeabar_();
  786. #line 178 "pmtexb2.f"
  787. /* L10: */
  788. #line 178 "pmtexb2.f"
  789.     }
  790. #line 179 "pmtexb2.f"
  791.     goto L30;
  792. #line 180 "pmtexb2.f"
  793. L40:
  794. #line 180 "pmtexb2.f"
  795.     cl__1.cerr = 0;
  796. #line 180 "pmtexb2.f"
  797.     cl__1.cunit = 12;
  798. #line 180 "pmtexb2.f"
  799.     cl__1.csta = 0;
  800. #line 180 "pmtexb2.f"
  801.     f_clos(&cl__1);
  802. #line 181 "pmtexb2.f"
  803.     cl__1.cerr = 0;
  804. #line 181 "pmtexb2.f"
  805.     cl__1.cunit = 13;
  806. #line 181 "pmtexb2.f"
  807.     cl__1.csta = 0;
  808. #line 181 "pmtexb2.f"
  809.     f_clos(&cl__1);
  810. #line 182 "pmtexb2.f"
  811.     cl__1.cerr = 0;
  812. #line 182 "pmtexb2.f"
  813.     cl__1.cunit = 10;
  814. #line 182 "pmtexb2.f"
  815.     cl__1.csta = 0;
  816. #line 182 "pmtexb2.f"
  817.     f_clos(&cl__1);
  818. #line 183 "pmtexb2.f"
  819.     cl__1.cerr = 0;
  820. #line 183 "pmtexb2.f"
  821.     cl__1.cunit = 11;
  822. #line 183 "pmtexb2.f"
  823.     cl__1.csta = 0;
  824. #line 183 "pmtexb2.f"
  825.     f_clos(&cl__1);
  826. #line 184 "pmtexb2.f"
  827.     if (comfig_1.figbass) {
  828. #line 185 "pmtexb2.f"
  829.     s_wsfe(&io___42);
  830. /* Writing concatenation */
  831. #line 185 "pmtexb2.f"
  832.     i__5[0] = 1, a__4[0] = all_1.s;
  833. #line 185 "pmtexb2.f"
  834.     i__5[1] = 6, a__4[1] = "global";
  835. #line 185 "pmtexb2.f"
  836.     i__5[2] = 1, a__4[2] = all_1.s;
  837. #line 185 "pmtexb2.f"
  838.     i__5[3] = 8, a__4[3] = "figdrop=";
  839. #line 185 "pmtexb2.f"
  840.     s_cat(ch__6, a__4, i__5, &c__4, 16L);
  841. #line 185 "pmtexb2.f"
  842.     do_fio(&c__1, ch__6, 16L);
  843. #line 185 "pmtexb2.f"
  844.     do_fio(&c__1, (char *)&comfig_1.ifigdrop[comfig_1.iline - 1], (ftnlen)
  845. #line 185 "pmtexb2.f"
  846.         sizeof(integer));
  847. /* Writing concatenation */
  848. #line 185 "pmtexb2.f"
  849.     i__7[0] = 1, a__5[0] = all_1.s;
  850. #line 185 "pmtexb2.f"
  851.     i__7[1] = 5, a__5[1] = "relax";
  852. #line 185 "pmtexb2.f"
  853.     i__7[2] = 1, a__5[2] = all_1.s;
  854. #line 185 "pmtexb2.f"
  855.     i__7[3] = 4, a__5[3] = "fi}%";
  856. #line 185 "pmtexb2.f"
  857.     s_cat(ch__8, a__5, i__7, &c__4, 11L);
  858. #line 185 "pmtexb2.f"
  859.     do_fio(&c__1, ch__8, 11L);
  860. #line 185 "pmtexb2.f"
  861.     e_wsfe();
  862. #line 188 "pmtexb2.f"
  863.     cl__1.cerr = 0;
  864. #line 188 "pmtexb2.f"
  865.     cl__1.cunit = 14;
  866. #line 188 "pmtexb2.f"
  867.     cl__1.csta = 0;
  868. #line 188 "pmtexb2.f"
  869.     f_clos(&cl__1);
  870. #line 189 "pmtexb2.f"
  871.     }
  872. #line 190 "pmtexb2.f"
  873.     s_wsle(&io___43);
  874. #line 190 "pmtexb2.f"
  875.     do_lio(&c__9, &c__1, "Writing ", 8L);
  876. /* Writing concatenation */
  877. #line 190 "pmtexb2.f"
  878.     i__5[0] = lpath, a__4[0] = pathname;
  879. #line 190 "pmtexb2.f"
  880.     i__5[1] = lbase, a__4[1] = basename;
  881. #line 190 "pmtexb2.f"
  882.     i__5[2] = 5, a__4[2] = ".tex ";
  883. #line 190 "pmtexb2.f"
  884.     i__5[3] = 11, a__4[3] = "and exiting";
  885. #line 190 "pmtexb2.f"
  886.     s_cat(ch__9, a__4, i__5, &c__4, 80L);
  887. #line 190 "pmtexb2.f"
  888.     do_lio(&c__9, &c__1, ch__9, lpath + lbase + 16);
  889. #line 190 "pmtexb2.f"
  890.     e_wsle();
  891. #line 192 "pmtexb2.f"
  892.     return 0;
  893. } /* MAIN__ */
  894.  
  895. /* Subroutine */ int getnote_(logical *loop)
  896. {
  897.     /* System generated locals */
  898.     address a__1[2];
  899.     integer i__1[2];
  900.  
  901.     /* Builtin functions */
  902.     integer s_rsfi(icilist *), do_fio(integer *, char *, ftnlen), e_rsfi(void)
  903.         ;
  904.     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen), s_cat(char *,
  905.          char **, integer *, integer *, ftnlen);
  906.  
  907.     /* Local variables */
  908.     static char char_[1];
  909.     static integer lfig;
  910.     static char line[80];
  911.     static integer ioct, inodur;
  912.     static char oct[1], dot[1];
  913.     extern /* Subroutine */ int getchar_(char *, integer *, char *, ftnlen, 
  914.         ftnlen);
  915.     extern integer ifnolev_(char *, integer *, ftnlen), ifnodur_(integer *, 
  916.         char *, ftnlen);
  917.  
  918.     /* Fortran I/O blocks */
  919.     static icilist io___48 = { 0, oct, 0, "(i1)", 1, 1 };
  920.     static icilist io___50 = { 0, char_, 0, "(i1)", 1, 1 };
  921.     static icilist io___53 = { 0, char_, 0, "(i1)", 1, 1 };
  922.  
  923.  
  924. /* ccccccccccc */
  925. /* c */
  926. /* c  pmtex.inc */
  927. /* c */
  928. /* ccccccccccc */
  929. #line 199 "pmtexb2.f"
  930. L1:
  931. #line 199 "pmtexb2.f"
  932.     getchar_(line, &all_1.iccount, char_, 80L, 1L);
  933. #line 200 "pmtexb2.f"
  934.     if (comget_1.lastchar) {
  935. #line 200 "pmtexb2.f"
  936.     return 0;
  937. #line 200 "pmtexb2.f"
  938.     }
  939. #line 201 "pmtexb2.f"
  940.     if (*char_ == ' ') {
  941. #line 202 "pmtexb2.f"
  942.     goto L1;
  943. #line 203 "pmtexb2.f"
  944.     } else if (*char_ == '%') {
  945. #line 204 "pmtexb2.f"
  946.     all_1.iccount = 80;
  947. #line 205 "pmtexb2.f"
  948.     goto L1;
  949. #line 206 "pmtexb2.f"
  950.     } else if (*char_ >= 97 && *char_ <= 103) {
  951.  
  952. /* This is a note.  Increase note count, get octave & basic duration. 
  953. */
  954.  
  955. #line 210 "pmtexb2.f"
  956.     ++all_1.nnl[all_1.iv - 1];
  957. #line 211 "pmtexb2.f"
  958.     getchar_(line, &all_1.iccount, oct, 80L, 1L);
  959. #line 212 "pmtexb2.f"
  960.     if (comget_1.lastchar) {
  961. #line 212 "pmtexb2.f"
  962.         return 0;
  963. #line 212 "pmtexb2.f"
  964.     }
  965. #line 213 "pmtexb2.f"
  966.     *dot = 'x';
  967. #line 214 "pmtexb2.f"
  968.     if (*oct != ' ') {
  969. #line 215 "pmtexb2.f"
  970.         s_rsfi(&io___48);
  971. #line 215 "pmtexb2.f"
  972.         do_fio(&c__1, (char *)&ioct, (ftnlen)sizeof(integer));
  973. #line 215 "pmtexb2.f"
  974.         e_rsfi();
  975. #line 216 "pmtexb2.f"
  976.         all_1.nolev[all_1.iv + all_1.nnl[all_1.iv - 1] * 5 - 6] = 
  977. #line 216 "pmtexb2.f"
  978.             ifnolev_(char_, &ioct, 1L);
  979. #line 217 "pmtexb2.f"
  980.         getchar_(line, &all_1.iccount, char_, 80L, 1L);
  981. #line 218 "pmtexb2.f"
  982.         if (comget_1.lastchar) {
  983. #line 218 "pmtexb2.f"
  984.         return 0;
  985. #line 218 "pmtexb2.f"
  986.         }
  987. #line 219 "pmtexb2.f"
  988.     } else {
  989. /* #### Get octave from previous one */
  990. #line 221 "pmtexb2.f"
  991.         all_1.nolev[all_1.iv + all_1.nnl[all_1.iv - 1] * 5 - 6] = 
  992. #line 221 "pmtexb2.f"
  993.             ifnolev_(char_, &ioct, 1L);
  994. #line 222 "pmtexb2.f"
  995.         if (all_1.nolev[all_1.iv + all_1.nnl[all_1.iv - 1] * 5 - 6] > 
  996. #line 222 "pmtexb2.f"
  997.             all_1.nolev[all_1.iv + (all_1.nnl[all_1.iv - 1] - 1) * 5 
  998. #line 222 "pmtexb2.f"
  999.             - 6] + 3) {
  1000. #line 223 "pmtexb2.f"
  1001.         all_1.nolev[all_1.iv + all_1.nnl[all_1.iv - 1] * 5 - 6] += -7;
  1002. #line 224 "pmtexb2.f"
  1003.         } else if (all_1.nolev[all_1.iv + all_1.nnl[all_1.iv - 1] * 5 - 6]
  1004. #line 224 "pmtexb2.f"
  1005.              < all_1.nolev[all_1.iv + (all_1.nnl[all_1.iv - 1] - 1) * 
  1006. #line 224 "pmtexb2.f"
  1007.             5 - 6] - 3) {
  1008. #line 225 "pmtexb2.f"
  1009.         all_1.nolev[all_1.iv + all_1.nnl[all_1.iv - 1] * 5 - 6] += 7;
  1010. #line 226 "pmtexb2.f"
  1011.         }
  1012. #line 227 "pmtexb2.f"
  1013.         *char_ = ' ';
  1014. #line 228 "pmtexb2.f"
  1015.     }
  1016. #line 229 "pmtexb2.f"
  1017.     if (*char_ == ' ') {
  1018. #line 230 "pmtexb2.f"
  1019.         all_1.nodur[all_1.iv + all_1.nnl[all_1.iv - 1] * 5 - 6] = 
  1020. #line 230 "pmtexb2.f"
  1021.             all_1.nodur[all_1.iv + (all_1.nnl[all_1.iv - 1] - 1) * 5 
  1022. #line 230 "pmtexb2.f"
  1023.             - 6];
  1024. #line 231 "pmtexb2.f"
  1025.         goto L4;
  1026. #line 232 "pmtexb2.f"
  1027.     }
  1028. #line 233 "pmtexb2.f"
  1029.     s_rsfi(&io___50);
  1030. #line 233 "pmtexb2.f"
  1031.     do_fio(&c__1, (char *)&inodur, (ftnlen)sizeof(integer));
  1032. #line 233 "pmtexb2.f"
  1033.     e_rsfi();
  1034. #line 234 "pmtexb2.f"
  1035. L2:
  1036. #line 234 "pmtexb2.f"
  1037.     getchar_(line, &all_1.iccount, char_, 80L, 1L);
  1038. #line 235 "pmtexb2.f"
  1039.     if (comget_1.lastchar) {
  1040. #line 235 "pmtexb2.f"
  1041.         return 0;
  1042. #line 235 "pmtexb2.f"
  1043.     }
  1044. #line 236 "pmtexb2.f"
  1045.     if (*char_ != ' ') {
  1046. #line 237 "pmtexb2.f"
  1047.         if (*char_ == 'd') {
  1048. #line 238 "pmtexb2.f"
  1049.         *dot = *char_;
  1050. #line 239 "pmtexb2.f"
  1051.         } else if (*char_ == '/') {
  1052. #line 241 "pmtexb2.f"
  1053.         } else {
  1054.  
  1055. /*  Only other possibility is an accidental */
  1056.  
  1057. #line 245 "pmtexb2.f"
  1058.         all_1.acc[all_1.iv + all_1.nnl[all_1.iv - 1] * 5 - 6] = *
  1059. #line 245 "pmtexb2.f"
  1060.             char_;
  1061. #line 246 "pmtexb2.f"
  1062.         }
  1063. #line 247 "pmtexb2.f"
  1064.         if (*char_ != '/') {
  1065. #line 247 "pmtexb2.f"
  1066.         goto L2;
  1067. #line 247 "pmtexb2.f"
  1068.         }
  1069. #line 248 "pmtexb2.f"
  1070.     }
  1071. #line 249 "pmtexb2.f"
  1072.     all_1.nodur[all_1.iv + all_1.nnl[all_1.iv - 1] * 5 - 6] = ifnodur_(&
  1073. #line 249 "pmtexb2.f"
  1074.         inodur, dot, 1L);
  1075. #line 250 "pmtexb2.f"
  1076. L4:
  1077. #line 250 "pmtexb2.f"
  1078.     all_1.itsofar[all_1.iv - 1] += all_1.nodur[all_1.iv + all_1.nnl[
  1079. #line 250 "pmtexb2.f"
  1080.         all_1.iv - 1] * 5 - 6];
  1081. #line 251 "pmtexb2.f"
  1082.     if (all_1.itsofar[all_1.iv - 1] % all_1.lenbar == 0) {
  1083. #line 252 "pmtexb2.f"
  1084.         ++all_1.nbars;
  1085. #line 253 "pmtexb2.f"
  1086.         all_1.nib[all_1.iv + all_1.nbars * 5 - 6] = all_1.nnl[all_1.iv - 
  1087. #line 253 "pmtexb2.f"
  1088.             1];
  1089. #line 254 "pmtexb2.f"
  1090.         if (all_1.lenbar != all_1.lenbar1) {
  1091.  
  1092. /* ###  Just finished the pickup bar for this voice. */
  1093.  
  1094. #line 258 "pmtexb2.f"
  1095.         all_1.lenbar = all_1.lenbar1;
  1096. #line 259 "pmtexb2.f"
  1097.         all_1.itsofar[all_1.iv - 1] = 0;
  1098. #line 260 "pmtexb2.f"
  1099.         }
  1100. #line 261 "pmtexb2.f"
  1101.     }
  1102. #line 262 "pmtexb2.f"
  1103.     } else if (*char_ == 'o') {
  1104. /* ###             "o" symbol must come AFTER the affected note */
  1105. #line 264 "pmtexb2.f"
  1106.     getchar_(line, &all_1.iccount, all_1.orn + (all_1.iv + all_1.nnl[
  1107. #line 264 "pmtexb2.f"
  1108.         all_1.iv - 1] * 5 - 6), 80L, 1L);
  1109. #line 265 "pmtexb2.f"
  1110.     if (comget_1.lastchar) {
  1111. #line 265 "pmtexb2.f"
  1112.         return 0;
  1113. #line 265 "pmtexb2.f"
  1114.     }
  1115. #line 266 "pmtexb2.f"
  1116.     } else if (*char_ >= 49 && *char_ <= 57 || *char_ == '#' || *char_ == '-' 
  1117. #line 266 "pmtexb2.f"
  1118.         || *char_ == 'n' || *char_ == '_') {
  1119. /*###            We have a figure.  Must come AFTER the note it goes u
  1120. nder*/
  1121. #line 270 "pmtexb2.f"
  1122.     lfig = 1;
  1123. #line 271 "pmtexb2.f"
  1124.     s_copy(all_1.fig + (all_1.nnl[all_1.iv - 1] - 1) * 6, char_, 6L, 1L);
  1125. #line 272 "pmtexb2.f"
  1126. L5:
  1127. #line 272 "pmtexb2.f"
  1128.     getchar_(line, &all_1.iccount, char_, 80L, 1L);
  1129. #line 273 "pmtexb2.f"
  1130.     if (comget_1.lastchar) {
  1131. #line 273 "pmtexb2.f"
  1132.         return 0;
  1133. #line 273 "pmtexb2.f"
  1134.     }
  1135. #line 274 "pmtexb2.f"
  1136.     if (*char_ != ' ') {
  1137. /* Writing concatenation */
  1138. #line 275 "pmtexb2.f"
  1139.         i__1[0] = lfig, a__1[0] = all_1.fig + (all_1.nnl[all_1.iv - 1] - 
  1140. #line 275 "pmtexb2.f"
  1141.             1) * 6;
  1142. #line 275 "pmtexb2.f"
  1143.         i__1[1] = 1, a__1[1] = char_;
  1144. #line 275 "pmtexb2.f"
  1145.         s_cat(all_1.fig + (all_1.nnl[all_1.iv - 1] - 1) * 6, a__1, i__1, &
  1146. #line 275 "pmtexb2.f"
  1147.             c__2, 6L);
  1148. #line 276 "pmtexb2.f"
  1149.         ++lfig;
  1150. #line 277 "pmtexb2.f"
  1151.         goto L5;
  1152. #line 278 "pmtexb2.f"
  1153.     }
  1154. #line 279 "pmtexb2.f"
  1155.     } else if (*char_ == 'r') {
  1156.  
  1157. /*  We have a rest, so get inodur and dot */
  1158.  
  1159. #line 283 "pmtexb2.f"
  1160.     ++all_1.nnl[all_1.iv - 1];
  1161. #line 284 "pmtexb2.f"
  1162.     all_1.rest[all_1.iv + all_1.nnl[all_1.iv - 1] * 5 - 6] = TRUE_;
  1163. #line 285 "pmtexb2.f"
  1164.     getchar_(line, &all_1.iccount, char_, 80L, 1L);
  1165. #line 286 "pmtexb2.f"
  1166.     if (comget_1.lastchar) {
  1167. #line 286 "pmtexb2.f"
  1168.         return 0;
  1169. #line 286 "pmtexb2.f"
  1170.     }
  1171. #line 287 "pmtexb2.f"
  1172.     s_rsfi(&io___53);
  1173. #line 287 "pmtexb2.f"
  1174.     do_fio(&c__1, (char *)&inodur, (ftnlen)sizeof(integer));
  1175. #line 287 "pmtexb2.f"
  1176.     e_rsfi();
  1177. #line 288 "pmtexb2.f"
  1178.     *dot = 'x';
  1179. #line 289 "pmtexb2.f"
  1180.     getchar_(line, &all_1.iccount, char_, 80L, 1L);
  1181. #line 290 "pmtexb2.f"
  1182.     if (comget_1.lastchar) {
  1183. #line 290 "pmtexb2.f"
  1184.         return 0;
  1185. #line 290 "pmtexb2.f"
  1186.     }
  1187. #line 291 "pmtexb2.f"
  1188.     if (*char_ == 'd') {
  1189. #line 292 "pmtexb2.f"
  1190.         *dot = *char_;
  1191. #line 293 "pmtexb2.f"
  1192.     }
  1193. #line 294 "pmtexb2.f"
  1194.     all_1.nodur[all_1.iv + all_1.nnl[all_1.iv - 1] * 5 - 6] = ifnodur_(&
  1195. #line 294 "pmtexb2.f"
  1196.         inodur, dot, 1L);
  1197. #line 295 "pmtexb2.f"
  1198.     all_1.itsofar[all_1.iv - 1] += all_1.nodur[all_1.iv + all_1.nnl[
  1199. #line 295 "pmtexb2.f"
  1200.         all_1.iv - 1] * 5 - 6];
  1201. #line 296 "pmtexb2.f"
  1202.     if (all_1.itsofar[all_1.iv - 1] % all_1.lenbar == 0) {
  1203. #line 297 "pmtexb2.f"
  1204.         ++all_1.nbars;
  1205. #line 298 "pmtexb2.f"
  1206.         all_1.nib[all_1.iv + all_1.nbars * 5 - 6] = all_1.nnl[all_1.iv - 
  1207. #line 298 "pmtexb2.f"
  1208.             1];
  1209. #line 299 "pmtexb2.f"
  1210.         if (all_1.lenbar != all_1.lenbar1) {
  1211.  
  1212. /* ###  Just finished the pickup bar for this voice. */
  1213.  
  1214. #line 303 "pmtexb2.f"
  1215.         all_1.lenbar = all_1.lenbar1;
  1216. #line 304 "pmtexb2.f"
  1217.         all_1.itsofar[all_1.iv - 1] = 0;
  1218. #line 305 "pmtexb2.f"
  1219.         }
  1220. #line 306 "pmtexb2.f"
  1221.     }
  1222. #line 307 "pmtexb2.f"
  1223.     }
  1224. #line 308 "pmtexb2.f"
  1225. /* L3: */
  1226. #line 308 "pmtexb2.f"
  1227.     if (*char_ == '/') {
  1228.  
  1229. /*  Start a new voice for this line */
  1230.  
  1231. #line 312 "pmtexb2.f"
  1232.     if (all_1.iv == all_1.nv) {
  1233. #line 313 "pmtexb2.f"
  1234.         *loop = FALSE_;
  1235. #line 314 "pmtexb2.f"
  1236.     } else {
  1237. #line 315 "pmtexb2.f"
  1238.         if (all_1.lenbar0 != 0 && all_1.firstline) {
  1239. #line 315 "pmtexb2.f"
  1240.         all_1.lenbar = all_1.lenbar0;
  1241. #line 315 "pmtexb2.f"
  1242.         }
  1243. #line 316 "pmtexb2.f"
  1244.         all_1.nbars = 0;
  1245. #line 317 "pmtexb2.f"
  1246.         ++all_1.iv;
  1247. #line 318 "pmtexb2.f"
  1248.     }
  1249. #line 319 "pmtexb2.f"
  1250.     }
  1251. #line 320 "pmtexb2.f"
  1252.     return 0;
  1253. } /* getnote_ */
  1254.  
  1255. /* Subroutine */ int getchar_(char *line, integer *iccount, char *mychar, 
  1256.     ftnlen line_len, ftnlen mychar_len)
  1257. {
  1258.     /* System generated locals */
  1259.     address a__1[4];
  1260.     integer i__1, i__2[4];
  1261.     char ch__1[15];
  1262.  
  1263.     /* Builtin functions */
  1264.     integer s_rsfe(cilist *), do_fio(integer *, char *, ftnlen), e_rsfe(void),
  1265.          s_wsfe(cilist *);
  1266.     /* Subroutine */ int s_cat(char *, char **, integer *, integer *, ftnlen);
  1267.     integer e_wsfe(void);
  1268.  
  1269.     /* Local variables */
  1270.     static char s[1];
  1271.  
  1272.     /* Fortran I/O blocks */
  1273.     static cilist io___55 = { 0, 10, 1, "(a80)", 0 };
  1274.     static cilist io___56 = { 0, 11, 0, "(a)", 0 };
  1275.  
  1276.  
  1277.  
  1278. /* Gets the next character out of line*80.  If pointer iccount=80 on entry
  1279. ,*/
  1280. /* then reads in a new line.  Resets iccount.  Ends program if no more inp
  1281. ut.*/
  1282.  
  1283. /*  Platform-independent backslash */
  1284. #line 332 "pmtexb2.f"
  1285.     *s = '\\';
  1286. #line 333 "pmtexb2.f"
  1287.     if (*iccount == 80) {
  1288. #line 334 "pmtexb2.f"
  1289.     i__1 = s_rsfe(&io___55);
  1290. #line 334 "pmtexb2.f"
  1291.     if (i__1 != 0) {
  1292. #line 334 "pmtexb2.f"
  1293.         goto L999;
  1294. #line 334 "pmtexb2.f"
  1295.     }
  1296. #line 334 "pmtexb2.f"
  1297.     i__1 = do_fio(&c__1, line, 80L);
  1298. #line 334 "pmtexb2.f"
  1299.     if (i__1 != 0) {
  1300. #line 334 "pmtexb2.f"
  1301.         goto L999;
  1302. #line 334 "pmtexb2.f"
  1303.     }
  1304. #line 334 "pmtexb2.f"
  1305.     i__1 = e_rsfe();
  1306. #line 334 "pmtexb2.f"
  1307.     if (i__1 != 0) {
  1308. #line 334 "pmtexb2.f"
  1309.         goto L999;
  1310. #line 334 "pmtexb2.f"
  1311.     }
  1312. #line 335 "pmtexb2.f"
  1313.     *iccount = 0;
  1314. #line 336 "pmtexb2.f"
  1315.     }
  1316. #line 337 "pmtexb2.f"
  1317.     ++(*iccount);
  1318. #line 338 "pmtexb2.f"
  1319.     *mychar = line[*iccount - 1];
  1320. #line 339 "pmtexb2.f"
  1321.     return 0;
  1322. #line 340 "pmtexb2.f"
  1323. L999:
  1324. #line 341 "pmtexb2.f"
  1325.     s_wsfe(&io___56);
  1326. /* Writing concatenation */
  1327. #line 341 "pmtexb2.f"
  1328.     i__2[0] = 1, a__1[0] = s;
  1329. #line 341 "pmtexb2.f"
  1330.     i__2[1] = 10, a__1[1] = "finmorceau";
  1331. #line 341 "pmtexb2.f"
  1332.     i__2[2] = 1, a__1[2] = s;
  1333. #line 341 "pmtexb2.f"
  1334.     i__2[3] = 3, a__1[3] = "bye";
  1335. #line 341 "pmtexb2.f"
  1336.     s_cat(ch__1, a__1, i__2, &c__4, 15L);
  1337. #line 341 "pmtexb2.f"
  1338.     do_fio(&c__1, ch__1, 15L);
  1339. #line 341 "pmtexb2.f"
  1340.     e_wsfe();
  1341. #line 342 "pmtexb2.f"
  1342.     comget_1.lastchar = TRUE_;
  1343. #line 343 "pmtexb2.f"
  1344.     return 0;
  1345. } /* getchar_ */
  1346.  
  1347. integer log2_(integer *n)
  1348. {
  1349.     /* System generated locals */
  1350.     integer ret_val;
  1351.  
  1352.     /* Builtin functions */
  1353.     double log(doublereal);
  1354.  
  1355. #line 346 "pmtexb2.f"
  1356.     ret_val = log(*n * 1.f) / .69315f + .01f;
  1357. #line 347 "pmtexb2.f"
  1358.     return ret_val;
  1359. } /* log2_ */
  1360.  
  1361. integer ifnolev_(char *no, integer *oct, ftnlen no_len)
  1362. {
  1363.     /* System generated locals */
  1364.     integer ret_val;
  1365.  
  1366. #line 352 "pmtexb2.f"
  1367.     ret_val = *oct * 7 + (*no - 92) % 7 + 1;
  1368. #line 353 "pmtexb2.f"
  1369.     return ret_val;
  1370. } /* ifnolev_ */
  1371.  
  1372. integer ifnodur_(integer *idur, char *dot, ftnlen dot_len)
  1373. {
  1374.     /* System generated locals */
  1375.     integer ret_val;
  1376.  
  1377.     /* Builtin functions */
  1378.     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
  1379.         e_wsle(void);
  1380.     /* Subroutine */ int s_stop(char *, ftnlen);
  1381.  
  1382.     /* Fortran I/O blocks */
  1383.     static cilist io___57 = { 0, 6, 0, 0, 0 };
  1384.  
  1385.  
  1386. #line 357 "pmtexb2.f"
  1387.     if (*idur == 3) {
  1388. #line 358 "pmtexb2.f"
  1389.     ret_val = 3;
  1390. #line 359 "pmtexb2.f"
  1391.     } else if (*idur == 1) {
  1392. #line 360 "pmtexb2.f"
  1393.     ret_val = 6;
  1394. #line 361 "pmtexb2.f"
  1395.     } else if (*idur == 8) {
  1396. #line 362 "pmtexb2.f"
  1397.     ret_val = 12;
  1398. #line 363 "pmtexb2.f"
  1399.     } else if (*idur == 4) {
  1400. #line 364 "pmtexb2.f"
  1401.     ret_val = 24;
  1402. #line 365 "pmtexb2.f"
  1403.     } else if (*idur == 2) {
  1404. #line 366 "pmtexb2.f"
  1405.     ret_val = 48;
  1406. #line 367 "pmtexb2.f"
  1407.     } else if (*idur == 0) {
  1408. #line 368 "pmtexb2.f"
  1409.     ret_val = 96;
  1410. #line 369 "pmtexb2.f"
  1411.     } else {
  1412. #line 370 "pmtexb2.f"
  1413.     s_wsle(&io___57);
  1414. #line 370 "pmtexb2.f"
  1415.     do_lio(&c__9, &c__1, "You entered an invalid note value", 33L);
  1416. #line 370 "pmtexb2.f"
  1417.     e_wsle();
  1418. #line 371 "pmtexb2.f"
  1419.     s_stop("", 0L);
  1420. #line 372 "pmtexb2.f"
  1421.     }
  1422. #line 373 "pmtexb2.f"
  1423.     if (*dot == 'd') {
  1424. #line 373 "pmtexb2.f"
  1425.     ret_val = ret_val * 1.5f + .5f;
  1426. #line 373 "pmtexb2.f"
  1427.     }
  1428. #line 374 "pmtexb2.f"
  1429.     return ret_val;
  1430. } /* ifnodur_ */
  1431.  
  1432. integer ncmidf_(char *clef, ftnlen clef_len)
  1433. {
  1434.     /* System generated locals */
  1435.     integer ret_val;
  1436.  
  1437. #line 378 "pmtexb2.f"
  1438.     if (*clef == 't') {
  1439. #line 379 "pmtexb2.f"
  1440.     ret_val = 35;
  1441. #line 380 "pmtexb2.f"
  1442.     } else if (*clef == 'b') {
  1443. #line 381 "pmtexb2.f"
  1444.     ret_val = 23;
  1445. #line 382 "pmtexb2.f"
  1446.     } else if (*clef == 'a') {
  1447. #line 383 "pmtexb2.f"
  1448.     ret_val = 29;
  1449. #line 384 "pmtexb2.f"
  1450.     }
  1451. #line 385 "pmtexb2.f"
  1452.     return ret_val;
  1453. } /* ncmidf_ */
  1454.  
  1455. /* Subroutine */ int beamend_(char *notex, integer *lnote, ftnlen notex_len)
  1456. {
  1457.     /* System generated locals */
  1458.     address a__1[2], a__2[3], a__3[4];
  1459.     integer i__1[2], i__2, i__3[3], i__4[4];
  1460.     char ch__1[1];
  1461.     icilist ici__1;
  1462.  
  1463.     /* Builtin functions */
  1464.     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen), s_cat(char *,
  1465.          char **, integer *, integer *, ftnlen);
  1466.     integer s_wsfi(icilist *), do_fio(integer *, char *, ftnlen), e_wsfi(void)
  1467.         ;
  1468.  
  1469.     /* Local variables */
  1470.     extern /* Character */ VOID notef_(char *, ftnlen, integer *);
  1471.     static integer im, ip, mp;
  1472.  
  1473. /* ccccccccccc */
  1474. /* c */
  1475. /* c  pmtex.inc */
  1476. /* c */
  1477. /* ccccccccccc */
  1478. #line 391 "pmtexb2.f"
  1479.     ip = all_1.list[(all_1.jn << 2) - 3];
  1480. #line 392 "pmtexb2.f"
  1481.     s_copy(notex, all_1.s, 25L, 1L);
  1482. #line 393 "pmtexb2.f"
  1483.     *lnote = 1;
  1484.  
  1485. /* First check if multiplicity has increased */
  1486.  
  1487. #line 397 "pmtexb2.f"
  1488.     if (all_1.acc[all_1.iv + (ip - 1) * 5 - 6] != 'a') {
  1489. #line 398 "pmtexb2.f"
  1490.     mp = all_1.mult[all_1.iv + (ip - 1) * 5 - 6];
  1491. #line 399 "pmtexb2.f"
  1492.     } else {
  1493. #line 400 "pmtexb2.f"
  1494.     mp = all_1.mult[all_1.iv + (ip - 2) * 5 - 6];
  1495. #line 401 "pmtexb2.f"
  1496.     }
  1497. #line 402 "pmtexb2.f"
  1498.     if (all_1.mult[all_1.iv + ip * 5 - 6] > mp) {
  1499. /* Writing concatenation */
  1500. #line 403 "pmtexb2.f"
  1501.     i__1[0] = 1, a__1[0] = notex;
  1502. #line 403 "pmtexb2.f"
  1503.     i__1[1] = 1, a__1[1] = "t";
  1504. #line 403 "pmtexb2.f"
  1505.     s_cat(notex, a__1, i__1, &c__2, 25L);
  1506. #line 404 "pmtexb2.f"
  1507.     ++(*lnote);
  1508. #line 405 "pmtexb2.f"
  1509.     i__2 = all_1.mult[all_1.iv + ip * 5 - 6];
  1510. #line 405 "pmtexb2.f"
  1511.     for (im = 1; im <= i__2; ++im) {
  1512. /* Writing concatenation */
  1513. #line 406 "pmtexb2.f"
  1514.         i__1[0] = *lnote, a__1[0] = notex;
  1515. #line 406 "pmtexb2.f"
  1516.         i__1[1] = 1, a__1[1] = "b";
  1517. #line 406 "pmtexb2.f"
  1518.         s_cat(notex, a__1, i__1, &c__2, 25L);
  1519. #line 407 "pmtexb2.f"
  1520.         ++(*lnote);
  1521. #line 408 "pmtexb2.f"
  1522. /* L1: */
  1523. #line 408 "pmtexb2.f"
  1524.     }
  1525. /* Writing concatenation */
  1526. #line 409 "pmtexb2.f"
  1527.     i__1[0] = *lnote, a__1[0] = notex;
  1528. #line 409 "pmtexb2.f"
  1529.     i__1[1] = 1, a__1[1] = all_1.ul + (all_1.iv + all_1.ibmcnt[all_1.iv - 
  1530. #line 409 "pmtexb2.f"
  1531.         1] * 5 - 6);
  1532. #line 409 "pmtexb2.f"
  1533.     s_cat(notex, a__1, i__1, &c__2, 25L);
  1534. #line 410 "pmtexb2.f"
  1535.     *lnote += 2;
  1536. #line 411 "pmtexb2.f"
  1537.     ici__1.icierr = 0;
  1538. #line 411 "pmtexb2.f"
  1539.     ici__1.icirnum = 1;
  1540. #line 411 "pmtexb2.f"
  1541.     ici__1.icirlen = 1;
  1542. #line 411 "pmtexb2.f"
  1543.     ici__1.iciunit = notex + (*lnote - 1);
  1544. #line 411 "pmtexb2.f"
  1545.     ici__1.icifmt = "(i1)";
  1546. #line 411 "pmtexb2.f"
  1547.     s_wsfi(&ici__1);
  1548. #line 411 "pmtexb2.f"
  1549.     do_fio(&c__1, (char *)&all_1.iv, (ftnlen)sizeof(integer));
  1550. #line 411 "pmtexb2.f"
  1551.     e_wsfi();
  1552. /* Writing concatenation */
  1553. #line 412 "pmtexb2.f"
  1554.     i__1[0] = *lnote, a__1[0] = notex;
  1555. #line 412 "pmtexb2.f"
  1556.     i__1[1] = 1, a__1[1] = all_1.s;
  1557. #line 412 "pmtexb2.f"
  1558.     s_cat(notex, a__1, i__1, &c__2, 25L);
  1559. #line 413 "pmtexb2.f"
  1560.     ++(*lnote);
  1561. #line 414 "pmtexb2.f"
  1562.     }
  1563.  
  1564. /* Now the normal beam termination */
  1565.  
  1566. /* Writing concatenation */
  1567. #line 418 "pmtexb2.f"
  1568.     i__3[0] = *lnote, a__2[0] = notex;
  1569. #line 418 "pmtexb2.f"
  1570.     i__3[1] = 2, a__2[1] = "tb";
  1571. #line 418 "pmtexb2.f"
  1572.     i__3[2] = 1, a__2[2] = all_1.ul + (all_1.iv + all_1.ibmcnt[all_1.iv - 1] *
  1573. #line 418 "pmtexb2.f"
  1574.          5 - 6);
  1575. #line 418 "pmtexb2.f"
  1576.     s_cat(notex, a__2, i__3, &c__3, 25L);
  1577. #line 419 "pmtexb2.f"
  1578.     *lnote += 4;
  1579. #line 420 "pmtexb2.f"
  1580.     ici__1.icierr = 0;
  1581. #line 420 "pmtexb2.f"
  1582.     ici__1.icirnum = 1;
  1583. #line 420 "pmtexb2.f"
  1584.     ici__1.icirlen = 1;
  1585. #line 420 "pmtexb2.f"
  1586.     ici__1.iciunit = notex + (*lnote - 1);
  1587. #line 420 "pmtexb2.f"
  1588.     ici__1.icifmt = "(i1)";
  1589. #line 420 "pmtexb2.f"
  1590.     s_wsfi(&ici__1);
  1591. #line 420 "pmtexb2.f"
  1592.     do_fio(&c__1, (char *)&all_1.iv, (ftnlen)sizeof(integer));
  1593. #line 420 "pmtexb2.f"
  1594.     e_wsfi();
  1595.  
  1596. /*  And now the note */
  1597.  
  1598. /* Writing concatenation */
  1599. #line 424 "pmtexb2.f"
  1600.     i__4[0] = *lnote, a__3[0] = notex;
  1601. #line 424 "pmtexb2.f"
  1602.     i__4[1] = 1, a__3[1] = all_1.s;
  1603. #line 424 "pmtexb2.f"
  1604.     i__4[2] = 1, a__3[2] = "q";
  1605. #line 424 "pmtexb2.f"
  1606.     i__4[3] = 1, a__3[3] = all_1.hb + (all_1.iv + all_1.ibmcnt[all_1.iv - 1] *
  1607. #line 424 "pmtexb2.f"
  1608.          5 - 6);
  1609. #line 424 "pmtexb2.f"
  1610.     s_cat(notex, a__3, i__4, &c__4, 25L);
  1611. #line 425 "pmtexb2.f"
  1612.     *lnote += 4;
  1613. #line 426 "pmtexb2.f"
  1614.     ici__1.icierr = 0;
  1615. #line 426 "pmtexb2.f"
  1616.     ici__1.icirnum = 1;
  1617. #line 426 "pmtexb2.f"
  1618.     ici__1.icirlen = 1;
  1619. #line 426 "pmtexb2.f"
  1620.     ici__1.iciunit = notex + (*lnote - 1);
  1621. #line 426 "pmtexb2.f"
  1622.     ici__1.icifmt = "(i1)";
  1623. #line 426 "pmtexb2.f"
  1624.     s_wsfi(&ici__1);
  1625. #line 426 "pmtexb2.f"
  1626.     do_fio(&c__1, (char *)&all_1.iv, (ftnlen)sizeof(integer));
  1627. #line 426 "pmtexb2.f"
  1628.     e_wsfi();
  1629. /* Writing concatenation */
  1630. #line 427 "pmtexb2.f"
  1631.     i__1[0] = *lnote, a__1[0] = notex;
  1632. #line 427 "pmtexb2.f"
  1633.     notef_(ch__1, 1L, &all_1.nolev[all_1.iv + ip * 5 - 6]);
  1634. #line 427 "pmtexb2.f"
  1635.     i__1[1] = 1, a__1[1] = ch__1;
  1636. #line 427 "pmtexb2.f"
  1637.     s_cat(notex, a__1, i__1, &c__2, 25L);
  1638. #line 428 "pmtexb2.f"
  1639.     ++(*lnote);
  1640. #line 429 "pmtexb2.f"
  1641.     return 0;
  1642. } /* beamend_ */
  1643.  
  1644. /* Subroutine */ int beamid_(char *notex, integer *lnote, ftnlen notex_len)
  1645. {
  1646.     /* System generated locals */
  1647.     address a__1[2], a__2[3];
  1648.     integer i__1[2], i__2, i__3[3], i__4;
  1649.     char ch__1[1];
  1650.     icilist ici__1;
  1651.  
  1652.     /* Builtin functions */
  1653.     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen), s_cat(char *,
  1654.          char **, integer *, integer *, ftnlen);
  1655.     integer s_wsfi(icilist *), do_fio(integer *, char *, ftnlen), e_wsfi(void)
  1656.         , pow_ii(integer *, integer *);
  1657.  
  1658.     /* Local variables */
  1659.     extern /* Character */ VOID notef_(char *, ftnlen, integer *);
  1660.     static integer im, ip, mua, mub;
  1661.     extern integer log2_(integer *);
  1662.  
  1663. /* ccccccccccc */
  1664. /* c */
  1665. /* c  pmtex.inc */
  1666. /* c */
  1667. /* ccccccccccc */
  1668. #line 435 "pmtexb2.f"
  1669.     *lnote = 1;
  1670. #line 436 "pmtexb2.f"
  1671.     s_copy(notex, all_1.s, 25L, 1L);
  1672. #line 437 "pmtexb2.f"
  1673.     ip = all_1.list[(all_1.jn << 2) - 3];
  1674.  
  1675. /* Check if multiplicity changes in a way requiring action */
  1676.  
  1677. #line 441 "pmtexb2.f"
  1678.     mub = all_1.mult[all_1.iv + ip * 5 - 6] - all_1.mult[all_1.iv + (ip - 1) *
  1679. #line 441 "pmtexb2.f"
  1680.          5 - 6];
  1681. #line 442 "pmtexb2.f"
  1682.     if (all_1.acc[all_1.iv + (ip - 1) * 5 - 6] == 'a') {
  1683. #line 442 "pmtexb2.f"
  1684.     mub = all_1.mult[all_1.iv + ip * 5 - 6] - all_1.mult[all_1.iv + (ip - 
  1685. #line 442 "pmtexb2.f"
  1686.         2) * 5 - 6];
  1687. #line 442 "pmtexb2.f"
  1688.     }
  1689. #line 443 "pmtexb2.f"
  1690.     mua = all_1.mult[all_1.iv + (ip + 1) * 5 - 6] - all_1.mult[all_1.iv + ip *
  1691. #line 443 "pmtexb2.f"
  1692.          5 - 6];
  1693. #line 444 "pmtexb2.f"
  1694.     if (all_1.acc[all_1.iv + (ip + 1) * 5 - 6] == 'a') {
  1695. #line 444 "pmtexb2.f"
  1696.     mua = all_1.mult[all_1.iv + (ip + 2) * 5 - 6] - all_1.mult[all_1.iv + 
  1697. #line 444 "pmtexb2.f"
  1698.         ip * 5 - 6];
  1699. #line 444 "pmtexb2.f"
  1700.     }
  1701. #line 445 "pmtexb2.f"
  1702.     if (mub > 0 || mua < 0) {
  1703.  
  1704. /*  Multiplicity has changed. */
  1705.  
  1706. #line 449 "pmtexb2.f"
  1707.     *lnote = 2;
  1708. #line 450 "pmtexb2.f"
  1709.     if (mua >= 0) {
  1710. /* Writing concatenation */
  1711. #line 451 "pmtexb2.f"
  1712.         i__1[0] = 1, a__1[0] = all_1.s;
  1713. #line 451 "pmtexb2.f"
  1714.         i__1[1] = 1, a__1[1] = "n";
  1715. #line 451 "pmtexb2.f"
  1716.         s_cat(notex, a__1, i__1, &c__2, 25L);
  1717. #line 452 "pmtexb2.f"
  1718.     } else {
  1719. /* Writing concatenation */
  1720. #line 453 "pmtexb2.f"
  1721.         i__1[0] = 1, a__1[0] = all_1.s;
  1722. #line 453 "pmtexb2.f"
  1723.         i__1[1] = 1, a__1[1] = "t";
  1724. #line 453 "pmtexb2.f"
  1725.         s_cat(notex, a__1, i__1, &c__2, 25L);
  1726. #line 454 "pmtexb2.f"
  1727.     }
  1728. #line 455 "pmtexb2.f"
  1729.     i__2 = all_1.mult[all_1.iv + ip * 5 - 6];
  1730. #line 455 "pmtexb2.f"
  1731.     for (im = 1; im <= i__2; ++im) {
  1732. /* Writing concatenation */
  1733. #line 456 "pmtexb2.f"
  1734.         i__1[0] = *lnote, a__1[0] = notex;
  1735. #line 456 "pmtexb2.f"
  1736.         i__1[1] = 1, a__1[1] = "b";
  1737. #line 456 "pmtexb2.f"
  1738.         s_cat(notex, a__1, i__1, &c__2, 25L);
  1739. #line 457 "pmtexb2.f"
  1740.         ++(*lnote);
  1741. #line 458 "pmtexb2.f"
  1742. /* L1: */
  1743. #line 458 "pmtexb2.f"
  1744.     }
  1745. /* Writing concatenation */
  1746. #line 459 "pmtexb2.f"
  1747.     i__1[0] = *lnote, a__1[0] = notex;
  1748. #line 459 "pmtexb2.f"
  1749.     i__1[1] = 1, a__1[1] = all_1.ul + (all_1.iv + all_1.ibmcnt[all_1.iv - 
  1750. #line 459 "pmtexb2.f"
  1751.         1] * 5 - 6);
  1752. #line 459 "pmtexb2.f"
  1753.     s_cat(notex, a__1, i__1, &c__2, 25L);
  1754. #line 460 "pmtexb2.f"
  1755.     *lnote += 2;
  1756. #line 461 "pmtexb2.f"
  1757.     ici__1.icierr = 0;
  1758. #line 461 "pmtexb2.f"
  1759.     ici__1.icirnum = 1;
  1760. #line 461 "pmtexb2.f"
  1761.     ici__1.icirlen = 1;
  1762. #line 461 "pmtexb2.f"
  1763.     ici__1.iciunit = notex + (*lnote - 1);
  1764. #line 461 "pmtexb2.f"
  1765.     ici__1.icifmt = "(i1)";
  1766. #line 461 "pmtexb2.f"
  1767.     s_wsfi(&ici__1);
  1768. #line 461 "pmtexb2.f"
  1769.     do_fio(&c__1, (char *)&all_1.iv, (ftnlen)sizeof(integer));
  1770. #line 461 "pmtexb2.f"
  1771.     e_wsfi();
  1772. /* Writing concatenation */
  1773. #line 462 "pmtexb2.f"
  1774.     i__1[0] = *lnote, a__1[0] = notex;
  1775. #line 462 "pmtexb2.f"
  1776.     i__1[1] = 1, a__1[1] = all_1.s;
  1777. #line 462 "pmtexb2.f"
  1778.     s_cat(notex, a__1, i__1, &c__2, 25L);
  1779. #line 463 "pmtexb2.f"
  1780.     ++(*lnote);
  1781. #line 464 "pmtexb2.f"
  1782.     }
  1783.  
  1784. /* Now put in the note */
  1785.  
  1786. /* Writing concatenation */
  1787. #line 468 "pmtexb2.f"
  1788.     i__3[0] = *lnote, a__2[0] = notex;
  1789. #line 468 "pmtexb2.f"
  1790.     i__3[1] = 1, a__2[1] = "q";
  1791. #line 468 "pmtexb2.f"
  1792.     i__3[2] = 1, a__2[2] = all_1.hb + (all_1.iv + all_1.ibmcnt[all_1.iv - 1] *
  1793. #line 468 "pmtexb2.f"
  1794.          5 - 6);
  1795. #line 468 "pmtexb2.f"
  1796.     s_cat(notex, a__2, i__3, &c__3, 25L);
  1797. #line 469 "pmtexb2.f"
  1798.     *lnote += 2;
  1799. #line 470 "pmtexb2.f"
  1800.     i__4 = (integer) (all_1.nodur[all_1.iv + ip * 5 - 6] / 3.f + .1f);
  1801. #line 470 "pmtexb2.f"
  1802.     i__2 = log2_(&i__4);
  1803. #line 470 "pmtexb2.f"
  1804.     if (all_1.acc[all_1.iv + ip * 5 - 6] != 'a' && pow_ii(&c__2, &i__2) != (
  1805. #line 470 "pmtexb2.f"
  1806.         integer) (all_1.nodur[all_1.iv + ip * 5 - 6] / 3.f + .1f)) {
  1807. /* Writing concatenation */
  1808. #line 472 "pmtexb2.f"
  1809.     i__1[0] = *lnote, a__1[0] = notex;
  1810. #line 472 "pmtexb2.f"
  1811.     i__1[1] = 1, a__1[1] = "p";
  1812. #line 472 "pmtexb2.f"
  1813.     s_cat(notex, a__1, i__1, &c__2, 25L);
  1814. #line 473 "pmtexb2.f"
  1815.     ++(*lnote);
  1816. #line 474 "pmtexb2.f"
  1817.     }
  1818. #line 475 "pmtexb2.f"
  1819.     ++(*lnote);
  1820. #line 476 "pmtexb2.f"
  1821.     ici__1.icierr = 0;
  1822. #line 476 "pmtexb2.f"
  1823.     ici__1.icirnum = 1;
  1824. #line 476 "pmtexb2.f"
  1825.     ici__1.icirlen = 1;
  1826. #line 476 "pmtexb2.f"
  1827.     ici__1.iciunit = notex + (*lnote - 1);
  1828. #line 476 "pmtexb2.f"
  1829.     ici__1.icifmt = "(i1)";
  1830. #line 476 "pmtexb2.f"
  1831.     s_wsfi(&ici__1);
  1832. #line 476 "pmtexb2.f"
  1833.     do_fio(&c__1, (char *)&all_1.iv, (ftnlen)sizeof(integer));
  1834. #line 476 "pmtexb2.f"
  1835.     e_wsfi();
  1836. /* Writing concatenation */
  1837. #line 477 "pmtexb2.f"
  1838.     i__1[0] = *lnote, a__1[0] = notex;
  1839. #line 477 "pmtexb2.f"
  1840.     notef_(ch__1, 1L, &all_1.nolev[all_1.iv + ip * 5 - 6]);
  1841. #line 477 "pmtexb2.f"
  1842.     i__1[1] = 1, a__1[1] = ch__1;
  1843. #line 477 "pmtexb2.f"
  1844.     s_cat(notex, a__1, i__1, &c__2, 25L);
  1845. #line 478 "pmtexb2.f"
  1846.     ++(*lnote);
  1847. #line 479 "pmtexb2.f"
  1848.     return 0;
  1849. } /* beamid_ */
  1850.  
  1851. /* Subroutine */ int beamstrt_(char *notex, integer *lnote, integer *nornb, 
  1852.     integer *ihornb, ftnlen notex_len)
  1853. {
  1854.     /* System generated locals */
  1855.     address a__1[2], a__2[3];
  1856.     integer i__1[2], i__2, i__3[3], i__4;
  1857.     real r__1;
  1858.     char ch__1[1];
  1859.     icilist ici__1;
  1860.  
  1861.     /* Builtin functions */
  1862.     /* Subroutine */ int s_cat(char *, char **, integer *, integer *, ftnlen);
  1863.     integer s_wsfi(icilist *), do_fio(integer *, char *, ftnlen), e_wsfi(void)
  1864.         , s_cmp(char *, char *, ftnlen, ftnlen);
  1865.  
  1866.     /* Local variables */
  1867.     static integer iorn;
  1868.     static real ymin, ybot, sumx, sumy, ybeam;
  1869.     extern /* Character */ VOID notef_(char *, ftnlen, integer *);
  1870.     static integer multb;
  1871.     static real xelsk[16];
  1872.     static integer n1, n2;
  1873.     static real zmult;
  1874.     static integer nomornlev, nolev1, im;
  1875.     extern integer ni_(real *);
  1876.     static integer islope;
  1877.     extern /* Subroutine */ int setupb_(real *, integer *, real *, real *, 
  1878.         integer *, integer *, integer *, integer *);
  1879.     static integer ibc, inb, ipb[16], nnb, maxdrop;
  1880.  
  1881. /* ccccccccccc */
  1882. /* c */
  1883. /* c  pmtex.inc */
  1884. /* c */
  1885. /* ccccccccccc */
  1886. #line 489 "pmtexb2.f"
  1887.     /* Parameter adjustments */
  1888. #line 489 "pmtexb2.f"
  1889.     ihornb -= 6;
  1890. #line 489 "pmtexb2.f"
  1891.     --nornb;
  1892. #line 489 "pmtexb2.f"
  1893.  
  1894. #line 489 "pmtexb2.f"
  1895.     /* Function Body */
  1896. #line 489 "pmtexb2.f"
  1897.     ibc = all_1.ibmcnt[all_1.iv - 1];
  1898. #line 490 "pmtexb2.f"
  1899.     n1 = all_1.ipl[all_1.iv + all_1.ibm1[all_1.iv + ibc * 5 - 6] * 5 - 6];
  1900. #line 491 "pmtexb2.f"
  1901.     n2 = all_1.ipl[all_1.iv + all_1.ibm2[all_1.iv + ibc * 5 - 6] * 5 - 6];
  1902. /* Writing concatenation */
  1903. #line 492 "pmtexb2.f"
  1904.     i__1[0] = 1, a__1[0] = all_1.s;
  1905. #line 492 "pmtexb2.f"
  1906.     i__1[1] = 1, a__1[1] = "i";
  1907. #line 492 "pmtexb2.f"
  1908.     s_cat(notex, a__1, i__1, &c__2, 25L);
  1909. #line 493 "pmtexb2.f"
  1910.     *lnote = 2;
  1911. #line 494 "pmtexb2.f"
  1912.     multb = all_1.mult[all_1.iv + all_1.ibm1[all_1.iv + ibc * 5 - 6] * 5 - 6];
  1913. #line 495 "pmtexb2.f"
  1914.     i__2 = multb;
  1915. #line 495 "pmtexb2.f"
  1916.     for (im = 1; im <= i__2; ++im) {
  1917. /* Writing concatenation */
  1918. #line 496 "pmtexb2.f"
  1919.     i__1[0] = *lnote, a__1[0] = notex;
  1920. #line 496 "pmtexb2.f"
  1921.     i__1[1] = 1, a__1[1] = "b";
  1922. #line 496 "pmtexb2.f"
  1923.     s_cat(notex, a__1, i__1, &c__2, 25L);
  1924. #line 497 "pmtexb2.f"
  1925.     ++(*lnote);
  1926. #line 498 "pmtexb2.f"
  1927. /* L1: */
  1928. #line 498 "pmtexb2.f"
  1929.     }
  1930. /* Writing concatenation */
  1931. #line 499 "pmtexb2.f"
  1932.     i__1[0] = *lnote, a__1[0] = notex;
  1933. #line 499 "pmtexb2.f"
  1934.     i__1[1] = 1, a__1[1] = all_1.ul + (all_1.iv + ibc * 5 - 6);
  1935. #line 499 "pmtexb2.f"
  1936.     s_cat(notex, a__1, i__1, &c__2, 25L);
  1937. #line 500 "pmtexb2.f"
  1938.     *lnote += 2;
  1939.  
  1940. /*  Put in index for the beam */
  1941.  
  1942. #line 504 "pmtexb2.f"
  1943.     ici__1.icierr = 0;
  1944. #line 504 "pmtexb2.f"
  1945.     ici__1.icirnum = 1;
  1946. #line 504 "pmtexb2.f"
  1947.     ici__1.icirlen = 1;
  1948. #line 504 "pmtexb2.f"
  1949.     ici__1.iciunit = notex + (*lnote - 1);
  1950. #line 504 "pmtexb2.f"
  1951.     ici__1.icifmt = "(i1)";
  1952. #line 504 "pmtexb2.f"
  1953.     s_wsfi(&ici__1);
  1954. #line 504 "pmtexb2.f"
  1955.     do_fio(&c__1, (char *)&all_1.iv, (ftnlen)sizeof(integer));
  1956. #line 504 "pmtexb2.f"
  1957.     e_wsfi();
  1958. #line 505 "pmtexb2.f"
  1959.     setupb_(xelsk, &nnb, &sumx, &sumy, ipb, &islope, &nolev1, &nornb[1]);
  1960. /* #### Get 'floor' zmin for figures */
  1961. #line 507 "pmtexb2.f"
  1962.     if (comfig_1.figbass && all_1.iv == 1) {
  1963. #line 508 "pmtexb2.f"
  1964.     zmult = (multb - 1) * 1.2f;
  1965. #line 509 "pmtexb2.f"
  1966.     ymin = 100.f;
  1967. #line 510 "pmtexb2.f"
  1968.     i__2 = nnb;
  1969. #line 510 "pmtexb2.f"
  1970.     for (inb = 1; inb <= i__2; ++inb) {
  1971. #line 511 "pmtexb2.f"
  1972.         if (s_cmp(all_1.fig + (ipb[inb - 1] - 1) * 6, "x", 6L, 1L) != 0) {
  1973. #line 512 "pmtexb2.f"
  1974.         if (all_1.ul[ibc * 5 - 5] == 'u') {
  1975. #line 513 "pmtexb2.f"
  1976.             ybot = (real) all_1.nolev[ipb[inb - 1] * 5 - 5];
  1977. #line 514 "pmtexb2.f"
  1978.         } else {
  1979. #line 515 "pmtexb2.f"
  1980.             ybot = islope / all_1.slfac * xelsk[inb - 1] + nolev1 - 
  1981. #line 515 "pmtexb2.f"
  1982.                 all_1.stemlen - zmult;
  1983. #line 516 "pmtexb2.f"
  1984.         }
  1985. #line 517 "pmtexb2.f"
  1986.         ymin = dmin(ymin,ybot);
  1987. #line 518 "pmtexb2.f"
  1988.         }
  1989. #line 519 "pmtexb2.f"
  1990. /* L3: */
  1991. #line 519 "pmtexb2.f"
  1992.     }
  1993. #line 520 "pmtexb2.f"
  1994.     maxdrop = all_1.ncmid[0] - 4 - ymin + 5.01f;
  1995. /* Computing MAX */
  1996. #line 521 "pmtexb2.f"
  1997.     i__2 = comfig_1.ifigdrop[comfig_1.iline - 1];
  1998. #line 521 "pmtexb2.f"
  1999.     comfig_1.ifigdrop[comfig_1.iline - 1] = max(i__2,maxdrop);
  2000. #line 522 "pmtexb2.f"
  2001.     }
  2002. /* #### Slope & height analysis done.  Put in name start level and slope 
  2003. */
  2004. /* Writing concatenation */
  2005. #line 524 "pmtexb2.f"
  2006.     i__3[0] = *lnote, a__2[0] = notex;
  2007. #line 524 "pmtexb2.f"
  2008.     notef_(ch__1, 1L, &nolev1);
  2009. #line 524 "pmtexb2.f"
  2010.     i__3[1] = 1, a__2[1] = ch__1;
  2011. #line 524 "pmtexb2.f"
  2012.     i__3[2] = 1, a__2[2] = "{";
  2013. #line 524 "pmtexb2.f"
  2014.     s_cat(notex, a__2, i__3, &c__3, 25L);
  2015. #line 525 "pmtexb2.f"
  2016.     *lnote += 5;
  2017. #line 526 "pmtexb2.f"
  2018.     i__2 = *lnote - 3;
  2019. #line 526 "pmtexb2.f"
  2020.     ici__1.icierr = 0;
  2021. #line 526 "pmtexb2.f"
  2022.     ici__1.icirnum = 1;
  2023. #line 526 "pmtexb2.f"
  2024.     ici__1.icirlen = *lnote - i__2;
  2025. #line 526 "pmtexb2.f"
  2026.     ici__1.iciunit = notex + i__2;
  2027. #line 526 "pmtexb2.f"
  2028.     ici__1.icifmt = "(i2,a1)";
  2029. #line 526 "pmtexb2.f"
  2030.     s_wsfi(&ici__1);
  2031. #line 526 "pmtexb2.f"
  2032.     do_fio(&c__1, (char *)&islope, (ftnlen)sizeof(integer));
  2033. #line 526 "pmtexb2.f"
  2034.     do_fio(&c__1, "}", 1L);
  2035. #line 526 "pmtexb2.f"
  2036.     e_wsfi();
  2037. /* #### Compute ornament levels if needed */
  2038. #line 528 "pmtexb2.f"
  2039.     if (nornb[all_1.iv] > 0) {
  2040. #line 529 "pmtexb2.f"
  2041.     nomornlev = all_1.ncmid[all_1.iv - 1] + 5;
  2042. #line 530 "pmtexb2.f"
  2043.     iorn = 0;
  2044. #line 531 "pmtexb2.f"
  2045.     i__2 = nnb;
  2046. #line 531 "pmtexb2.f"
  2047.     for (inb = 1; inb <= i__2; ++inb) {
  2048. #line 532 "pmtexb2.f"
  2049.         if (all_1.orn[all_1.iv + ipb[inb - 1] * 5 - 6] != 'x') {
  2050. #line 533 "pmtexb2.f"
  2051.         ++iorn;
  2052. #line 534 "pmtexb2.f"
  2053.         if (all_1.ul[all_1.iv + ibc * 5 - 6] == 'l') {
  2054. /* Computing MAX */
  2055. #line 535 "pmtexb2.f"
  2056.             i__4 = all_1.nolev[all_1.iv + ipb[inb - 1] * 5 - 6] + 2;
  2057. #line 535 "pmtexb2.f"
  2058.             ihornb[all_1.iv + iorn * 5] = max(i__4,nomornlev);
  2059. #line 536 "pmtexb2.f"
  2060.         } else {
  2061. #line 537 "pmtexb2.f"
  2062.             ybeam = nolev1 + all_1.stemlen + islope * xelsk[inb - 1] /
  2063. #line 537 "pmtexb2.f"
  2064.                  all_1.slfac - 1 + (multb - 1) * 1.2f;
  2065. /* Computing MAX */
  2066. #line 539 "pmtexb2.f"
  2067.             r__1 = ybeam + 3.5f;
  2068. #line 539 "pmtexb2.f"
  2069.             i__4 = ni_(&r__1);
  2070. #line 539 "pmtexb2.f"
  2071.             ihornb[all_1.iv + iorn * 5] = max(i__4,nomornlev);
  2072. #line 540 "pmtexb2.f"
  2073.         }
  2074. #line 541 "pmtexb2.f"
  2075.         }
  2076. #line 542 "pmtexb2.f"
  2077. /* L8: */
  2078. #line 542 "pmtexb2.f"
  2079.     }
  2080. /*#### Henceforth norn(iv) will be a counter.  Be sure to zero it out 
  2081. when*/
  2082. /*     beam is finished */
  2083. #line 545 "pmtexb2.f"
  2084.     nornb[all_1.iv] = 1;
  2085. #line 546 "pmtexb2.f"
  2086.     }
  2087. #line 547 "pmtexb2.f"
  2088.     return 0;
  2089. } /* beamstrt_ */
  2090.  
  2091. /* Subroutine */ int beamn1_(char *notex, integer *lnote, ftnlen notex_len)
  2092. {
  2093.     /* System generated locals */
  2094.     address a__1[3], a__2[2];
  2095.     integer i__1[3], i__2, i__3, i__4[2];
  2096.     char ch__1[1];
  2097.     icilist ici__1;
  2098.  
  2099.     /* Builtin functions */
  2100.     /* Subroutine */ int s_cat(char *, char **, integer *, integer *, ftnlen);
  2101.     integer pow_ii(integer *, integer *), s_wsfi(icilist *), do_fio(integer *,
  2102.          char *, ftnlen), e_wsfi(void);
  2103.  
  2104.     /* Local variables */
  2105.     extern /* Character */ VOID notef_(char *, ftnlen, integer *);
  2106.     static integer n1, nd;
  2107.     extern integer log2_(integer *);
  2108.  
  2109. /* ccccccccccc */
  2110. /* c */
  2111. /* c  pmtex.inc */
  2112. /* c */
  2113. /* ccccccccccc */
  2114. /*     real*4 xelsk(16) */
  2115. /*     integer ipb(16) */
  2116. #line 555 "pmtexb2.f"
  2117.     *lnote = 3;
  2118. /* Writing concatenation */
  2119. #line 556 "pmtexb2.f"
  2120.     i__1[0] = 1, a__1[0] = all_1.s;
  2121. #line 556 "pmtexb2.f"
  2122.     i__1[1] = 1, a__1[1] = "q";
  2123. #line 556 "pmtexb2.f"
  2124.     i__1[2] = 1, a__1[2] = all_1.hb + (all_1.iv + all_1.ibmcnt[all_1.iv - 1] *
  2125. #line 556 "pmtexb2.f"
  2126.          5 - 6);
  2127. #line 556 "pmtexb2.f"
  2128.     s_cat(notex, a__1, i__1, &c__3, 25L);
  2129.  
  2130. /*  Check for dot */
  2131.  
  2132. #line 560 "pmtexb2.f"
  2133.     n1 = all_1.ipl[all_1.iv + all_1.ibm1[all_1.iv + all_1.ibmcnt[all_1.iv - 1]
  2134. #line 560 "pmtexb2.f"
  2135.          * 5 - 6] * 5 - 6];
  2136. #line 561 "pmtexb2.f"
  2137.     nd = all_1.nodur[all_1.iv + all_1.list[(n1 << 2) - 3] * 5 - 6];
  2138. #line 562 "pmtexb2.f"
  2139.     i__3 = (integer) (nd / 3.f + .1f);
  2140. #line 562 "pmtexb2.f"
  2141.     i__2 = log2_(&i__3);
  2142. #line 562 "pmtexb2.f"
  2143.     if (nd != 0 && pow_ii(&c__2, &i__2) != (integer) (nd / 3.f + .1f)) {
  2144. /* Writing concatenation */
  2145. #line 563 "pmtexb2.f"
  2146.     i__4[0] = *lnote, a__2[0] = notex;
  2147. #line 563 "pmtexb2.f"
  2148.     i__4[1] = 1, a__2[1] = "p";
  2149. #line 563 "pmtexb2.f"
  2150.     s_cat(notex, a__2, i__4, &c__2, 25L);
  2151. #line 564 "pmtexb2.f"
  2152.     ++(*lnote);
  2153. #line 565 "pmtexb2.f"
  2154.     }
  2155. #line 566 "pmtexb2.f"
  2156.     ++(*lnote);
  2157. #line 567 "pmtexb2.f"
  2158.     ici__1.icierr = 0;
  2159. #line 567 "pmtexb2.f"
  2160.     ici__1.icirnum = 1;
  2161. #line 567 "pmtexb2.f"
  2162.     ici__1.icirlen = 1;
  2163. #line 567 "pmtexb2.f"
  2164.     ici__1.iciunit = notex + (*lnote - 1);
  2165. #line 567 "pmtexb2.f"
  2166.     ici__1.icifmt = "(i1)";
  2167. #line 567 "pmtexb2.f"
  2168.     s_wsfi(&ici__1);
  2169. #line 567 "pmtexb2.f"
  2170.     do_fio(&c__1, (char *)&all_1.iv, (ftnlen)sizeof(integer));
  2171. #line 567 "pmtexb2.f"
  2172.     e_wsfi();
  2173. /* Writing concatenation */
  2174. #line 568 "pmtexb2.f"
  2175.     i__4[0] = *lnote, a__2[0] = notex;
  2176. #line 568 "pmtexb2.f"
  2177.     notef_(ch__1, 1L, &all_1.nolev[all_1.iv + all_1.list[(n1 << 2) - 3] * 5 - 
  2178. #line 568 "pmtexb2.f"
  2179.         6]);
  2180. #line 568 "pmtexb2.f"
  2181.     i__4[1] = 1, a__2[1] = ch__1;
  2182. #line 568 "pmtexb2.f"
  2183.     s_cat(notex, a__2, i__4, &c__2, 25L);
  2184. #line 569 "pmtexb2.f"
  2185.     ++(*lnote);
  2186. #line 570 "pmtexb2.f"
  2187.     return 0;
  2188. } /* beamn1_ */
  2189.  
  2190. /* Subroutine */ int addstr_(char *notex, integer *lnote, char *sout, integer 
  2191.     *lsout, ftnlen notex_len, ftnlen sout_len)
  2192. {
  2193.     /* System generated locals */
  2194.     address a__1[2];
  2195.     integer i__1[2];
  2196.     char ch__1[81];
  2197.  
  2198.     /* Builtin functions */
  2199.     integer s_wsfe(cilist *);
  2200.     /* Subroutine */ int s_cat(char *, char **, integer *, integer *, ftnlen);
  2201.     integer do_fio(integer *, char *, ftnlen), e_wsfe(void);
  2202.     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
  2203.  
  2204.     /* Fortran I/O blocks */
  2205.     static cilist io___87 = { 0, 11, 0, "(a)", 0 };
  2206.  
  2207.  
  2208. #line 575 "pmtexb2.f"
  2209.     if (*lsout + *lnote > 72) {
  2210. #line 576 "pmtexb2.f"
  2211.     s_wsfe(&io___87);
  2212. /* Writing concatenation */
  2213. #line 576 "pmtexb2.f"
  2214.     i__1[0] = *lsout, a__1[0] = sout;
  2215. #line 576 "pmtexb2.f"
  2216.     i__1[1] = 1, a__1[1] = "%";
  2217. #line 576 "pmtexb2.f"
  2218.     s_cat(ch__1, a__1, i__1, &c__2, 81L);
  2219. #line 576 "pmtexb2.f"
  2220.     do_fio(&c__1, ch__1, *lsout + 1);
  2221. #line 576 "pmtexb2.f"
  2222.     e_wsfe();
  2223. #line 577 "pmtexb2.f"
  2224.     *lsout = 0;
  2225. #line 578 "pmtexb2.f"
  2226.     }
  2227. #line 579 "pmtexb2.f"
  2228.     if (*lsout > 0) {
  2229. /* Writing concatenation */
  2230. #line 580 "pmtexb2.f"
  2231.     i__1[0] = *lsout, a__1[0] = sout;
  2232. #line 580 "pmtexb2.f"
  2233.     i__1[1] = *lnote, a__1[1] = notex;
  2234. #line 580 "pmtexb2.f"
  2235.     s_cat(sout, a__1, i__1, &c__2, 80L);
  2236. #line 581 "pmtexb2.f"
  2237.     } else {
  2238. #line 582 "pmtexb2.f"
  2239.     s_copy(sout, notex, 80L, (*lnote));
  2240. #line 583 "pmtexb2.f"
  2241.     }
  2242. #line 584 "pmtexb2.f"
  2243.     *lsout += *lnote;
  2244. #line 585 "pmtexb2.f"
  2245.     return 0;
  2246. } /* addstr_ */
  2247.  
  2248. /* Character */ VOID notef_(char *ret_val, ftnlen ret_val_len, integer *nolev)
  2249. {
  2250. #line 588 "pmtexb2.f"
  2251.     if (*nolev <= 26) {
  2252. #line 589 "pmtexb2.f"
  2253.     *ret_val = (char) (*nolev + 52);
  2254. #line 590 "pmtexb2.f"
  2255.     } else {
  2256. #line 591 "pmtexb2.f"
  2257.     *ret_val = (char) (*nolev + 70);
  2258. #line 592 "pmtexb2.f"
  2259.     }
  2260. #line 593 "pmtexb2.f"
  2261.     return ;
  2262. } /* notef_ */
  2263.  
  2264. /* Subroutine */ int notex_(char *mynotex, integer *lnote, ftnlen mynotex_len)
  2265. {
  2266.     /* System generated locals */
  2267.     address a__1[5], a__2[4], a__3[6], a__4[2];
  2268.     integer i__1, i__2, i__3[5], i__4[4], i__5[6], i__6[2];
  2269.     real r__1;
  2270.     char ch__1[1];
  2271.  
  2272.     /* Builtin functions */
  2273.     integer s_cmp(char *, char *, ftnlen, ftnlen), pow_ii(integer *, integer *
  2274.         );
  2275.     /* Subroutine */ int s_cat(char *, char **, integer *, integer *, ftnlen);
  2276.  
  2277.     /* Local variables */
  2278.     static integer nole;
  2279.     static char note[1];
  2280.     static integer nodu;
  2281.     static real zmin, fnole;
  2282.     extern /* Character */ VOID notef_(char *, ftnlen, integer *);
  2283.     static char ud[1];
  2284.     extern /* Character */ VOID ulf_(char *, ftnlen, real *);
  2285.     extern integer log2_(integer *);
  2286.  
  2287. /* ccccccccccc */
  2288. /* c */
  2289. /* c  pmtex.inc */
  2290. /* c */
  2291. /* ccccccccccc */
  2292. #line 602 "pmtexb2.f"
  2293.     nole = all_1.nolev[all_1.iv + all_1.list[(all_1.jn << 2) - 3] * 5 - 6];
  2294. #line 603 "pmtexb2.f"
  2295.     nodu = all_1.nodur[all_1.iv + all_1.list[(all_1.jn << 2) - 3] * 5 - 6];
  2296. #line 604 "pmtexb2.f"
  2297.     r__1 = (nole - all_1.ncmid[all_1.iv - 1]) * 1.f;
  2298. #line 604 "pmtexb2.f"
  2299.     ulf_(ch__1, 1L, &r__1);
  2300. #line 604 "pmtexb2.f"
  2301.     *ud = ch__1[0];
  2302. /* ####  Check figure level */
  2303. #line 606 "pmtexb2.f"
  2304.     if (comfig_1.figbass && all_1.iv == 1 && s_cmp(all_1.fig + (all_1.list[(
  2305. #line 606 "pmtexb2.f"
  2306.         all_1.jn << 2) - 3] - 1) * 6, "x", 6L, 1L) != 0) {
  2307. #line 608 "pmtexb2.f"
  2308.     if (*ud == 'u') {
  2309. /* #### Upper stem, fnole (in noleunits) set by notehead */
  2310. #line 610 "pmtexb2.f"
  2311.         fnole = (real) nole;
  2312. #line 611 "pmtexb2.f"
  2313.     } else {
  2314. /* ##### Lower stem, fnole set by bottom of stem */
  2315. #line 613 "pmtexb2.f"
  2316.         fnole = nole - all_1.stemlen;
  2317. #line 614 "pmtexb2.f"
  2318.     }
  2319. #line 615 "pmtexb2.f"
  2320.     zmin = fnole - all_1.ncmid[0] + 4;
  2321. /* Computing MAX */
  2322. #line 616 "pmtexb2.f"
  2323.     i__1 = comfig_1.ifigdrop[comfig_1.iline - 1], i__2 = (integer) (4 - 
  2324. #line 616 "pmtexb2.f"
  2325.         zmin + .5f);
  2326. #line 616 "pmtexb2.f"
  2327.     comfig_1.ifigdrop[comfig_1.iline - 1] = max(i__1,i__2);
  2328. #line 617 "pmtexb2.f"
  2329.     }
  2330. #line 618 "pmtexb2.f"
  2331.     if (! all_1.rest[all_1.iv + all_1.list[(all_1.jn << 2) - 3] * 5 - 6]) {
  2332. #line 619 "pmtexb2.f"
  2333.     *lnote = 5;
  2334. #line 620 "pmtexb2.f"
  2335.     notef_(ch__1, 1L, &nole);
  2336. #line 620 "pmtexb2.f"
  2337.     *note = ch__1[0];
  2338. #line 621 "pmtexb2.f"
  2339.     i__2 = (integer) (nodu / 3.f + .1f);
  2340. #line 621 "pmtexb2.f"
  2341.     i__1 = log2_(&i__2);
  2342. #line 621 "pmtexb2.f"
  2343.     if ((integer) (nodu / 3.f + .1f) == pow_ii(&c__2, &i__1)) {
  2344. #line 622 "pmtexb2.f"
  2345.         if (nodu == 3) {
  2346. /* Writing concatenation */
  2347. #line 623 "pmtexb2.f"
  2348.         i__3[0] = 1, a__1[0] = all_1.s;
  2349. #line 623 "pmtexb2.f"
  2350.         i__3[1] = 3, a__1[1] = "ccc";
  2351. #line 623 "pmtexb2.f"
  2352.         i__3[2] = 1, a__1[2] = ud;
  2353. #line 623 "pmtexb2.f"
  2354.         i__3[3] = 1, a__1[3] = " ";
  2355. #line 623 "pmtexb2.f"
  2356.         i__3[4] = 1, a__1[4] = note;
  2357. #line 623 "pmtexb2.f"
  2358.         s_cat(mynotex, a__1, i__3, &c__5, 25L);
  2359. #line 624 "pmtexb2.f"
  2360.         *lnote = 7;
  2361. #line 625 "pmtexb2.f"
  2362.         } else if (nodu == 6) {
  2363. /* Writing concatenation */
  2364. #line 626 "pmtexb2.f"
  2365.         i__3[0] = 1, a__1[0] = all_1.s;
  2366. #line 626 "pmtexb2.f"
  2367.         i__3[1] = 2, a__1[1] = "cc";
  2368. #line 626 "pmtexb2.f"
  2369.         i__3[2] = 1, a__1[2] = ud;
  2370. #line 626 "pmtexb2.f"
  2371.         i__3[3] = 1, a__1[3] = " ";
  2372. #line 626 "pmtexb2.f"
  2373.         i__3[4] = 1, a__1[4] = note;
  2374. #line 626 "pmtexb2.f"
  2375.         s_cat(mynotex, a__1, i__3, &c__5, 25L);
  2376. #line 627 "pmtexb2.f"
  2377.         *lnote = 6;
  2378. #line 628 "pmtexb2.f"
  2379.         } else if (nodu == 12) {
  2380. /* Writing concatenation */
  2381. #line 629 "pmtexb2.f"
  2382.         i__3[0] = 1, a__1[0] = all_1.s;
  2383. #line 629 "pmtexb2.f"
  2384.         i__3[1] = 1, a__1[1] = "c";
  2385. #line 629 "pmtexb2.f"
  2386.         i__3[2] = 1, a__1[2] = ud;
  2387. #line 629 "pmtexb2.f"
  2388.         i__3[3] = 1, a__1[3] = " ";
  2389. #line 629 "pmtexb2.f"
  2390.         i__3[4] = 1, a__1[4] = note;
  2391. #line 629 "pmtexb2.f"
  2392.         s_cat(mynotex, a__1, i__3, &c__5, 25L);
  2393. #line 630 "pmtexb2.f"
  2394.         } else if (nodu == 24) {
  2395. /* Writing concatenation */
  2396. #line 631 "pmtexb2.f"
  2397.         i__3[0] = 1, a__1[0] = all_1.s;
  2398. #line 631 "pmtexb2.f"
  2399.         i__3[1] = 1, a__1[1] = "q";
  2400. #line 631 "pmtexb2.f"
  2401.         i__3[2] = 1, a__1[2] = ud;
  2402. #line 631 "pmtexb2.f"
  2403.         i__3[3] = 1, a__1[3] = " ";
  2404. #line 631 "pmtexb2.f"
  2405.         i__3[4] = 1, a__1[4] = note;
  2406. #line 631 "pmtexb2.f"
  2407.         s_cat(mynotex, a__1, i__3, &c__5, 25L);
  2408. #line 632 "pmtexb2.f"
  2409.         } else if (nodu == 48) {
  2410. /* Writing concatenation */
  2411. #line 633 "pmtexb2.f"
  2412.         i__3[0] = 1, a__1[0] = all_1.s;
  2413. #line 633 "pmtexb2.f"
  2414.         i__3[1] = 1, a__1[1] = "h";
  2415. #line 633 "pmtexb2.f"
  2416.         i__3[2] = 1, a__1[2] = ud;
  2417. #line 633 "pmtexb2.f"
  2418.         i__3[3] = 1, a__1[3] = " ";
  2419. #line 633 "pmtexb2.f"
  2420.         i__3[4] = 1, a__1[4] = note;
  2421. #line 633 "pmtexb2.f"
  2422.         s_cat(mynotex, a__1, i__3, &c__5, 25L);
  2423. #line 634 "pmtexb2.f"
  2424.         } else if (nodu == 96) {
  2425. /* Writing concatenation */
  2426. #line 635 "pmtexb2.f"
  2427.         i__4[0] = 1, a__2[0] = all_1.s;
  2428. #line 635 "pmtexb2.f"
  2429.         i__4[1] = 2, a__2[1] = "wh";
  2430. #line 635 "pmtexb2.f"
  2431.         i__4[2] = 1, a__2[2] = " ";
  2432. #line 635 "pmtexb2.f"
  2433.         i__4[3] = 1, a__2[3] = note;
  2434. #line 635 "pmtexb2.f"
  2435.         s_cat(mynotex, a__2, i__4, &c__4, 25L);
  2436. #line 636 "pmtexb2.f"
  2437.         }
  2438. #line 637 "pmtexb2.f"
  2439.     } else {
  2440. #line 638 "pmtexb2.f"
  2441.         *lnote = 6;
  2442. #line 639 "pmtexb2.f"
  2443.         if (nodu == 18) {
  2444. /* Writing concatenation */
  2445. #line 640 "pmtexb2.f"
  2446.         i__5[0] = 1, a__3[0] = all_1.s;
  2447. #line 640 "pmtexb2.f"
  2448.         i__5[1] = 1, a__3[1] = "c";
  2449. #line 640 "pmtexb2.f"
  2450.         i__5[2] = 1, a__3[2] = ud;
  2451. #line 640 "pmtexb2.f"
  2452.         i__5[3] = 1, a__3[3] = "p";
  2453. #line 640 "pmtexb2.f"
  2454.         i__5[4] = 1, a__3[4] = " ";
  2455. #line 640 "pmtexb2.f"
  2456.         i__5[5] = 1, a__3[5] = note;
  2457. #line 640 "pmtexb2.f"
  2458.         s_cat(mynotex, a__3, i__5, &c__6, 25L);
  2459. #line 641 "pmtexb2.f"
  2460.         } else if (nodu == 36) {
  2461. /* Writing concatenation */
  2462. #line 642 "pmtexb2.f"
  2463.         i__5[0] = 1, a__3[0] = all_1.s;
  2464. #line 642 "pmtexb2.f"
  2465.         i__5[1] = 1, a__3[1] = "q";
  2466. #line 642 "pmtexb2.f"
  2467.         i__5[2] = 1, a__3[2] = ud;
  2468. #line 642 "pmtexb2.f"
  2469.         i__5[3] = 1, a__3[3] = "p";
  2470. #line 642 "pmtexb2.f"
  2471.         i__5[4] = 1, a__3[4] = " ";
  2472. #line 642 "pmtexb2.f"
  2473.         i__5[5] = 1, a__3[5] = note;
  2474. #line 642 "pmtexb2.f"
  2475.         s_cat(mynotex, a__3, i__5, &c__6, 25L);
  2476. #line 643 "pmtexb2.f"
  2477.         } else if (nodu == 72) {
  2478. /* Writing concatenation */
  2479. #line 644 "pmtexb2.f"
  2480.         i__5[0] = 1, a__3[0] = all_1.s;
  2481. #line 644 "pmtexb2.f"
  2482.         i__5[1] = 1, a__3[1] = "h";
  2483. #line 644 "pmtexb2.f"
  2484.         i__5[2] = 1, a__3[2] = ud;
  2485. #line 644 "pmtexb2.f"
  2486.         i__5[3] = 1, a__3[3] = "p";
  2487. #line 644 "pmtexb2.f"
  2488.         i__5[4] = 1, a__3[4] = " ";
  2489. #line 644 "pmtexb2.f"
  2490.         i__5[5] = 1, a__3[5] = note;
  2491. #line 644 "pmtexb2.f"
  2492.         s_cat(mynotex, a__3, i__5, &c__6, 25L);
  2493. #line 645 "pmtexb2.f"
  2494.         } else if (nodu == 9) {
  2495. /* Writing concatenation */
  2496. #line 646 "pmtexb2.f"
  2497.         i__5[0] = 1, a__3[0] = all_1.s;
  2498. #line 646 "pmtexb2.f"
  2499.         i__5[1] = 1, a__3[1] = "c";
  2500. #line 646 "pmtexb2.f"
  2501.         i__5[2] = 1, a__3[2] = ud;
  2502. #line 646 "pmtexb2.f"
  2503.         i__5[3] = 1, a__3[3] = "p";
  2504. #line 646 "pmtexb2.f"
  2505.         i__5[4] = 1, a__3[4] = " ";
  2506. #line 646 "pmtexb2.f"
  2507.         i__5[5] = 1, a__3[5] = note;
  2508. #line 646 "pmtexb2.f"
  2509.         s_cat(mynotex, a__3, i__5, &c__6, 25L);
  2510. #line 647 "pmtexb2.f"
  2511.         *lnote = 7;
  2512. #line 648 "pmtexb2.f"
  2513.         }
  2514. #line 649 "pmtexb2.f"
  2515.     }
  2516. #line 650 "pmtexb2.f"
  2517.     } else {
  2518.  
  2519. /*  "rest" (real, whole-bar, or accidental gap) */
  2520.  
  2521. #line 654 "pmtexb2.f"
  2522.     *lnote = 3;
  2523.  
  2524. /*  First check for whole-bar rest. */
  2525.  
  2526. #line 658 "pmtexb2.f"
  2527.     if (all_1.acc[all_1.iv + all_1.list[(all_1.jn << 2) - 3] * 5 - 6] == 
  2528. #line 658 "pmtexb2.f"
  2529.         'b') {
  2530. /* Writing concatenation */
  2531. #line 659 "pmtexb2.f"
  2532.         i__6[0] = 1, a__4[0] = all_1.s;
  2533. #line 659 "pmtexb2.f"
  2534.         i__6[1] = 2, a__4[1] = "sk";
  2535. #line 659 "pmtexb2.f"
  2536.         s_cat(mynotex, a__4, i__6, &c__2, 25L);
  2537. #line 660 "pmtexb2.f"
  2538.     } else if (all_1.acc[all_1.iv + all_1.list[(all_1.jn << 2) - 3] * 5 - 
  2539. #line 660 "pmtexb2.f"
  2540.         6] == 'w') {
  2541. /* Writing concatenation */
  2542. #line 661 "pmtexb2.f"
  2543.         i__5[0] = 1, a__3[0] = all_1.s;
  2544. #line 661 "pmtexb2.f"
  2545.         i__5[1] = 5, a__3[1] = "rlap{";
  2546. #line 661 "pmtexb2.f"
  2547.         i__5[2] = 1, a__3[2] = all_1.s;
  2548. #line 661 "pmtexb2.f"
  2549.         i__5[3] = 3, a__3[3] = "qsk";
  2550. #line 661 "pmtexb2.f"
  2551.         i__5[4] = 1, a__3[4] = all_1.s;
  2552. #line 661 "pmtexb2.f"
  2553.         i__5[5] = 6, a__3[5] = "pause}";
  2554. #line 661 "pmtexb2.f"
  2555.         s_cat(mynotex, a__3, i__5, &c__6, 25L);
  2556. #line 662 "pmtexb2.f"
  2557.         *lnote = 17;
  2558.  
  2559. /*  Now check for accidental gap */
  2560.  
  2561. #line 666 "pmtexb2.f"
  2562.     } else if (all_1.acc[all_1.iv + all_1.list[(all_1.jn << 2) - 3] * 5 - 
  2563. #line 666 "pmtexb2.f"
  2564.         6] == 'a') {
  2565. /* Writing concatenation */
  2566. #line 667 "pmtexb2.f"
  2567.         i__6[0] = 1, a__4[0] = all_1.s;
  2568. #line 667 "pmtexb2.f"
  2569.         i__6[1] = 3, a__4[1] = "ask";
  2570. #line 667 "pmtexb2.f"
  2571.         s_cat(mynotex, a__4, i__6, &c__2, 25L);
  2572. #line 668 "pmtexb2.f"
  2573.         *lnote = 4;
  2574. #line 669 "pmtexb2.f"
  2575.     } else if (nodu == 3) {
  2576. /* Writing concatenation */
  2577. #line 670 "pmtexb2.f"
  2578.         i__6[0] = 1, a__4[0] = all_1.s;
  2579. #line 670 "pmtexb2.f"
  2580.         i__6[1] = 2, a__4[1] = "hs";
  2581. #line 670 "pmtexb2.f"
  2582.         s_cat(mynotex, a__4, i__6, &c__2, 25L);
  2583. #line 671 "pmtexb2.f"
  2584.     } else if (nodu == 6) {
  2585. /* Writing concatenation */
  2586. #line 672 "pmtexb2.f"
  2587.         i__6[0] = 1, a__4[0] = all_1.s;
  2588. #line 672 "pmtexb2.f"
  2589.         i__6[1] = 2, a__4[1] = "qs";
  2590. #line 672 "pmtexb2.f"
  2591.         s_cat(mynotex, a__4, i__6, &c__2, 25L);
  2592. #line 673 "pmtexb2.f"
  2593.     } else if (nodu == 12) {
  2594. /* Writing concatenation */
  2595. #line 674 "pmtexb2.f"
  2596.         i__6[0] = 1, a__4[0] = all_1.s;
  2597. #line 674 "pmtexb2.f"
  2598.         i__6[1] = 2, a__4[1] = "ds";
  2599. #line 674 "pmtexb2.f"
  2600.         s_cat(mynotex, a__4, i__6, &c__2, 25L);
  2601. #line 675 "pmtexb2.f"
  2602.     } else if (nodu == 24) {
  2603. /* Writing concatenation */
  2604. #line 676 "pmtexb2.f"
  2605.         i__6[0] = 1, a__4[0] = all_1.s;
  2606. #line 676 "pmtexb2.f"
  2607.         i__6[1] = 2, a__4[1] = "qp";
  2608. #line 676 "pmtexb2.f"
  2609.         s_cat(mynotex, a__4, i__6, &c__2, 25L);
  2610. #line 677 "pmtexb2.f"
  2611.     } else if (nodu == 48) {
  2612. /* Writing concatenation */
  2613. #line 678 "pmtexb2.f"
  2614.         i__6[0] = 1, a__4[0] = all_1.s;
  2615. #line 678 "pmtexb2.f"
  2616.         i__6[1] = 6, a__4[1] = "hpause";
  2617. #line 678 "pmtexb2.f"
  2618.         s_cat(mynotex, a__4, i__6, &c__2, 25L);
  2619. #line 679 "pmtexb2.f"
  2620.         *lnote = 7;
  2621. #line 680 "pmtexb2.f"
  2622.     } else if (nodu == 96) {
  2623. /* Writing concatenation */
  2624. #line 681 "pmtexb2.f"
  2625.         i__6[0] = 1, a__4[0] = all_1.s;
  2626. #line 681 "pmtexb2.f"
  2627.         i__6[1] = 5, a__4[1] = "pause";
  2628. #line 681 "pmtexb2.f"
  2629.         s_cat(mynotex, a__4, i__6, &c__2, 25L);
  2630. #line 682 "pmtexb2.f"
  2631.         *lnote = 6;
  2632. #line 683 "pmtexb2.f"
  2633.     }
  2634. #line 684 "pmtexb2.f"
  2635.     }
  2636. #line 685 "pmtexb2.f"
  2637.     return 0;
  2638. } /* notex_ */
  2639.  
  2640. /* Subroutine */ int fillbeat_(integer *lenbeam, integer *ip1, integer *
  2641.     numbms)
  2642. {
  2643.     /* System generated locals */
  2644.     integer i__1, i__2, i__3;
  2645.     real r__1;
  2646.     char ch__1[1];
  2647.  
  2648.     /* Builtin functions */
  2649.     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
  2650.         e_wsle(void);
  2651.     /* Subroutine */ int s_stop(char *, ftnlen);
  2652.  
  2653.     /* Local variables */
  2654.     static integer nask, itend, ixtra, l2, ip, jp;
  2655.     static real elskbm;
  2656.     static integer in1, ip2, it1, it2;
  2657.     extern /* Character */ VOID hbf_(char *, ftnlen, real *);
  2658.     static integer iip;
  2659.     extern /* Character */ VOID ulf_(char *, ftnlen, real *);
  2660.     static real sum;
  2661.     extern integer log2_(integer *);
  2662.  
  2663.     /* Fortran I/O blocks */
  2664.     static cilist io___107 = { 0, 6, 0, 0, 0 };
  2665.  
  2666.  
  2667. /* ccccccccccc */
  2668. /* c */
  2669. /* c  pmtex.inc */
  2670. /* c */
  2671. /* ccccccccccc */
  2672. #line 691 "pmtexb2.f"
  2673.     /* Parameter adjustments */
  2674. #line 691 "pmtexb2.f"
  2675.     --numbms;
  2676. #line 691 "pmtexb2.f"
  2677.  
  2678. #line 691 "pmtexb2.f"
  2679.     /* Function Body */
  2680. #line 691 "pmtexb2.f"
  2681.     in1 = all_1.ipl[all_1.iv + *ip1 * 5 - 6];
  2682. #line 692 "pmtexb2.f"
  2683.     it1 = all_1.list[(in1 << 2) - 2];
  2684. #line 693 "pmtexb2.f"
  2685.     it2 = it1 + *lenbeam;
  2686. #line 694 "pmtexb2.f"
  2687.     itend = it1 + all_1.nodur[all_1.iv + *ip1 * 5 - 6];
  2688. /* ### Bounce out if (a) starting time not on an even beat, */
  2689. /*                  (b) rest */
  2690. /*                  (c) a single note fills the beat */
  2691. /*                  (d) too close to the end of the bar */
  2692. /*                  (e) note is quarter or longer */
  2693. #line 700 "pmtexb2.f"
  2694.     if (it1 % *lenbeam != 0 || all_1.rest[all_1.iv + *ip1 * 5 - 6] || 
  2695. #line 700 "pmtexb2.f"
  2696.         all_1.nodur[all_1.iv + *ip1 * 5 - 6] == *lenbeam || itend >= it2 
  2697. #line 700 "pmtexb2.f"
  2698.         || all_1.nodur[all_1.iv + *ip1 * 5 - 6] >= 24) {
  2699. #line 700 "pmtexb2.f"
  2700.     return 0;
  2701. #line 700 "pmtexb2.f"
  2702.     }
  2703.  
  2704. /* In the previous line, "if ... rest" makes beams starting with spaced */
  2705. /* accidentals begin on the note rather than the accidental. */
  2706.  
  2707. #line 707 "pmtexb2.f"
  2708.     i__1 = all_1.nn[all_1.iv - 1];
  2709. #line 707 "pmtexb2.f"
  2710.     for (ip = *ip1 + 1; ip <= i__1; ++ip) {
  2711. /* Add new note */
  2712. #line 709 "pmtexb2.f"
  2713.     itend += all_1.nodur[all_1.iv + ip * 5 - 6];
  2714. /*### Check for real rest or gone past end of potential beam or note 
  2715. >= quarter*/
  2716. #line 711 "pmtexb2.f"
  2717.     if (all_1.rest[all_1.iv + ip * 5 - 6] && all_1.acc[all_1.iv + ip * 5 
  2718. #line 711 "pmtexb2.f"
  2719.         - 6] != 'a' || itend > it2 || all_1.nodur[all_1.iv + ip * 5 - 
  2720. #line 711 "pmtexb2.f"
  2721.         6] >= 24) {
  2722. #line 711 "pmtexb2.f"
  2723.         return 0;
  2724. #line 711 "pmtexb2.f"
  2725.     }
  2726.  
  2727. /* If "rest" at this point, it has to be an accidental skip */
  2728.  
  2729. #line 716 "pmtexb2.f"
  2730.     if (itend < it2 || itend == it2 && all_1.rest[all_1.iv + ip * 5 - 6]) 
  2731. #line 716 "pmtexb2.f"
  2732.         {
  2733. #line 716 "pmtexb2.f"
  2734.         goto L1;
  2735. #line 716 "pmtexb2.f"
  2736.     }
  2737.  
  2738. /*  AHA beams */
  2739.  
  2740. #line 720 "pmtexb2.f"
  2741.     ++numbms[all_1.iv];
  2742. #line 721 "pmtexb2.f"
  2743.     all_1.ibm1[all_1.iv + numbms[all_1.iv] * 5 - 6] = *ip1;
  2744. #line 722 "pmtexb2.f"
  2745.     ip2 = ip;
  2746.  
  2747. /*  Special check for 4 eighth notes or 3 8ths + 8th rest */
  2748.  
  2749. /*       if (mod(it1,48).eq.0 .and. nodur(iv,ip1).eq.12 */
  2750. /*    *      .and. nodur(iv,ip2).eq.12 .and. lenbar.eq.96 .and. */
  2751. /*    *      nn(iv).ge.ip2+2 .and. nodur(iv,ip2+1).eq.12 */
  2752. /*    *      .and. nodur(iv,ip2+2).eq.12 .and. .not.rest(iv,ip2+1)) */
  2753. /*    *      then */
  2754. /*         if (rest(iv,ip2+2)) then */
  2755. /*           ip2 = ip2+1 */
  2756. /*         else */
  2757. /*           ip2 = ip2+2 */
  2758. /*         end if */
  2759. /*       end if */
  2760. #line 737 "pmtexb2.f"
  2761.     if (it1 % 48 == 0 && all_1.nodur[all_1.iv + *ip1 * 5 - 6] == 12 && 
  2762. #line 737 "pmtexb2.f"
  2763.         all_1.nodur[all_1.iv + ip2 * 5 - 6] == 12 && all_1.lenbar == 
  2764. #line 737 "pmtexb2.f"
  2765.         96 && all_1.nn[all_1.iv - 1] >= ip2 + 2) {
  2766. /* #### We have 2 1/8th notes.  Look for third and fourth. */
  2767. #line 741 "pmtexb2.f"
  2768.         ixtra = 0;
  2769. #line 742 "pmtexb2.f"
  2770.         i__2 = all_1.nn[all_1.iv - 1];
  2771. #line 742 "pmtexb2.f"
  2772.         for (jp = ip2 + 1; jp <= i__2; ++jp) {
  2773. #line 743 "pmtexb2.f"
  2774.         if (all_1.nodur[all_1.iv + jp * 5 - 6] != 12 && all_1.acc[
  2775. #line 743 "pmtexb2.f"
  2776.             all_1.iv + jp * 5 - 6] != 'a' || ixtra == 0 && 
  2777. #line 743 "pmtexb2.f"
  2778.             all_1.rest[all_1.iv + jp * 5 - 6]) {
  2779. #line 743 "pmtexb2.f"
  2780.             goto L4;
  2781. #line 743 "pmtexb2.f"
  2782.         }
  2783. #line 745 "pmtexb2.f"
  2784.         if (all_1.acc[all_1.iv + jp * 5 - 6] == 'a') {
  2785. #line 745 "pmtexb2.f"
  2786.             goto L3;
  2787. #line 745 "pmtexb2.f"
  2788.         }
  2789. #line 746 "pmtexb2.f"
  2790.         ++ixtra;
  2791. #line 747 "pmtexb2.f"
  2792.         if (ixtra == 2) {
  2793. #line 748 "pmtexb2.f"
  2794.             if (all_1.rest[all_1.iv + jp * 5 - 6]) {
  2795. /* #### 3-1/8th note beam.  Back up to note */
  2796. #line 750 "pmtexb2.f"
  2797.             ip2 = jp - 1;
  2798. #line 751 "pmtexb2.f"
  2799. L5:
  2800. #line 751 "pmtexb2.f"
  2801.             if (all_1.rest[all_1.iv + ip2 * 5 - 6]) {
  2802. #line 752 "pmtexb2.f"
  2803.                 --ip2;
  2804. #line 753 "pmtexb2.f"
  2805.                 goto L5;
  2806. #line 754 "pmtexb2.f"
  2807.             }
  2808. #line 755 "pmtexb2.f"
  2809.             } else {
  2810. #line 756 "pmtexb2.f"
  2811.             ip2 = jp;
  2812. #line 757 "pmtexb2.f"
  2813.             }
  2814. #line 758 "pmtexb2.f"
  2815.             goto L4;
  2816. #line 759 "pmtexb2.f"
  2817.         }
  2818. #line 760 "pmtexb2.f"
  2819. L3:
  2820. #line 760 "pmtexb2.f"
  2821.         ;
  2822. #line 760 "pmtexb2.f"
  2823.         }
  2824. #line 761 "pmtexb2.f"
  2825.     }
  2826. #line 762 "pmtexb2.f"
  2827. L4:
  2828. #line 763 "pmtexb2.f"
  2829.     all_1.ibm2[all_1.iv + numbms[all_1.iv] * 5 - 6] = ip2;
  2830. #line 764 "pmtexb2.f"
  2831.     sum = 0.f;
  2832. #line 765 "pmtexb2.f"
  2833.     elskbm = 0.f;
  2834. #line 766 "pmtexb2.f"
  2835.     nask = 0;
  2836. #line 767 "pmtexb2.f"
  2837.     i__2 = ip2;
  2838. #line 767 "pmtexb2.f"
  2839.     for (iip = *ip1; iip <= i__2; ++iip) {
  2840. #line 768 "pmtexb2.f"
  2841.         if (all_1.rest[all_1.iv + iip * 5 - 6]) {
  2842. #line 769 "pmtexb2.f"
  2843.         all_1.mult[all_1.iv + iip * 5 - 6] = 0;
  2844. #line 770 "pmtexb2.f"
  2845.         ++nask;
  2846. #line 771 "pmtexb2.f"
  2847.         } else {
  2848. #line 772 "pmtexb2.f"
  2849.         i__3 = (integer) (all_1.nodur[all_1.iv + iip * 5 - 6] / 3.f + 
  2850. #line 772 "pmtexb2.f"
  2851.             .1f);
  2852. #line 772 "pmtexb2.f"
  2853.         l2 = log2_(&i__3);
  2854. #line 773 "pmtexb2.f"
  2855.         sum += all_1.nolev[all_1.iv + iip * 5 - 6];
  2856. #line 774 "pmtexb2.f"
  2857.         all_1.mult[all_1.iv + iip * 5 - 6] = 3 - l2;
  2858. #line 775 "pmtexb2.f"
  2859.         }
  2860. #line 776 "pmtexb2.f"
  2861. /* L2: */
  2862. #line 776 "pmtexb2.f"
  2863.     }
  2864. #line 777 "pmtexb2.f"
  2865.     r__1 = sum / (ip2 - *ip1 + 1 - nask) - all_1.ncmid[all_1.iv - 1];
  2866. #line 777 "pmtexb2.f"
  2867.     ulf_(ch__1, 1L, &r__1);
  2868. #line 777 "pmtexb2.f"
  2869.     all_1.ul[all_1.iv + numbms[all_1.iv] * 5 - 6] = ch__1[0];
  2870. #line 778 "pmtexb2.f"
  2871.     r__1 = sum / (ip2 - *ip1 + 1 - nask) - all_1.ncmid[all_1.iv - 1];
  2872. #line 778 "pmtexb2.f"
  2873.     hbf_(ch__1, 1L, &r__1);
  2874. #line 778 "pmtexb2.f"
  2875.     all_1.hb[all_1.iv + numbms[all_1.iv] * 5 - 6] = ch__1[0];
  2876. #line 779 "pmtexb2.f"
  2877.     return 0;
  2878. #line 780 "pmtexb2.f"
  2879. L1:
  2880. #line 780 "pmtexb2.f"
  2881.     ;
  2882. #line 780 "pmtexb2.f"
  2883.     }
  2884. #line 781 "pmtexb2.f"
  2885.     s_wsle(&io___107);
  2886. #line 781 "pmtexb2.f"
  2887.     do_lio(&c__9, &c__1, "You should not be here in fillbeat", 34L);
  2888. #line 781 "pmtexb2.f"
  2889.     e_wsle();
  2890. #line 782 "pmtexb2.f"
  2891.     s_stop("", 0L);
  2892. #line 783 "pmtexb2.f"
  2893.     return 0;
  2894. } /* fillbeat_ */
  2895.  
  2896. /* Character */ VOID ulf_(char *ret_val, ftnlen ret_val_len, real *xnolev)
  2897. {
  2898. #line 785 "pmtexb2.f"
  2899.     if (*xnolev >= 0.f) {
  2900. #line 786 "pmtexb2.f"
  2901.     *ret_val = 'l';
  2902. #line 787 "pmtexb2.f"
  2903.     } else {
  2904. #line 788 "pmtexb2.f"
  2905.     *ret_val = 'u';
  2906. #line 789 "pmtexb2.f"
  2907.     }
  2908. #line 790 "pmtexb2.f"
  2909.     return ;
  2910. } /* ulf_ */
  2911.  
  2912. /* Character */ VOID hbf_(char *ret_val, ftnlen ret_val_len, real *xnolev)
  2913. {
  2914. #line 793 "pmtexb2.f"
  2915.     if (*xnolev >= 0.f) {
  2916. #line 794 "pmtexb2.f"
  2917.     *ret_val = 'b';
  2918. #line 795 "pmtexb2.f"
  2919.     } else {
  2920. #line 796 "pmtexb2.f"
  2921.     *ret_val = 'h';
  2922. #line 797 "pmtexb2.f"
  2923.     }
  2924. #line 798 "pmtexb2.f"
  2925.     return ;
  2926. } /* hbf_ */
  2927.  
  2928. /* Subroutine */ int makeabar_(void)
  2929. {
  2930.     /* Initialized data */
  2931.  
  2932.     static char nstart[5*6] = "notes" "Notes" "NOtes" "NOTes" "NOTEs" "NOTES";
  2933.  
  2934.     /* System generated locals */
  2935.     address a__1[2], a__2[3];
  2936.     integer i__1, i__2, i__3, i__4, i__5[2], i__6[3], i__7;
  2937.     real r__1;
  2938.     char ch__1[3], ch__2[4], ch__3[6], ch__4[1], ch__5[26], ch__6[7], ch__7[
  2939.         81];
  2940.  
  2941.     /* Builtin functions */
  2942.     integer s_wsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
  2943.         e_wsle(void);
  2944.     /* Subroutine */ int s_stop(char *, ftnlen), s_cat(char *, char **, 
  2945.         integer *, integer *, ftnlen);
  2946.     integer s_cmp(char *, char *, ftnlen, ftnlen), s_wsfe(cilist *), do_fio(
  2947.         integer *, char *, ftnlen), e_wsfe(void);
  2948.  
  2949.     /* Local variables */
  2950.     static integer ilnc, infr;
  2951.     extern /* Subroutine */ int fillbeat_(integer *, integer *, integer *);
  2952.     static integer itim, ntot;
  2953.     static char sout[80];
  2954.     extern /* Subroutine */ int beamstrt_(char *, integer *, integer *, 
  2955.         integer *, ftnlen);
  2956.     static integer itendnow, nbold;
  2957.     extern /* Character */ VOID notef_(char *, ftnlen, integer *);
  2958.     static integer iitim, nornb[5], ihorn, itmin, lnote;
  2959.     extern /* Subroutine */ int notex_(char *, integer *, ftnlen);
  2960.     static integer istop[20], itnow;
  2961.     extern /* Subroutine */ int beamn1_(char *, integer *, ftnlen);
  2962.     static integer lsout, ib, nb;
  2963.     extern /* Subroutine */ int beamid_(char *, integer *, ftnlen);
  2964.     static integer in, ip;
  2965.     extern integer ni_(real *);
  2966.     static integer it[5], jv, nspace[20];
  2967.     static logical bspend;
  2968.     static integer ihornb[80]    /* was [5][16] */;
  2969.     extern /* Subroutine */ int addstr_(char *, integer *, char *, integer *, 
  2970.         ftnlen, ftnlen);
  2971.     static integer nindex[20], itminn;
  2972.     extern /* Subroutine */ int putfig_(char *, char *, integer *, ftnlen, 
  2973.         ftnlen);
  2974.     static integer numbms[5], ittemp, istart[20], ivnext;
  2975.     extern /* Subroutine */ int beamend_(char *, integer *, ftnlen);
  2976.     static integer cnn[5], iin, iip;
  2977.     extern integer log2_(integer *);
  2978.     static integer itstart[20], itwrest;
  2979.     static char mynotex[25];
  2980.     extern /* Subroutine */ int add2list_(integer *, integer *, integer *, 
  2981.         integer *, char *, logical *, integer *, integer *, integer *, 
  2982.         integer *, ftnlen);
  2983.  
  2984.     /* Fortran I/O blocks */
  2985.     static cilist io___117 = { 0, 6, 0, 0, 0 };
  2986.     static cilist io___120 = { 0, 6, 0, 0, 0 };
  2987.     static cilist io___132 = { 0, 6, 0, 0, 0 };
  2988.     static cilist io___148 = { 0, 11, 0, "(a)", 0 };
  2989.  
  2990.  
  2991. /* ccccccccccc */
  2992. /* c */
  2993. /* c  pmtex.inc */
  2994. /* c */
  2995. /* ccccccccccc */
  2996. #line 812 "pmtexb2.f"
  2997.     i__1 = all_1.nv;
  2998. #line 812 "pmtexb2.f"
  2999.     for (all_1.iv = 1; all_1.iv <= i__1; ++all_1.iv) {
  3000. #line 813 "pmtexb2.f"
  3001.     if (all_1.ibar > 1) {
  3002. #line 814 "pmtexb2.f"
  3003.         all_1.nn[all_1.iv - 1] = all_1.nib[all_1.iv + all_1.ibar * 5 - 6] 
  3004. #line 814 "pmtexb2.f"
  3005.             - all_1.nib[all_1.iv + (all_1.ibar - 1) * 5 - 6];
  3006. #line 815 "pmtexb2.f"
  3007.     } else {
  3008. #line 816 "pmtexb2.f"
  3009.         all_1.nn[all_1.iv - 1] = all_1.nib[all_1.iv + all_1.ibar * 5 - 6];
  3010. #line 817 "pmtexb2.f"
  3011.     }
  3012. #line 818 "pmtexb2.f"
  3013. /* L1: */
  3014. #line 818 "pmtexb2.f"
  3015.     }
  3016.  
  3017. /* initialize list note counter, time(iv), curr. note(iv) */
  3018.  
  3019. #line 822 "pmtexb2.f"
  3020.     ilnc = 1;
  3021. #line 823 "pmtexb2.f"
  3022.     i__1 = all_1.nv;
  3023. #line 823 "pmtexb2.f"
  3024.     for (all_1.iv = 1; all_1.iv <= i__1; ++all_1.iv) {
  3025. #line 824 "pmtexb2.f"
  3026.     if (all_1.nn[all_1.iv - 1] > 1) {
  3027. #line 825 "pmtexb2.f"
  3028.         it[all_1.iv - 1] = all_1.nodur[all_1.iv - 1];
  3029. #line 826 "pmtexb2.f"
  3030.     } else {
  3031. #line 827 "pmtexb2.f"
  3032.         it[all_1.iv - 1] = 1000;
  3033. #line 828 "pmtexb2.f"
  3034.     }
  3035. #line 829 "pmtexb2.f"
  3036.     cnn[all_1.iv - 1] = 1;
  3037. #line 830 "pmtexb2.f"
  3038.     all_1.list[(ilnc << 2) - 4] = all_1.iv;
  3039. #line 831 "pmtexb2.f"
  3040.     all_1.list[(ilnc << 2) - 3] = 1;
  3041. #line 832 "pmtexb2.f"
  3042.     ++ilnc;
  3043. #line 833 "pmtexb2.f"
  3044. /* L4: */
  3045. #line 833 "pmtexb2.f"
  3046.     }
  3047.  
  3048. /*  Build the list */
  3049.  
  3050. #line 837 "pmtexb2.f"
  3051. L5:
  3052.  
  3053. /*  Determine which voice comes next from end of notes done so far. */
  3054. /*  itmin is the earliest ending time of notes done so far */
  3055.  
  3056. #line 842 "pmtexb2.f"
  3057.     itmin = 1000;
  3058. #line 843 "pmtexb2.f"
  3059.     i__1 = all_1.nv;
  3060. #line 843 "pmtexb2.f"
  3061.     for (all_1.iv = 1; all_1.iv <= i__1; ++all_1.iv) {
  3062. /* Computing MIN */
  3063. #line 844 "pmtexb2.f"
  3064.     i__2 = itmin, i__3 = it[all_1.iv - 1];
  3065. #line 844 "pmtexb2.f"
  3066.     itminn = min(i__2,i__3);
  3067. #line 845 "pmtexb2.f"
  3068.     if (itminn < itmin) {
  3069. #line 846 "pmtexb2.f"
  3070.         itmin = itminn;
  3071. #line 847 "pmtexb2.f"
  3072.         ivnext = all_1.iv;
  3073. #line 848 "pmtexb2.f"
  3074.     }
  3075. #line 849 "pmtexb2.f"
  3076. /* L6: */
  3077. #line 849 "pmtexb2.f"
  3078.     }
  3079. #line 850 "pmtexb2.f"
  3080.     if (itmin == 1000) {
  3081. #line 850 "pmtexb2.f"
  3082.     goto L7;
  3083. #line 850 "pmtexb2.f"
  3084.     }
  3085. #line 851 "pmtexb2.f"
  3086.     all_1.list[(ilnc << 2) - 4] = ivnext;
  3087. #line 852 "pmtexb2.f"
  3088.     ++cnn[ivnext - 1];
  3089. #line 853 "pmtexb2.f"
  3090.     all_1.list[(ilnc << 2) - 3] = cnn[ivnext - 1];
  3091. #line 854 "pmtexb2.f"
  3092.     all_1.list[(ilnc << 2) - 2] = itmin;
  3093.  
  3094. /*  Check if this voice is done */
  3095.  
  3096. #line 858 "pmtexb2.f"
  3097.     if (cnn[ivnext - 1] == all_1.nn[ivnext - 1]) {
  3098. #line 859 "pmtexb2.f"
  3099.     it[ivnext - 1] = 1000;
  3100. #line 860 "pmtexb2.f"
  3101.     } else {
  3102. #line 861 "pmtexb2.f"
  3103.     it[ivnext - 1] += all_1.nodur[ivnext + cnn[ivnext - 1] * 5 - 6];
  3104. #line 862 "pmtexb2.f"
  3105.     }
  3106. #line 863 "pmtexb2.f"
  3107.     ++ilnc;
  3108. #line 864 "pmtexb2.f"
  3109.     goto L5;
  3110. #line 865 "pmtexb2.f"
  3111. L7:
  3112. #line 866 "pmtexb2.f"
  3113.     ntot = ilnc - 1;
  3114. #line 867 "pmtexb2.f"
  3115.     i__1 = ntot - 1;
  3116. #line 867 "pmtexb2.f"
  3117.     for (in = 1; in <= i__1; ++in) {
  3118. #line 868 "pmtexb2.f"
  3119.     all_1.list[(in << 2) - 1] = all_1.list[(in + 1 << 2) - 2] - 
  3120. #line 868 "pmtexb2.f"
  3121.         all_1.list[(in << 2) - 2];
  3122. #line 869 "pmtexb2.f"
  3123. /* L8: */
  3124. #line 869 "pmtexb2.f"
  3125.     }
  3126. #line 870 "pmtexb2.f"
  3127.     all_1.list[(ntot << 2) - 1] = all_1.nodur[all_1.list[(ntot << 2) - 4] + 
  3128. #line 870 "pmtexb2.f"
  3129.         all_1.list[(ntot << 2) - 3] * 5 - 6];
  3130.  
  3131. /*  Done w/ list, but for special checks. First, for full-bar rests */
  3132.  
  3133. #line 874 "pmtexb2.f"
  3134.     i__1 = all_1.nv;
  3135. #line 874 "pmtexb2.f"
  3136.     for (all_1.iv = 1; all_1.iv <= i__1; ++all_1.iv) {
  3137. #line 875 "pmtexb2.f"
  3138.     if (all_1.nodur[all_1.iv - 1] == all_1.lenbar && all_1.rest[all_1.iv 
  3139. #line 875 "pmtexb2.f"
  3140.         - 1] && ntot > all_1.nv) {
  3141.  
  3142. /*  Find the last list position (in) before the half-bar */
  3143.  
  3144. #line 879 "pmtexb2.f"
  3145.         i__2 = ntot - 1;
  3146. #line 879 "pmtexb2.f"
  3147.         for (in = 1; in <= i__2; ++in) {
  3148. #line 880 "pmtexb2.f"
  3149.         if (all_1.list[(in + 1 << 2) - 2] >= all_1.lenbar / 2) {
  3150. #line 880 "pmtexb2.f"
  3151.             goto L32;
  3152. #line 880 "pmtexb2.f"
  3153.         }
  3154. #line 881 "pmtexb2.f"
  3155. /* L31: */
  3156. #line 881 "pmtexb2.f"
  3157.         }
  3158. #line 882 "pmtexb2.f"
  3159.         s_wsle(&io___117);
  3160. #line 882 "pmtexb2.f"
  3161.         do_lio(&c__9, &c__1, "Mess-up looking for half-bar", 28L);
  3162. #line 882 "pmtexb2.f"
  3163.         e_wsle();
  3164. #line 883 "pmtexb2.f"
  3165.         s_stop("", 0L);
  3166. #line 884 "pmtexb2.f"
  3167. L32:
  3168. #line 884 "pmtexb2.f"
  3169.         itwrest = all_1.list[(in << 2) - 2];
  3170.  
  3171. /*  Backup to spot for inserting rest marker, i.e., one to the rig
  3172. ht of */
  3173. /*  the first place where either list(1)<iv or list(3)<itwrest */
  3174.  
  3175. #line 889 "pmtexb2.f"
  3176.         for (iin = in - 1; iin >= 1; --iin) {
  3177. #line 890 "pmtexb2.f"
  3178.         if (all_1.list[(iin << 2) - 4] < all_1.iv || all_1.list[(iin 
  3179. #line 890 "pmtexb2.f"
  3180.             << 2) - 2] < itwrest) {
  3181. #line 890 "pmtexb2.f"
  3182.             goto L34;
  3183. #line 890 "pmtexb2.f"
  3184.         }
  3185. #line 891 "pmtexb2.f"
  3186. /* L33: */
  3187. #line 891 "pmtexb2.f"
  3188.         }
  3189. #line 892 "pmtexb2.f"
  3190.         s_wsle(&io___120);
  3191. #line 892 "pmtexb2.f"
  3192.         do_lio(&c__9, &c__1, "Problem backing up from half bar", 32L);
  3193. #line 892 "pmtexb2.f"
  3194.         e_wsle();
  3195. /*         stop */
  3196. #line 894 "pmtexb2.f"
  3197. L34:
  3198. #line 894 "pmtexb2.f"
  3199.         infr = iin + 1;
  3200. #line 895 "pmtexb2.f"
  3201.         i__2 = all_1.lenbar - itwrest;
  3202. #line 895 "pmtexb2.f"
  3203.         add2list_(&infr, &c__2, &itwrest, &i__2, "w", (logical*)&c__1, &
  3204. #line 895 "pmtexb2.f"
  3205.             ntot, istart, istop, &nb, 1L);
  3206. #line 897 "pmtexb2.f"
  3207.         all_1.nodur[all_1.iv - 1] = itwrest;
  3208. #line 898 "pmtexb2.f"
  3209.         all_1.acc[all_1.iv - 1] = 'b';
  3210. #line 899 "pmtexb2.f"
  3211.     }
  3212. #line 900 "pmtexb2.f"
  3213. /* L30: */
  3214. #line 900 "pmtexb2.f"
  3215.     }
  3216.  
  3217. /*  A kluged up loop for building note blocks: */
  3218.  
  3219. #line 904 "pmtexb2.f"
  3220.     ib = 1;
  3221. #line 905 "pmtexb2.f"
  3222.     istart[0] = 1;
  3223. #line 906 "pmtexb2.f"
  3224.     nspace[0] = 0;
  3225. #line 907 "pmtexb2.f"
  3226.     in = 1;
  3227. #line 908 "pmtexb2.f"
  3228. L9:
  3229. #line 909 "pmtexb2.f"
  3230.     if (in == ntot) {
  3231. #line 910 "pmtexb2.f"
  3232.     if (nspace[ib - 1] == 0) {
  3233. #line 910 "pmtexb2.f"
  3234.         nspace[ib - 1] = all_1.list[(in << 2) - 1];
  3235. #line 910 "pmtexb2.f"
  3236.     }
  3237. #line 911 "pmtexb2.f"
  3238.     istop[ib - 1] = ntot;
  3239. /* Now we flow out of this if and into block-building */
  3240. #line 913 "pmtexb2.f"
  3241.     } else if (nspace[ib - 1] == 0) {
  3242. /* nspace hasn't been set yet, so */
  3243. /* and tentatively set: */
  3244. #line 916 "pmtexb2.f"
  3245.     nspace[ib - 1] = all_1.list[(in << 2) - 1];
  3246. #line 917 "pmtexb2.f"
  3247.     if (nspace[ib - 1] == 0) {
  3248. #line 918 "pmtexb2.f"
  3249.         ++in;
  3250. #line 919 "pmtexb2.f"
  3251.     } else {
  3252. #line 920 "pmtexb2.f"
  3253.         istop[ib - 1] = in;
  3254. #line 921 "pmtexb2.f"
  3255.     }
  3256. #line 922 "pmtexb2.f"
  3257.     goto L9;
  3258. #line 923 "pmtexb2.f"
  3259.     } else if (all_1.list[(in + 1 << 2) - 1] == 0) {
  3260. /* This is not the last note in the group, so */
  3261. #line 925 "pmtexb2.f"
  3262.     ++in;
  3263. #line 926 "pmtexb2.f"
  3264.     goto L9;
  3265. #line 927 "pmtexb2.f"
  3266.     } else if (all_1.list[(in + 1 << 2) - 1] == nspace[ib - 1]) {
  3267. /* Keep spacing the same, update tentative stop point */
  3268. #line 929 "pmtexb2.f"
  3269.     ++in;
  3270. #line 930 "pmtexb2.f"
  3271.     istop[ib - 1] = in;
  3272. #line 931 "pmtexb2.f"
  3273.     goto L9;
  3274. #line 932 "pmtexb2.f"
  3275.     }
  3276.  
  3277. /* At this point istart and istop are good, so on to next block */
  3278.  
  3279. #line 936 "pmtexb2.f"
  3280.     itstart[ib - 1] = all_1.list[(istart[ib - 1] << 2) - 2];
  3281. #line 937 "pmtexb2.f"
  3282.     i__1 = nspace[ib - 1] / 2;
  3283. #line 937 "pmtexb2.f"
  3284.     nindex[ib - 1] = log2_(&i__1) + 1;
  3285. #line 938 "pmtexb2.f"
  3286.     if (istop[ib - 1] == ntot) {
  3287. #line 938 "pmtexb2.f"
  3288.     goto L15;
  3289. #line 938 "pmtexb2.f"
  3290.     }
  3291. #line 939 "pmtexb2.f"
  3292.     ++ib;
  3293. #line 940 "pmtexb2.f"
  3294.     istart[ib - 1] = istop[ib - 2] + 1;
  3295. #line 941 "pmtexb2.f"
  3296.     in = istart[ib - 1];
  3297.  
  3298. /* Set tentative block space for new block */
  3299.  
  3300. #line 945 "pmtexb2.f"
  3301.     nspace[ib - 1] = all_1.list[(in << 2) - 1];
  3302. #line 946 "pmtexb2.f"
  3303.     istop[ib - 1] = in;
  3304. #line 947 "pmtexb2.f"
  3305.     goto L9;
  3306. #line 948 "pmtexb2.f"
  3307. L15:
  3308. #line 949 "pmtexb2.f"
  3309.     nb = ib;
  3310.  
  3311. /*  Now add to list special codes for accidental skips.  This is a loop on
  3312.  */
  3313. /* in up to ntot, but ntot increases when a skip is added, so loop manuall
  3314. y*/
  3315. /*  Must bypass this loop if all there are are whole rests. */
  3316. #line 954 "pmtexb2.f"
  3317.     if (ntot == all_1.nv) {
  3318. #line 954 "pmtexb2.f"
  3319.     goto L40;
  3320. #line 954 "pmtexb2.f"
  3321.     }
  3322. #line 955 "pmtexb2.f"
  3323.     in = 2;
  3324. #line 956 "pmtexb2.f"
  3325. L39:
  3326. #line 957 "pmtexb2.f"
  3327.     jv = all_1.list[(in << 2) - 4];
  3328. #line 958 "pmtexb2.f"
  3329.     ip = all_1.list[(in << 2) - 3];
  3330. #line 959 "pmtexb2.f"
  3331.     itim = all_1.list[(in << 2) - 2];
  3332. #line 960 "pmtexb2.f"
  3333.     if ((all_1.acc[jv + ip * 5 - 6] == 'f' || all_1.acc[jv + ip * 5 - 6] == 
  3334. #line 960 "pmtexb2.f"
  3335.         'n' || all_1.acc[jv + ip * 5 - 6] == 's') && all_1.nodur[jv + (ip 
  3336. #line 960 "pmtexb2.f"
  3337.         - 1) * 5 - 6] <= 6 && ip >= 2 && all_1.acc[jv + (ip - 1) * 5 - 6] 
  3338. #line 960 "pmtexb2.f"
  3339.         != 'a') {
  3340.  
  3341. /*  Need accidental skip. Find block # for list position "in". */
  3342.  
  3343. #line 966 "pmtexb2.f"
  3344.     i__1 = nb;
  3345. #line 966 "pmtexb2.f"
  3346.     for (ib = 1; ib <= i__1; ++ib) {
  3347. #line 967 "pmtexb2.f"
  3348.         if (istop[ib - 1] >= in) {
  3349. #line 967 "pmtexb2.f"
  3350.         goto L46;
  3351. #line 967 "pmtexb2.f"
  3352.         }
  3353. #line 968 "pmtexb2.f"
  3354. /* L45: */
  3355. #line 968 "pmtexb2.f"
  3356.     }
  3357. #line 969 "pmtexb2.f"
  3358.     s_wsle(&io___132);
  3359. #line 969 "pmtexb2.f"
  3360.     do_lio(&c__9, &c__1, "Got lost looking for ib!!", 25L);
  3361. #line 969 "pmtexb2.f"
  3362.     e_wsle();
  3363. #line 970 "pmtexb2.f"
  3364. L46:
  3365. #line 971 "pmtexb2.f"
  3366.     for (all_1.iv = all_1.nv; all_1.iv >= 1; --all_1.iv) {
  3367. #line 972 "pmtexb2.f"
  3368.         if (all_1.iv == jv) {
  3369. #line 973 "pmtexb2.f"
  3370.         iip = ip;
  3371. #line 974 "pmtexb2.f"
  3372.         iin = in;
  3373. #line 975 "pmtexb2.f"
  3374.         iitim = itim;
  3375. #line 976 "pmtexb2.f"
  3376.         } else if (all_1.nn[all_1.iv - 1] == 1) {
  3377. #line 977 "pmtexb2.f"
  3378.         goto L42;
  3379. #line 978 "pmtexb2.f"
  3380.         } else {
  3381.  
  3382. /*  Find ip# for this voice at this itim !!! */
  3383.  
  3384. #line 982 "pmtexb2.f"
  3385.         i__1 = ntot;
  3386. #line 982 "pmtexb2.f"
  3387.         for (iin = 2; iin <= i__1; ++iin) {
  3388. #line 983 "pmtexb2.f"
  3389.             if (all_1.list[(iin << 2) - 4] == all_1.iv && all_1.list[(
  3390. #line 983 "pmtexb2.f"
  3391.                 iin << 2) - 2] >= itim) {
  3392.  
  3393. /*  Check if in the same block as the offending accide
  3394. ntal */
  3395.  
  3396. #line 987 "pmtexb2.f"
  3397.             if (istop[ib - 1] >= iin) {
  3398. #line 987 "pmtexb2.f"
  3399.                 goto L44;
  3400. #line 987 "pmtexb2.f"
  3401.             }
  3402.  
  3403. /*  Note is in next block, so no skip needed. */
  3404.  
  3405. #line 991 "pmtexb2.f"
  3406.             goto L42;
  3407. #line 992 "pmtexb2.f"
  3408.             }
  3409. #line 993 "pmtexb2.f"
  3410. /* L43: */
  3411. #line 993 "pmtexb2.f"
  3412.         }
  3413.  
  3414. /* No skip needed, since no new notes after the one in questio
  3415. n, so */
  3416.  
  3417. #line 997 "pmtexb2.f"
  3418.         goto L42;
  3419. #line 998 "pmtexb2.f"
  3420. L44:
  3421. #line 998 "pmtexb2.f"
  3422.         iip = all_1.list[(iin << 2) - 3];
  3423. #line 999 "pmtexb2.f"
  3424.         iitim = all_1.list[(iin << 2) - 2];
  3425. #line 1000 "pmtexb2.f"
  3426.         }
  3427. #line 1001 "pmtexb2.f"
  3428.         add2list_(&iin, &iip, &iitim, &c__0, "a", (logical*)&c__1, &ntot, 
  3429. #line 1001 "pmtexb2.f"
  3430.             istart, istop, &nb, 1L);
  3431. #line 1003 "pmtexb2.f"
  3432. L42:
  3433. #line 1003 "pmtexb2.f"
  3434.         ;
  3435. #line 1003 "pmtexb2.f"
  3436.     }
  3437. #line 1004 "pmtexb2.f"
  3438.     }
  3439. #line 1005 "pmtexb2.f"
  3440.     if (in == ntot) {
  3441. #line 1005 "pmtexb2.f"
  3442.     goto L40;
  3443. #line 1005 "pmtexb2.f"
  3444.     }
  3445. #line 1006 "pmtexb2.f"
  3446.     ++in;
  3447. #line 1007 "pmtexb2.f"
  3448.     goto L39;
  3449. #line 1008 "pmtexb2.f"
  3450. L40:
  3451.  
  3452. /*  Invert the list of places, to make it easier to analyze a voice */
  3453.  
  3454. #line 1012 "pmtexb2.f"
  3455.     i__1 = ntot;
  3456. #line 1012 "pmtexb2.f"
  3457.     for (in = 1; in <= i__1; ++in) {
  3458. #line 1013 "pmtexb2.f"
  3459.     all_1.ipl[all_1.list[(in << 2) - 4] + all_1.list[(in << 2) - 3] * 5 - 
  3460. #line 1013 "pmtexb2.f"
  3461.         6] = in;
  3462. #line 1014 "pmtexb2.f"
  3463. /* L13: */
  3464. #line 1014 "pmtexb2.f"
  3465.     }
  3466.  
  3467. /* Now before writing output, analyze for beams */
  3468.  
  3469. #line 1018 "pmtexb2.f"
  3470.     i__1 = all_1.nv;
  3471. #line 1018 "pmtexb2.f"
  3472.     for (all_1.iv = 1; all_1.iv <= i__1; ++all_1.iv) {
  3473. #line 1019 "pmtexb2.f"
  3474.     numbms[all_1.iv - 1] = 0;
  3475. #line 1020 "pmtexb2.f"
  3476.     i__2 = all_1.nn[all_1.iv - 1];
  3477. #line 1020 "pmtexb2.f"
  3478.     for (ip = 1; ip <= i__2; ++ip) {
  3479. #line 1021 "pmtexb2.f"
  3480.         nbold = numbms[all_1.iv - 1];
  3481. /* ### For each ip beyond the end of the last beam, see if a quart
  3482. er note */
  3483. /* ### starting here is filled up with notes: */
  3484. #line 1024 "pmtexb2.f"
  3485.         if (numbms[all_1.iv - 1] == 0 || ip > all_1.ibm2[all_1.iv + 
  3486. #line 1024 "pmtexb2.f"
  3487.             numbms[all_1.iv - 1] * 5 - 6]) {
  3488. #line 1025 "pmtexb2.f"
  3489.         fillbeat_(&combeam_1.lenbeam, &ip, numbms);
  3490. /* ### If no new quarter-note beam starts here, check for eigh
  3491. th-note beam */
  3492. #line 1027 "pmtexb2.f"
  3493.         if (numbms[all_1.iv - 1] == nbold && all_1.acc[all_1.iv + ip *
  3494. #line 1027 "pmtexb2.f"
  3495.              5 - 6] != 'a' && combeam_1.lenbeam % 24 == 0) {
  3496. /* ### Starting time */
  3497. #line 1030 "pmtexb2.f"
  3498.             ittemp = all_1.list[(all_1.ipl[all_1.iv + ip * 5 - 6] << 
  3499. #line 1030 "pmtexb2.f"
  3500.                 2) - 2];
  3501. #line 1031 "pmtexb2.f"
  3502.             i__3 = all_1.nn[all_1.iv - 1];
  3503. #line 1031 "pmtexb2.f"
  3504.             for (iip = ip; iip <= i__3; ++iip) {
  3505. #line 1032 "pmtexb2.f"
  3506.             i__4 = combeam_1.lenbeam / 2;
  3507. #line 1032 "pmtexb2.f"
  3508.             fillbeat_(&i__4, &iip, numbms);
  3509. #line 1033 "pmtexb2.f"
  3510.             itendnow = all_1.list[(all_1.ipl[all_1.iv + iip * 5 - 
  3511. #line 1033 "pmtexb2.f"
  3512.                 6] << 2) - 2] + all_1.nodur[all_1.iv + iip * 
  3513. #line 1033 "pmtexb2.f"
  3514.                 5 - 6];
  3515. #line 1034 "pmtexb2.f"
  3516.             if (ittemp + combeam_1.lenbeam <= itendnow || 
  3517. #line 1034 "pmtexb2.f"
  3518.                 itendnow % combeam_1.lenbeam == 0) {
  3519. #line 1034 "pmtexb2.f"
  3520.                 goto L21;
  3521. #line 1034 "pmtexb2.f"
  3522.             }
  3523. #line 1036 "pmtexb2.f"
  3524. /* L22: */
  3525. #line 1036 "pmtexb2.f"
  3526.             }
  3527. #line 1037 "pmtexb2.f"
  3528.         }
  3529. #line 1038 "pmtexb2.f"
  3530.         }
  3531. #line 1039 "pmtexb2.f"
  3532. L21:
  3533. #line 1039 "pmtexb2.f"
  3534.         ;
  3535. #line 1039 "pmtexb2.f"
  3536.     }
  3537. #line 1040 "pmtexb2.f"
  3538. /* L20: */
  3539. #line 1040 "pmtexb2.f"
  3540.     }
  3541.  
  3542. /*  Finally ready to write output */
  3543.  
  3544. #line 1044 "pmtexb2.f"
  3545.     i__1 = all_1.nv;
  3546. #line 1044 "pmtexb2.f"
  3547.     for (all_1.iv = 1; all_1.iv <= i__1; ++all_1.iv) {
  3548. #line 1045 "pmtexb2.f"
  3549.     all_1.ibmcnt[all_1.iv - 1] = 1;
  3550. #line 1046 "pmtexb2.f"
  3551.     all_1.beamon[all_1.iv - 1] = FALSE_;
  3552. #line 1047 "pmtexb2.f"
  3553.     nornb[all_1.iv - 1] = 0;
  3554. #line 1048 "pmtexb2.f"
  3555. /* L25: */
  3556. #line 1048 "pmtexb2.f"
  3557.     }
  3558. #line 1049 "pmtexb2.f"
  3559.     bspend = FALSE_;
  3560. #line 1050 "pmtexb2.f"
  3561.     i__1 = nb;
  3562. #line 1050 "pmtexb2.f"
  3563.     for (ib = 1; ib <= i__1; ++ib) {
  3564. /* Writing concatenation */
  3565. #line 1051 "pmtexb2.f"
  3566.     i__5[0] = 1, a__1[0] = all_1.s;
  3567. #line 1051 "pmtexb2.f"
  3568.     i__5[1] = 5, a__1[1] = nstart + (nindex[ib - 1] - 1) * 5;
  3569. #line 1051 "pmtexb2.f"
  3570.     s_cat(sout, a__1, i__5, &c__2, 80L);
  3571. #line 1052 "pmtexb2.f"
  3572.     lsout = 6;
  3573. #line 1053 "pmtexb2.f"
  3574.     i__2 = all_1.nv;
  3575. #line 1053 "pmtexb2.f"
  3576.     for (all_1.iv = 1; all_1.iv <= i__2; ++all_1.iv) {
  3577. #line 1054 "pmtexb2.f"
  3578.         if (all_1.iv > 1) {
  3579. #line 1054 "pmtexb2.f"
  3580.         addstr_(all_1.sepsym, &c__1, sout, &lsout, 1L, 80L);
  3581. #line 1054 "pmtexb2.f"
  3582.         }
  3583. #line 1055 "pmtexb2.f"
  3584.         itnow = itstart[ib - 1];
  3585. #line 1056 "pmtexb2.f"
  3586.         i__3 = istop[ib - 1];
  3587. #line 1056 "pmtexb2.f"
  3588.         for (all_1.jn = istart[ib - 1]; all_1.jn <= i__3; ++all_1.jn) {
  3589. #line 1057 "pmtexb2.f"
  3590.         if (all_1.list[(all_1.jn << 2) - 4] != all_1.iv) {
  3591. #line 1057 "pmtexb2.f"
  3592.             goto L10;
  3593. #line 1057 "pmtexb2.f"
  3594.         }
  3595. #line 1058 "pmtexb2.f"
  3596.         ip = all_1.list[(all_1.jn << 2) - 3];
  3597. #line 1059 "pmtexb2.f"
  3598. L12:
  3599. #line 1059 "pmtexb2.f"
  3600.         if (all_1.list[(all_1.jn << 2) - 2] > itnow) {
  3601. /* Need skips */
  3602. /* Writing concatenation */
  3603. #line 1061 "pmtexb2.f"
  3604.             i__5[0] = 1, a__1[0] = all_1.s;
  3605. #line 1061 "pmtexb2.f"
  3606.             i__5[1] = 2, a__1[1] = "sk";
  3607. #line 1061 "pmtexb2.f"
  3608.             s_cat(ch__1, a__1, i__5, &c__2, 3L);
  3609. #line 1061 "pmtexb2.f"
  3610.             addstr_(ch__1, &c__3, sout, &lsout, 3L, 80L);
  3611. #line 1062 "pmtexb2.f"
  3612.             itnow += nspace[ib - 1];
  3613. #line 1063 "pmtexb2.f"
  3614.             goto L12;
  3615. #line 1064 "pmtexb2.f"
  3616.         }
  3617.  
  3618. /*  Skip space for accidentals */
  3619.  
  3620. #line 1068 "pmtexb2.f"
  3621.         if (all_1.acc[all_1.iv + ip * 5 - 6] == 'a') {
  3622. /* Writing concatenation */
  3623. #line 1069 "pmtexb2.f"
  3624.             i__5[0] = 1, a__1[0] = all_1.s;
  3625. #line 1069 "pmtexb2.f"
  3626.             i__5[1] = 3, a__1[1] = "ask";
  3627. #line 1069 "pmtexb2.f"
  3628.             s_cat(ch__2, a__1, i__5, &c__2, 4L);
  3629. #line 1069 "pmtexb2.f"
  3630.             addstr_(ch__2, &c__4, sout, &lsout, 4L, 80L);
  3631. #line 1070 "pmtexb2.f"
  3632.             goto L10;
  3633. #line 1071 "pmtexb2.f"
  3634.         }
  3635.  
  3636. /*  Accidentals */
  3637.  
  3638. #line 1075 "pmtexb2.f"
  3639.         if (all_1.acc[all_1.iv + ip * 5 - 6] == 's') {
  3640. /* Writing concatenation */
  3641. #line 1076 "pmtexb2.f"
  3642.             i__6[0] = 1, a__2[0] = all_1.s;
  3643. #line 1076 "pmtexb2.f"
  3644.             i__6[1] = 4, a__2[1] = "xsh ";
  3645. #line 1076 "pmtexb2.f"
  3646.             notef_(ch__4, 1L, &all_1.nolev[all_1.iv + ip * 5 - 6]);
  3647. #line 1076 "pmtexb2.f"
  3648.             i__6[2] = 1, a__2[2] = ch__4;
  3649. #line 1076 "pmtexb2.f"
  3650.             s_cat(ch__3, a__2, i__6, &c__3, 6L);
  3651. #line 1076 "pmtexb2.f"
  3652.             addstr_(ch__3, &c__6, sout, &lsout, 6L, 80L);
  3653. #line 1078 "pmtexb2.f"
  3654.         } else if (all_1.acc[all_1.iv + ip * 5 - 6] == 'f') {
  3655. /* Writing concatenation */
  3656. #line 1079 "pmtexb2.f"
  3657.             i__6[0] = 1, a__2[0] = all_1.s;
  3658. #line 1079 "pmtexb2.f"
  3659.             i__6[1] = 4, a__2[1] = "xfl ";
  3660. #line 1079 "pmtexb2.f"
  3661.             notef_(ch__4, 1L, &all_1.nolev[all_1.iv + ip * 5 - 6]);
  3662. #line 1079 "pmtexb2.f"
  3663.             i__6[2] = 1, a__2[2] = ch__4;
  3664. #line 1079 "pmtexb2.f"
  3665.             s_cat(ch__3, a__2, i__6, &c__3, 6L);
  3666. #line 1079 "pmtexb2.f"
  3667.             addstr_(ch__3, &c__6, sout, &lsout, 6L, 80L);
  3668. #line 1081 "pmtexb2.f"
  3669.         } else if (all_1.acc[all_1.iv + ip * 5 - 6] == 'n') {
  3670. /* Writing concatenation */
  3671. #line 1082 "pmtexb2.f"
  3672.             i__6[0] = 1, a__2[0] = all_1.s;
  3673. #line 1082 "pmtexb2.f"
  3674.             i__6[1] = 4, a__2[1] = "xna ";
  3675. #line 1082 "pmtexb2.f"
  3676.             notef_(ch__4, 1L, &all_1.nolev[all_1.iv + ip * 5 - 6]);
  3677. #line 1082 "pmtexb2.f"
  3678.             i__6[2] = 1, a__2[2] = ch__4;
  3679. #line 1082 "pmtexb2.f"
  3680.             s_cat(ch__3, a__2, i__6, &c__3, 6L);
  3681. #line 1082 "pmtexb2.f"
  3682.             addstr_(ch__3, &c__6, sout, &lsout, 6L, 80L);
  3683. #line 1084 "pmtexb2.f"
  3684.         }
  3685. /* ####  Check for figure */
  3686. #line 1086 "pmtexb2.f"
  3687.         if (all_1.iv == 1 && s_cmp(all_1.fig + (ip - 1) * 6, "x", 6L, 
  3688. #line 1086 "pmtexb2.f"
  3689.             1L) != 0) {
  3690. #line 1086 "pmtexb2.f"
  3691.             putfig_(all_1.fig + (ip - 1) * 6, sout, &lsout, 6L, 80L);
  3692. #line 1086 "pmtexb2.f"
  3693.         }
  3694. /* ####  See if a beam starts here */
  3695. #line 1089 "pmtexb2.f"
  3696.         if (numbms[all_1.iv - 1] > 0 && all_1.ibmcnt[all_1.iv - 1] <= 
  3697. #line 1089 "pmtexb2.f"
  3698.             numbms[all_1.iv - 1] && all_1.ibm1[all_1.iv + 
  3699. #line 1089 "pmtexb2.f"
  3700.             all_1.ibmcnt[all_1.iv - 1] * 5 - 6] == ip) {
  3701. #line 1091 "pmtexb2.f"
  3702.             beamstrt_(mynotex, &lnote, nornb, ihornb, 25L);
  3703. #line 1092 "pmtexb2.f"
  3704.             addstr_(mynotex, &lnote, sout, &lsout, 25L, 80L);
  3705. #line 1093 "pmtexb2.f"
  3706.             all_1.beamon[all_1.iv - 1] = TRUE_;
  3707. #line 1094 "pmtexb2.f"
  3708.             bspend = TRUE_;
  3709. #line 1095 "pmtexb2.f"
  3710.         }
  3711. /* #### Check for ornaments */
  3712. #line 1097 "pmtexb2.f"
  3713.         if (all_1.orn[all_1.iv + ip * 5 - 6] != 'x') {
  3714. #line 1098 "pmtexb2.f"
  3715.             if (nornb[all_1.iv - 1] != 0) {
  3716. /* #### In a beam, height has already been calculated 
  3717. */
  3718. #line 1100 "pmtexb2.f"
  3719.             ihorn = ihornb[all_1.iv + nornb[all_1.iv - 1] * 5 - 6]
  3720. #line 1100 "pmtexb2.f"
  3721.                 ;
  3722. #line 1101 "pmtexb2.f"
  3723.             ++nornb[all_1.iv - 1];
  3724. #line 1102 "pmtexb2.f"
  3725.             } else if (all_1.nolev[all_1.iv + ip * 5 - 6] >= 
  3726. #line 1102 "pmtexb2.f"
  3727.                 all_1.ncmid[all_1.iv - 1]) {
  3728. /* #### Separate note, lower stem */
  3729. /* Computing MAX */
  3730. #line 1104 "pmtexb2.f"
  3731.             i__4 = all_1.ncmid[all_1.iv - 1] + 5, i__7 = 
  3732. #line 1104 "pmtexb2.f"
  3733.                 all_1.nolev[all_1.iv + ip * 5 - 6] + 2;
  3734. #line 1104 "pmtexb2.f"
  3735.             ihorn = max(i__4,i__7);
  3736. #line 1105 "pmtexb2.f"
  3737.             } else {
  3738. /* #### Upper beam, must clear the stem */
  3739. /* Computing MAX */
  3740. #line 1107 "pmtexb2.f"
  3741.             r__1 = all_1.stemlen - .5f;
  3742. #line 1107 "pmtexb2.f"
  3743.             i__4 = all_1.ncmid[all_1.iv - 1] + 5, i__7 = 
  3744. #line 1107 "pmtexb2.f"
  3745.                 all_1.nolev[all_1.iv + ip * 5 - 6] + 2 + ni_(&
  3746. #line 1107 "pmtexb2.f"
  3747.                 r__1);
  3748. #line 1107 "pmtexb2.f"
  3749.             ihorn = max(i__4,i__7);
  3750. #line 1108 "pmtexb2.f"
  3751.             }
  3752. #line 1109 "pmtexb2.f"
  3753.             if (all_1.orn[all_1.iv + ip * 5 - 6] == 't') {
  3754. /* Writing concatenation */
  3755. #line 1110 "pmtexb2.f"
  3756.             i__5[0] = 1, a__1[0] = all_1.s;
  3757. #line 1110 "pmtexb2.f"
  3758.             i__5[1] = 6, a__1[1] = "pince ";
  3759. #line 1110 "pmtexb2.f"
  3760.             s_cat(mynotex, a__1, i__5, &c__2, 25L);
  3761. #line 1111 "pmtexb2.f"
  3762.             lnote = 8;
  3763. #line 1112 "pmtexb2.f"
  3764.             } else if (all_1.orn[all_1.iv + ip * 5 - 6] == 'm') {
  3765. /* Writing concatenation */
  3766. #line 1113 "pmtexb2.f"
  3767.             i__5[0] = 1, a__1[0] = all_1.s;
  3768. #line 1113 "pmtexb2.f"
  3769.             i__5[1] = 8, a__1[1] = "mordant ";
  3770. #line 1113 "pmtexb2.f"
  3771.             s_cat(mynotex, a__1, i__5, &c__2, 25L);
  3772. #line 1114 "pmtexb2.f"
  3773.             lnote = 10;
  3774. #line 1115 "pmtexb2.f"
  3775.             } else if (all_1.orn[all_1.iv + ip * 5 - 6] == 's') {
  3776. /* Writing concatenation */
  3777. #line 1116 "pmtexb2.f"
  3778.             i__5[0] = 1, a__1[0] = all_1.s;
  3779. #line 1116 "pmtexb2.f"
  3780.             i__5[1] = 4, a__1[1] = "mtr ";
  3781. #line 1116 "pmtexb2.f"
  3782.             s_cat(mynotex, a__1, i__5, &c__2, 25L);
  3783. #line 1117 "pmtexb2.f"
  3784.             lnote = 6;
  3785. #line 1118 "pmtexb2.f"
  3786.             }
  3787. /* Writing concatenation */
  3788. #line 1119 "pmtexb2.f"
  3789.             i__5[0] = lnote - 1, a__1[0] = mynotex;
  3790. #line 1119 "pmtexb2.f"
  3791.             notef_(ch__4, 1L, &ihorn);
  3792. #line 1119 "pmtexb2.f"
  3793.             i__5[1] = 1, a__1[1] = ch__4;
  3794. #line 1119 "pmtexb2.f"
  3795.             s_cat(ch__5, a__1, i__5, &c__2, 26L);
  3796. #line 1119 "pmtexb2.f"
  3797.             addstr_(ch__5, &lnote, sout, &lsout, lnote, 80L);
  3798. #line 1121 "pmtexb2.f"
  3799.         }
  3800. /* ####  Is a beam start pending? */
  3801. #line 1123 "pmtexb2.f"
  3802.         if (bspend) {
  3803. #line 1124 "pmtexb2.f"
  3804.             beamn1_(mynotex, &lnote, 25L);
  3805. #line 1125 "pmtexb2.f"
  3806.             bspend = FALSE_;
  3807. /* ####  Is a beam ending? */
  3808. #line 1127 "pmtexb2.f"
  3809.         } else if (numbms[all_1.iv - 1] > 0 && all_1.ibmcnt[all_1.iv 
  3810. #line 1127 "pmtexb2.f"
  3811.             - 1] <= numbms[all_1.iv - 1] && all_1.ibm2[all_1.iv + 
  3812. #line 1127 "pmtexb2.f"
  3813.             all_1.ibmcnt[all_1.iv - 1] * 5 - 6] == ip) {
  3814. #line 1129 "pmtexb2.f"
  3815.             beamend_(mynotex, &lnote, 25L);
  3816. #line 1130 "pmtexb2.f"
  3817.             nornb[all_1.iv - 1] = 0;
  3818. #line 1131 "pmtexb2.f"
  3819.             ++all_1.ibmcnt[all_1.iv - 1];
  3820. #line 1132 "pmtexb2.f"
  3821.             all_1.beamon[all_1.iv - 1] = FALSE_;
  3822. /* ####  Or if we're in the middle of a beam */
  3823. #line 1134 "pmtexb2.f"
  3824.         } else if (numbms[all_1.iv - 1] > 0 && all_1.beamon[all_1.iv 
  3825. #line 1134 "pmtexb2.f"
  3826.             - 1]) {
  3827. #line 1135 "pmtexb2.f"
  3828.             beamid_(mynotex, &lnote, 25L);
  3829. #line 1136 "pmtexb2.f"
  3830.         } else {
  3831. /* ####  Write a separate note */
  3832. #line 1138 "pmtexb2.f"
  3833.             notex_(mynotex, &lnote, 25L);
  3834. #line 1139 "pmtexb2.f"
  3835.         }
  3836. #line 1140 "pmtexb2.f"
  3837.         addstr_(mynotex, &lnote, sout, &lsout, 25L, 80L);
  3838. #line 1141 "pmtexb2.f"
  3839.         itnow += nspace[ib - 1];
  3840. #line 1142 "pmtexb2.f"
  3841. L10:
  3842. #line 1142 "pmtexb2.f"
  3843.         ;
  3844. #line 1142 "pmtexb2.f"
  3845.         }
  3846. #line 1143 "pmtexb2.f"
  3847. /* L11: */
  3848. #line 1143 "pmtexb2.f"
  3849.     }
  3850. /* Writing concatenation */
  3851. #line 1144 "pmtexb2.f"
  3852.     i__5[0] = 1, a__1[0] = all_1.s;
  3853. #line 1144 "pmtexb2.f"
  3854.     i__5[1] = 6, a__1[1] = "enotes";
  3855. #line 1144 "pmtexb2.f"
  3856.     s_cat(ch__6, a__1, i__5, &c__2, 7L);
  3857. #line 1144 "pmtexb2.f"
  3858.     addstr_(ch__6, &c__7, sout, &lsout, 7L, 80L);
  3859. #line 1145 "pmtexb2.f"
  3860.     if (lsout > 0) {
  3861. #line 1145 "pmtexb2.f"
  3862.         s_wsfe(&io___148);
  3863. /* Writing concatenation */
  3864. #line 1145 "pmtexb2.f"
  3865.         i__5[0] = lsout, a__1[0] = sout;
  3866. #line 1145 "pmtexb2.f"
  3867.         i__5[1] = 1, a__1[1] = "%";
  3868. #line 1145 "pmtexb2.f"
  3869.         s_cat(ch__7, a__1, i__5, &c__2, 81L);
  3870. #line 1145 "pmtexb2.f"
  3871.         do_fio(&c__1, ch__7, lsout + 1);
  3872. #line 1145 "pmtexb2.f"
  3873.         e_wsfe();
  3874. #line 1145 "pmtexb2.f"
  3875.     }
  3876. #line 1146 "pmtexb2.f"
  3877. /* L16: */
  3878. #line 1146 "pmtexb2.f"
  3879.     }
  3880. #line 1147 "pmtexb2.f"
  3881.     return 0;
  3882. } /* makeabar_ */
  3883.  
  3884. /* Subroutine */ int add2list_(integer *infr, integer *newip, integer *
  3885.     newstrt, integer *newdur, char *newacc, logical *newrest, integer *
  3886.     ntot, integer *istart, integer *istop, integer *nb, ftnlen newacc_len)
  3887. {
  3888.     /* System generated locals */
  3889.     integer i__1;
  3890.  
  3891.     /* Builtin functions */
  3892.     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
  3893.  
  3894.     /* Local variables */
  3895.     static integer iibar, ib, il, in, ip;
  3896.  
  3897.  
  3898. /* This inserts into the list a new "note" at location infr.  Inputs vars 
  3899. are*/
  3900. /*     (iv) = voice # (in common) */
  3901. /*     newip = position in voice, from beginning of bar */
  3902. /*     newstrt = starting time of new "note" */
  3903. /*     newdur =  duration */
  3904. /*     newacc = accidental value */
  3905. /*     newrest = rest value */
  3906.  
  3907. /* ccccccccccc */
  3908. /* c */
  3909. /* c  pmtex.inc */
  3910. /* c */
  3911. /* ccccccccccc */
  3912.  
  3913. /*  Move everything in the list to the right by one spot, and adjust ip */
  3914. /*    for notes in affected voice. */
  3915.  
  3916. #line 1168 "pmtexb2.f"
  3917.     /* Parameter adjustments */
  3918. #line 1168 "pmtexb2.f"
  3919.     --istop;
  3920. #line 1168 "pmtexb2.f"
  3921.     --istart;
  3922. #line 1168 "pmtexb2.f"
  3923.  
  3924. #line 1168 "pmtexb2.f"
  3925.     /* Function Body */
  3926. #line 1168 "pmtexb2.f"
  3927.     i__1 = *infr;
  3928. #line 1168 "pmtexb2.f"
  3929.     for (in = *ntot; in >= i__1; --in) {
  3930. #line 1169 "pmtexb2.f"
  3931.     if (all_1.list[(in << 2) - 4] == all_1.iv) {
  3932. #line 1169 "pmtexb2.f"
  3933.         ++all_1.list[(in << 2) - 3];
  3934. #line 1169 "pmtexb2.f"
  3935.     }
  3936. #line 1170 "pmtexb2.f"
  3937.     for (il = 1; il <= 4; ++il) {
  3938. #line 1171 "pmtexb2.f"
  3939.         all_1.list[il + (in + 1 << 2) - 5] = all_1.list[il + (in << 2) - 
  3940. #line 1171 "pmtexb2.f"
  3941.             5];
  3942. #line 1172 "pmtexb2.f"
  3943. /* L35: */
  3944. #line 1172 "pmtexb2.f"
  3945.     }
  3946. #line 1173 "pmtexb2.f"
  3947. /* L34: */
  3948. #line 1173 "pmtexb2.f"
  3949.     }
  3950.  
  3951. /*  Move everything in nodur,rest,acc,nolev to the right by one */
  3952.  
  3953. #line 1177 "pmtexb2.f"
  3954.     i__1 = *newip;
  3955. #line 1177 "pmtexb2.f"
  3956.     for (ip = all_1.nnl[all_1.iv - 1]; ip >= i__1; --ip) {
  3957. #line 1178 "pmtexb2.f"
  3958.     all_1.nodur[all_1.iv + (ip + 1) * 5 - 6] = all_1.nodur[all_1.iv + ip *
  3959. #line 1178 "pmtexb2.f"
  3960.          5 - 6];
  3961. #line 1179 "pmtexb2.f"
  3962.     all_1.nolev[all_1.iv + (ip + 1) * 5 - 6] = all_1.nolev[all_1.iv + ip *
  3963. #line 1179 "pmtexb2.f"
  3964.          5 - 6];
  3965. #line 1180 "pmtexb2.f"
  3966.     all_1.acc[all_1.iv + (ip + 1) * 5 - 6] = all_1.acc[all_1.iv + ip * 5 
  3967. #line 1180 "pmtexb2.f"
  3968.         - 6];
  3969. #line 1181 "pmtexb2.f"
  3970.     all_1.orn[all_1.iv + (ip + 1) * 5 - 6] = all_1.orn[all_1.iv + ip * 5 
  3971. #line 1181 "pmtexb2.f"
  3972.         - 6];
  3973. #line 1182 "pmtexb2.f"
  3974.     all_1.rest[all_1.iv + (ip + 1) * 5 - 6] = all_1.rest[all_1.iv + ip * 
  3975. #line 1182 "pmtexb2.f"
  3976.         5 - 6];
  3977. #line 1183 "pmtexb2.f"
  3978.     if (all_1.iv == 1) {
  3979. #line 1183 "pmtexb2.f"
  3980.         s_copy(all_1.fig + ip * 6, all_1.fig + (ip - 1) * 6, 6L, 6L);
  3981. #line 1183 "pmtexb2.f"
  3982.     }
  3983. #line 1184 "pmtexb2.f"
  3984. /* L36: */
  3985. #line 1184 "pmtexb2.f"
  3986.     }
  3987. #line 1185 "pmtexb2.f"
  3988.     ++all_1.nnl[all_1.iv - 1];
  3989. #line 1186 "pmtexb2.f"
  3990.     i__1 = all_1.nbars;
  3991. #line 1186 "pmtexb2.f"
  3992.     for (iibar = all_1.ibar; iibar <= i__1; ++iibar) {
  3993. #line 1187 "pmtexb2.f"
  3994.     ++all_1.nib[all_1.iv + iibar * 5 - 6];
  3995. #line 1188 "pmtexb2.f"
  3996. /* L37: */
  3997. #line 1188 "pmtexb2.f"
  3998.     }
  3999. #line 1189 "pmtexb2.f"
  4000.     ++(*ntot);
  4001. #line 1190 "pmtexb2.f"
  4002.     ++all_1.nn[all_1.iv - 1];
  4003. #line 1191 "pmtexb2.f"
  4004.     all_1.nodur[all_1.iv + *newip * 5 - 6] = *newdur;
  4005. #line 1192 "pmtexb2.f"
  4006.     all_1.rest[all_1.iv + *newip * 5 - 6] = *newrest;
  4007. #line 1193 "pmtexb2.f"
  4008.     all_1.acc[all_1.iv + *newip * 5 - 6] = *newacc;
  4009. #line 1194 "pmtexb2.f"
  4010.     all_1.orn[all_1.iv + *newip * 5 - 6] = 'x';
  4011. #line 1195 "pmtexb2.f"
  4012.     if (all_1.iv == 1) {
  4013. #line 1195 "pmtexb2.f"
  4014.     s_copy(all_1.fig + (*newip - 1) * 6, "x", 6L, 1L);
  4015. #line 1195 "pmtexb2.f"
  4016.     }
  4017. #line 1196 "pmtexb2.f"
  4018.     all_1.list[(*infr << 2) - 4] = all_1.iv;
  4019. #line 1197 "pmtexb2.f"
  4020.     all_1.list[(*infr << 2) - 3] = *newip;
  4021. #line 1198 "pmtexb2.f"
  4022.     all_1.list[(*infr << 2) - 2] = *newstrt;
  4023. #line 1199 "pmtexb2.f"
  4024.     all_1.list[(*infr << 2) - 1] = all_1.list[(*infr + 1 << 2) - 2] - 
  4025. #line 1199 "pmtexb2.f"
  4026.         all_1.list[(*infr << 2) - 2];
  4027. #line 1200 "pmtexb2.f"
  4028.     all_1.list[(*infr - 1 << 2) - 1] = all_1.list[(*infr << 2) - 2] - 
  4029. #line 1200 "pmtexb2.f"
  4030.         all_1.list[(*infr - 1 << 2) - 2];
  4031.  
  4032. /* Check the note blocks */
  4033.  
  4034. #line 1204 "pmtexb2.f"
  4035.     i__1 = *nb;
  4036. #line 1204 "pmtexb2.f"
  4037.     for (ib = 1; ib <= i__1; ++ib) {
  4038. #line 1205 "pmtexb2.f"
  4039.     if (*infr <= istop[ib]) {
  4040. #line 1205 "pmtexb2.f"
  4041.         ++istop[ib];
  4042. #line 1205 "pmtexb2.f"
  4043.     }
  4044. #line 1206 "pmtexb2.f"
  4045.     if (*infr < istart[ib]) {
  4046. #line 1206 "pmtexb2.f"
  4047.         ++istart[ib];
  4048. #line 1206 "pmtexb2.f"
  4049.     }
  4050. #line 1207 "pmtexb2.f"
  4051. /* L38: */
  4052. #line 1207 "pmtexb2.f"
  4053.     }
  4054. #line 1208 "pmtexb2.f"
  4055.     return 0;
  4056. } /* add2list_ */
  4057.  
  4058. /* Subroutine */ int putfig_(char *fig, char *sout, integer *lsout, ftnlen 
  4059.     fig_len, ftnlen sout_len)
  4060. {
  4061.     /* System generated locals */
  4062.     address a__1[2], a__2[6];
  4063.     integer i__1[2], i__2[6], i__3;
  4064.     char ch__1[1], ch__2[23], ch__3[22], ch__4[21], ch__5[17], ch__6[12];
  4065.  
  4066.     /* Builtin functions */
  4067.     /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen), s_cat(char *,
  4068.          char **, integer *, integer *, ftnlen);
  4069.  
  4070.     /* Local variables */
  4071.     static char nofa[2];
  4072.     static integer tofa, lnof;
  4073.     static char s[1];
  4074.     static integer lnofa, ic;
  4075.     extern /* Subroutine */ int addstr_(char *, integer *, char *, integer *, 
  4076.         ftnlen, ftnlen);
  4077.     static char ch1[1], ch2[1], nof[2];
  4078.     extern doublereal ord_(char *, ftnlen);
  4079.     static integer tof;
  4080.  
  4081. /*  Platform-independent backslash */
  4082. #line 1217 "pmtexb2.f"
  4083.     *s = '\\';
  4084. #line 1218 "pmtexb2.f"
  4085.     ic = 1;
  4086. #line 1219 "pmtexb2.f"
  4087.     s_copy(nof, "0", 2L, 1L);
  4088. #line 1220 "pmtexb2.f"
  4089.     s_copy(nofa, "-1", 2L, 2L);
  4090.  
  4091. /*  Beginning of loop \/ \/ */
  4092.  
  4093. #line 1224 "pmtexb2.f"
  4094. L1:
  4095. #line 1224 "pmtexb2.f"
  4096.     *ch1 = fig[ic - 1];
  4097. #line 1225 "pmtexb2.f"
  4098.     if (*ch1 == ' ') {
  4099. #line 1225 "pmtexb2.f"
  4100.     goto L2;
  4101. #line 1225 "pmtexb2.f"
  4102.     }
  4103.  
  4104. /*  Just starting or not yet finished */
  4105.  
  4106. #line 1229 "pmtexb2.f"
  4107.     lnof = 1;
  4108. #line 1230 "pmtexb2.f"
  4109.     tof = ord_(nof, 2L);
  4110. #line 1231 "pmtexb2.f"
  4111.     ch__1[0] = tof + 48;
  4112. #line 1231 "pmtexb2.f"
  4113.     s_copy(nof, ch__1, 2L, 1L);
  4114. #line 1232 "pmtexb2.f"
  4115.     if (tof > 9) {
  4116. #line 1233 "pmtexb2.f"
  4117.     lnof = 2;
  4118. #line 1234 "pmtexb2.f"
  4119.     tof = ord_(nof, 2L);
  4120. /* Writing concatenation */
  4121. #line 1235 "pmtexb2.f"
  4122.     i__1[0] = 1, a__1[0] = "1";
  4123. #line 1235 "pmtexb2.f"
  4124.     ch__1[0] = tof + 38;
  4125. #line 1235 "pmtexb2.f"
  4126.     i__1[1] = 1, a__1[1] = ch__1;
  4127. #line 1235 "pmtexb2.f"
  4128.     s_cat(nof, a__1, i__1, &c__2, 2L);
  4129. #line 1236 "pmtexb2.f"
  4130.     }
  4131. #line 1237 "pmtexb2.f"
  4132.     tofa = ord_(nofa, 2L);
  4133. #line 1238 "pmtexb2.f"
  4134.     if (tofa == -1) {
  4135. #line 1239 "pmtexb2.f"
  4136.     lnofa = 2;
  4137. #line 1240 "pmtexb2.f"
  4138.     s_copy(nofa, "-1", 2L, 2L);
  4139. #line 1241 "pmtexb2.f"
  4140.     } else if (tofa < 10) {
  4141. #line 1242 "pmtexb2.f"
  4142.     lnofa = 1;
  4143. #line 1243 "pmtexb2.f"
  4144.     ch__1[0] = tofa + 48;
  4145. #line 1243 "pmtexb2.f"
  4146.     s_copy(nofa, ch__1, 2L, 1L);
  4147. #line 1244 "pmtexb2.f"
  4148.     } else {
  4149. #line 1245 "pmtexb2.f"
  4150.     lnofa = 2;
  4151. /* Writing concatenation */
  4152. #line 1246 "pmtexb2.f"
  4153.     i__1[0] = 1, a__1[0] = "1";
  4154. #line 1246 "pmtexb2.f"
  4155.     ch__1[0] = tofa + 38;
  4156. #line 1246 "pmtexb2.f"
  4157.     i__1[1] = 1, a__1[1] = ch__1;
  4158. #line 1246 "pmtexb2.f"
  4159.     s_cat(nofa, a__1, i__1, &c__2, 2L);
  4160. #line 1247 "pmtexb2.f"
  4161.     }
  4162. #line 1248 "pmtexb2.f"
  4163.     if (*ch1 == '#' || *ch1 == '-' || *ch1 == 'n') {
  4164. #line 1249 "pmtexb2.f"
  4165.     ++ic;
  4166. #line 1250 "pmtexb2.f"
  4167.     *ch2 = fig[ic - 1];
  4168. #line 1251 "pmtexb2.f"
  4169.     if (*ch2 == ' ') {
  4170.  
  4171. /*  Figure is a stand-alone accidental, so must be centered */
  4172.  
  4173. #line 1255 "pmtexb2.f"
  4174.         if (*ch1 == '#') {
  4175. /* Writing concatenation */
  4176. #line 1256 "pmtexb2.f"
  4177.         i__2[0] = 1, a__2[0] = s;
  4178. #line 1256 "pmtexb2.f"
  4179.         i__2[1] = 5, a__2[1] = "Figu{";
  4180. #line 1256 "pmtexb2.f"
  4181.         i__2[2] = lnofa, a__2[2] = nofa;
  4182. #line 1256 "pmtexb2.f"
  4183.         i__2[3] = 2, a__2[3] = "}{";
  4184. #line 1256 "pmtexb2.f"
  4185.         i__2[4] = 1, a__2[4] = s;
  4186. #line 1256 "pmtexb2.f"
  4187.         i__2[5] = 12, a__2[5] = "smalls@harp}";
  4188. #line 1256 "pmtexb2.f"
  4189.         s_cat(ch__2, a__2, i__2, &c__6, 23L);
  4190. #line 1256 "pmtexb2.f"
  4191.         i__3 = lnofa + 21;
  4192. #line 1256 "pmtexb2.f"
  4193.         addstr_(ch__2, &i__3, sout, lsout, lnofa + 21, 80L);
  4194. #line 1258 "pmtexb2.f"
  4195.         } else if (*ch1 == '-') {
  4196. /* Writing concatenation */
  4197. #line 1259 "pmtexb2.f"
  4198.         i__2[0] = 1, a__2[0] = s;
  4199. #line 1259 "pmtexb2.f"
  4200.         i__2[1] = 5, a__2[1] = "Figu{";
  4201. #line 1259 "pmtexb2.f"
  4202.         i__2[2] = lnofa, a__2[2] = nofa;
  4203. #line 1259 "pmtexb2.f"
  4204.         i__2[3] = 2, a__2[3] = "}{";
  4205. #line 1259 "pmtexb2.f"
  4206.         i__2[4] = 1, a__2[4] = s;
  4207. #line 1259 "pmtexb2.f"
  4208.         i__2[5] = 11, a__2[5] = "smallf@lat}";
  4209. #line 1259 "pmtexb2.f"
  4210.         s_cat(ch__3, a__2, i__2, &c__6, 22L);
  4211. #line 1259 "pmtexb2.f"
  4212.         i__3 = lnofa + 20;
  4213. #line 1259 "pmtexb2.f"
  4214.         addstr_(ch__3, &i__3, sout, lsout, lnofa + 20, 80L);
  4215. #line 1261 "pmtexb2.f"
  4216.         } else if (*ch1 == 'n') {
  4217. /* Writing concatenation */
  4218. #line 1262 "pmtexb2.f"
  4219.         i__2[0] = 1, a__2[0] = s;
  4220. #line 1262 "pmtexb2.f"
  4221.         i__2[1] = 5, a__2[1] = "Figu{";
  4222. #line 1262 "pmtexb2.f"
  4223.         i__2[2] = lnofa, a__2[2] = nofa;
  4224. #line 1262 "pmtexb2.f"
  4225.         i__2[3] = 2, a__2[3] = "}{";
  4226. #line 1262 "pmtexb2.f"
  4227.         i__2[4] = 1, a__2[4] = s;
  4228. #line 1262 "pmtexb2.f"
  4229.         i__2[5] = 10, a__2[5] = "smalln@at}";
  4230. #line 1262 "pmtexb2.f"
  4231.         s_cat(ch__4, a__2, i__2, &c__6, 21L);
  4232. #line 1262 "pmtexb2.f"
  4233.         i__3 = lnofa + 19;
  4234. #line 1262 "pmtexb2.f"
  4235.         addstr_(ch__4, &i__3, sout, lsout, lnofa + 19, 80L);
  4236. #line 1264 "pmtexb2.f"
  4237.         }
  4238. #line 1265 "pmtexb2.f"
  4239.         goto L2;
  4240. #line 1266 "pmtexb2.f"
  4241.     } else {
  4242.  
  4243. /*  Figure is an accidental followed by a number */
  4244. /*  First put the accidental (offset to the left) */
  4245.  
  4246. #line 1271 "pmtexb2.f"
  4247.         if (*ch1 == '#') {
  4248. /* Writing concatenation */
  4249. #line 1272 "pmtexb2.f"
  4250.         i__2[0] = 1, a__2[0] = s;
  4251. #line 1272 "pmtexb2.f"
  4252.         i__2[1] = 5, a__2[1] = "Figu{";
  4253. #line 1272 "pmtexb2.f"
  4254.         i__2[2] = lnofa, a__2[2] = nofa;
  4255. #line 1272 "pmtexb2.f"
  4256.         i__2[3] = 2, a__2[3] = "}{";
  4257. #line 1272 "pmtexb2.f"
  4258.         i__2[4] = 1, a__2[4] = s;
  4259. #line 1272 "pmtexb2.f"
  4260.         i__2[5] = 6, a__2[5] = "fsmsh}";
  4261. #line 1272 "pmtexb2.f"
  4262.         s_cat(ch__5, a__2, i__2, &c__6, 17L);
  4263. #line 1272 "pmtexb2.f"
  4264.         i__3 = lnofa + 15;
  4265. #line 1272 "pmtexb2.f"
  4266.         addstr_(ch__5, &i__3, sout, lsout, lnofa + 15, 80L);
  4267. #line 1275 "pmtexb2.f"
  4268.         } else if (*ch1 == '-') {
  4269. /* Writing concatenation */
  4270. #line 1276 "pmtexb2.f"
  4271.         i__2[0] = 1, a__2[0] = s;
  4272. #line 1276 "pmtexb2.f"
  4273.         i__2[1] = 5, a__2[1] = "Figu{";
  4274. #line 1276 "pmtexb2.f"
  4275.         i__2[2] = lnofa, a__2[2] = nofa;
  4276. #line 1276 "pmtexb2.f"
  4277.         i__2[3] = 2, a__2[3] = "}{";
  4278. #line 1276 "pmtexb2.f"
  4279.         i__2[4] = 1, a__2[4] = s;
  4280. #line 1276 "pmtexb2.f"
  4281.         i__2[5] = 6, a__2[5] = "fsmfl}";
  4282. #line 1276 "pmtexb2.f"
  4283.         s_cat(ch__5, a__2, i__2, &c__6, 17L);
  4284. #line 1276 "pmtexb2.f"
  4285.         i__3 = lnofa + 15;
  4286. #line 1276 "pmtexb2.f"
  4287.         addstr_(ch__5, &i__3, sout, lsout, lnofa + 15, 80L);
  4288. #line 1279 "pmtexb2.f"
  4289.         } else if (*ch1 == 'n') {
  4290. /* Writing concatenation */
  4291. #line 1280 "pmtexb2.f"
  4292.         i__2[0] = 1, a__2[0] = s;
  4293. #line 1280 "pmtexb2.f"
  4294.         i__2[1] = 5, a__2[1] = "Figu{";
  4295. #line 1280 "pmtexb2.f"
  4296.         i__2[2] = lnofa, a__2[2] = nofa;
  4297. #line 1280 "pmtexb2.f"
  4298.         i__2[3] = 2, a__2[3] = "}{";
  4299. #line 1280 "pmtexb2.f"
  4300.         i__2[4] = 1, a__2[4] = s;
  4301. #line 1280 "pmtexb2.f"
  4302.         i__2[5] = 6, a__2[5] = "fsmna}";
  4303. #line 1280 "pmtexb2.f"
  4304.         s_cat(ch__5, a__2, i__2, &c__6, 17L);
  4305. #line 1280 "pmtexb2.f"
  4306.         i__3 = lnofa + 15;
  4307. #line 1280 "pmtexb2.f"
  4308.         addstr_(ch__5, &i__3, sout, lsout, lnofa + 15, 80L);
  4309. #line 1283 "pmtexb2.f"
  4310.         }
  4311.  
  4312. /*  Now put the number */
  4313.  
  4314. /* Writing concatenation */
  4315. #line 1287 "pmtexb2.f"
  4316.         i__2[0] = 1, a__2[0] = s;
  4317. #line 1287 "pmtexb2.f"
  4318.         i__2[1] = 5, a__2[1] = "Figu{";
  4319. #line 1287 "pmtexb2.f"
  4320.         i__2[2] = lnof, a__2[2] = nof;
  4321. #line 1287 "pmtexb2.f"
  4322.         i__2[3] = 2, a__2[3] = "}{";
  4323. #line 1287 "pmtexb2.f"
  4324.         i__2[4] = 1, a__2[4] = ch2;
  4325. #line 1287 "pmtexb2.f"
  4326.         i__2[5] = 1, a__2[5] = "}";
  4327. #line 1287 "pmtexb2.f"
  4328.         s_cat(ch__6, a__2, i__2, &c__6, 12L);
  4329. #line 1287 "pmtexb2.f"
  4330.         i__3 = lnof + 10;
  4331. #line 1287 "pmtexb2.f"
  4332.         addstr_(ch__6, &i__3, sout, lsout, lnof + 10, 80L);
  4333. #line 1289 "pmtexb2.f"
  4334.     }
  4335. #line 1290 "pmtexb2.f"
  4336.     } else {
  4337.  
  4338. /*  Figure is a single number */
  4339.  
  4340. /* Writing concatenation */
  4341. #line 1294 "pmtexb2.f"
  4342.     i__2[0] = 1, a__2[0] = s;
  4343. #line 1294 "pmtexb2.f"
  4344.     i__2[1] = 5, a__2[1] = "Figu{";
  4345. #line 1294 "pmtexb2.f"
  4346.     i__2[2] = lnof, a__2[2] = nof;
  4347. #line 1294 "pmtexb2.f"
  4348.     i__2[3] = 2, a__2[3] = "}{";
  4349. #line 1294 "pmtexb2.f"
  4350.     i__2[4] = 1, a__2[4] = ch1;
  4351. #line 1294 "pmtexb2.f"
  4352.     i__2[5] = 1, a__2[5] = "}";
  4353. #line 1294 "pmtexb2.f"
  4354.     s_cat(ch__6, a__2, i__2, &c__6, 12L);
  4355. #line 1294 "pmtexb2.f"
  4356.     i__3 = lnof + 10;
  4357. #line 1294 "pmtexb2.f"
  4358.     addstr_(ch__6, &i__3, sout, lsout, lnof + 10, 80L);
  4359. #line 1296 "pmtexb2.f"
  4360.     }
  4361. #line 1297 "pmtexb2.f"
  4362.     ++ic;
  4363. #line 1298 "pmtexb2.f"
  4364.     tof = ord_(nof, 2L);
  4365. #line 1299 "pmtexb2.f"
  4366.     tof += 4;
  4367. #line 1300 "pmtexb2.f"
  4368.     ch__1[0] = tof + 48;
  4369. #line 1300 "pmtexb2.f"
  4370.     s_copy(nof, ch__1, 2L, 1L);
  4371. #line 1301 "pmtexb2.f"
  4372.     tofa = ord_(nofa, 2L);
  4373. #line 1302 "pmtexb2.f"
  4374.     tofa += 4;
  4375. #line 1303 "pmtexb2.f"
  4376.     ch__1[0] = tofa + 48;
  4377. #line 1303 "pmtexb2.f"
  4378.     s_copy(nofa, ch__1, 2L, 1L);
  4379. #line 1304 "pmtexb2.f"
  4380.     goto L1;
  4381. #line 1305 "pmtexb2.f"
  4382. L2:
  4383. #line 1306 "pmtexb2.f"
  4384.     return 0;
  4385. } /* putfig_ */
  4386.  
  4387. /* Subroutine */ int topfile_(char *basename, integer *lbase, integer *nv, 
  4388.     char *clef, integer *noinst, integer *musicsize, logical *figbass, 
  4389.     ftnlen basename_len, ftnlen clef_len)
  4390. {
  4391.     /* Initialized data */
  4392.  
  4393.     static char rnum[3*5] = "i  " "ii " "iii" "iv " "v  ";
  4394.  
  4395.     /* System generated locals */
  4396.     address a__1[3], a__2[2], a__3[4], a__4[10], a__5[6], a__6[8];
  4397.     integer i__1[3], i__2[2], i__3[4], i__4[10], i__5[6], i__6, i__7[8];
  4398.     char ch__1[30], ch__2[15], ch__3[12], ch__4[35], ch__5[17], ch__6[41], 
  4399.         ch__7[23], ch__8[14], ch__9[11], ch__10[21], ch__11[7], ch__12[19]
  4400.         , ch__13[16], ch__14[18], ch__15[1], ch__16[44], ch__17[22], 
  4401.         ch__18[25], ch__19[24], ch__20[13], ch__21[20];
  4402.  
  4403.     /* Builtin functions */
  4404.     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
  4405.     /* Subroutine */ int s_cat(char *, char **, integer *, integer *, ftnlen);
  4406.  
  4407.     /* Local variables */
  4408.     static char s[1];
  4409.     static integer lname, iposn, iv, ipi, nvp;
  4410.     extern /* Character */ VOID clefnum_(char *, ftnlen, char *, ftnlen);
  4411.     static char tstring[40];
  4412.  
  4413.     /* Fortran I/O blocks */
  4414.     static cilist io___166 = { 0, 11, 0, "(a)", 0 };
  4415.     static cilist io___167 = { 0, 11, 0, "(a)", 0 };
  4416.     static cilist io___168 = { 0, 11, 0, "(a)", 0 };
  4417.     static cilist io___169 = { 0, 11, 0, "(a)", 0 };
  4418.     static cilist io___170 = { 0, 11, 0, "(a)", 0 };
  4419.     static cilist io___171 = { 0, 11, 0, "(a)", 0 };
  4420.     static cilist io___172 = { 0, 11, 0, "(a)", 0 };
  4421.     static cilist io___173 = { 0, 11, 0, "(a)", 0 };
  4422.     static cilist io___174 = { 0, 11, 0, "(a)", 0 };
  4423.     static cilist io___175 = { 0, 11, 0, "(a)", 0 };
  4424.     static cilist io___176 = { 0, 11, 0, "(a)", 0 };
  4425.     static cilist io___177 = { 0, 11, 0, "(a)", 0 };
  4426.     static cilist io___178 = { 0, 11, 0, "(a)", 0 };
  4427.     static cilist io___179 = { 0, 11, 0, "(a)", 0 };
  4428.     static cilist io___180 = { 0, 11, 0, "(a)", 0 };
  4429.     static cilist io___181 = { 0, 11, 0, "(a14,i1,a4)", 0 };
  4430.     static cilist io___182 = { 0, 11, 0, "(a11,i2,a1)", 0 };
  4431.     static cilist io___183 = { 0, 11, 0, "(a)", 0 };
  4432.     static cilist io___184 = { 0, 11, 0, "(a7,i3,a2)", 0 };
  4433.     static cilist io___185 = { 0, 11, 0, "(a7,i3,a2)", 0 };
  4434.     static cilist io___187 = { 0, 11, 0, "(a19,i1,a1)", 0 };
  4435.     static cilist io___188 = { 0, 11, 0, "(a16,i2,a1)", 0 };
  4436.     static cilist io___189 = { 0, 11, 0, "(a19,i2,a1)", 0 };
  4437.     static cilist io___190 = { 0, 11, 0, "(a18,i2,a1)", 0 };
  4438.     static cilist io___192 = { 0, 11, 0, "(a16)", 0 };
  4439.     static cilist io___193 = { 0, 11, 0, "(a)", 0 };
  4440.     static cilist io___195 = { 0, 11, 0, "(a)", 0 };
  4441.     static cilist io___196 = { 0, 11, 0, "(a12,i1)", 0 };
  4442.     static cilist io___197 = { 0, 6, 0, "(a12,i1)", 0 };
  4443.     static cilist io___199 = { 0, 6, 0, "(a)", 0 };
  4444.     static cilist io___201 = { 0, 6, 0, "(a)", 0 };
  4445.     static cilist io___202 = { 0, 11, 0, "(a)", 0 };
  4446.     static cilist io___203 = { 0, 11, 0, "(a19,i2,a2)", 0 };
  4447.     static cilist io___204 = { 0, 11, 0, "(a)", 0 };
  4448.     static cilist io___205 = { 0, 11, 0, "(a25,i2,a2,i2,a3)", 0 };
  4449.     static cilist io___206 = { 0, 11, 0, "(a21,i1,a2)", 0 };
  4450.     static cilist io___207 = { 0, 11, 0, "(a)", 0 };
  4451.     static cilist io___208 = { 0, 11, 0, "(a)", 0 };
  4452.     static cilist io___210 = { 0, 11, 0, "(a11,i1,a2)", 0 };
  4453.     static cilist io___211 = { 0, 11, 0, "(a11,i2,a2)", 0 };
  4454.     static cilist io___212 = { 0, 11, 0, "(a)", 0 };
  4455.     static cilist io___213 = { 0, 11, 0, "(a)", 0 };
  4456.     static cilist io___214 = { 0, 11, 0, "(a)", 0 };
  4457.     static cilist io___215 = { 0, 11, 0, "(a)", 0 };
  4458.  
  4459.  
  4460. #line 1318 "pmtexb2.f"
  4461.     /* Parameter adjustments */
  4462. #line 1318 "pmtexb2.f"
  4463.     --clef;
  4464. #line 1318 "pmtexb2.f"
  4465.  
  4466. #line 1318 "pmtexb2.f"
  4467.     /* Function Body */
  4468. /* Platform-independent backslash */
  4469. #line 1320 "pmtexb2.f"
  4470.     *s = '\\';
  4471. #line 1321 "pmtexb2.f"
  4472.     s_wsfe(&io___166);
  4473. #line 1321 "pmtexb2.f"
  4474.     do_fio(&c__1, "%%%%%%%%%%%%%%%%%", 17L);
  4475. #line 1321 "pmtexb2.f"
  4476.     e_wsfe();
  4477. #line 1322 "pmtexb2.f"
  4478.     s_wsfe(&io___167);
  4479. #line 1322 "pmtexb2.f"
  4480.     do_fio(&c__1, "%", 1L);
  4481. #line 1322 "pmtexb2.f"
  4482.     e_wsfe();
  4483. #line 1323 "pmtexb2.f"
  4484.     s_wsfe(&io___168);
  4485. /* Writing concatenation */
  4486. #line 1323 "pmtexb2.f"
  4487.     i__1[0] = 2, a__1[0] = "% ";
  4488. #line 1323 "pmtexb2.f"
  4489.     i__1[1] = *lbase, a__1[1] = basename;
  4490. #line 1323 "pmtexb2.f"
  4491.     i__1[2] = 4, a__1[2] = ".tex";
  4492. #line 1323 "pmtexb2.f"
  4493.     s_cat(ch__1, a__1, i__1, &c__3, 30L);
  4494. #line 1323 "pmtexb2.f"
  4495.     do_fio(&c__1, ch__1, *lbase + 6);
  4496. #line 1323 "pmtexb2.f"
  4497.     e_wsfe();
  4498. #line 1324 "pmtexb2.f"
  4499.     s_wsfe(&io___169);
  4500. #line 1324 "pmtexb2.f"
  4501.     do_fio(&c__1, "%", 1L);
  4502. #line 1324 "pmtexb2.f"
  4503.     e_wsfe();
  4504. #line 1325 "pmtexb2.f"
  4505.     s_wsfe(&io___170);
  4506. #line 1325 "pmtexb2.f"
  4507.     do_fio(&c__1, "%%%%%%%%%%%%%%%%", 16L);
  4508. #line 1325 "pmtexb2.f"
  4509.     e_wsfe();
  4510. #line 1326 "pmtexb2.f"
  4511.     s_wsfe(&io___171);
  4512. /* Writing concatenation */
  4513. #line 1326 "pmtexb2.f"
  4514.     i__2[0] = 1, a__2[0] = s;
  4515. #line 1326 "pmtexb2.f"
  4516.     i__2[1] = 14, a__2[1] = "input musicnft";
  4517. #line 1326 "pmtexb2.f"
  4518.     s_cat(ch__2, a__2, i__2, &c__2, 15L);
  4519. #line 1326 "pmtexb2.f"
  4520.     do_fio(&c__1, ch__2, 15L);
  4521. #line 1326 "pmtexb2.f"
  4522.     e_wsfe();
  4523. #line 1327 "pmtexb2.f"
  4524.     s_wsfe(&io___172);
  4525. /* Writing concatenation */
  4526. #line 1327 "pmtexb2.f"
  4527.     i__2[0] = 1, a__2[0] = s;
  4528. #line 1327 "pmtexb2.f"
  4529.     i__2[1] = 14, a__2[1] = "input musicvbm";
  4530. #line 1327 "pmtexb2.f"
  4531.     s_cat(ch__2, a__2, i__2, &c__2, 15L);
  4532. #line 1327 "pmtexb2.f"
  4533.     do_fio(&c__1, ch__2, 15L);
  4534. #line 1327 "pmtexb2.f"
  4535.     e_wsfe();
  4536. #line 1328 "pmtexb2.f"
  4537.     s_wsfe(&io___173);
  4538. /* Writing concatenation */
  4539. #line 1328 "pmtexb2.f"
  4540.     i__2[0] = 1, a__2[0] = s;
  4541. #line 1328 "pmtexb2.f"
  4542.     i__2[1] = 14, a__2[1] = "input musictex";
  4543. #line 1328 "pmtexb2.f"
  4544.     s_cat(ch__2, a__2, i__2, &c__2, 15L);
  4545. #line 1328 "pmtexb2.f"
  4546.     do_fio(&c__1, ch__2, 15L);
  4547. #line 1328 "pmtexb2.f"
  4548.     e_wsfe();
  4549. #line 1329 "pmtexb2.f"
  4550.     s_wsfe(&io___174);
  4551. /* Writing concatenation */
  4552. #line 1329 "pmtexb2.f"
  4553.     i__2[0] = 1, a__2[0] = s;
  4554. #line 1329 "pmtexb2.f"
  4555.     i__2[1] = 14, a__2[1] = "input musicsty";
  4556. #line 1329 "pmtexb2.f"
  4557.     s_cat(ch__2, a__2, i__2, &c__2, 15L);
  4558. #line 1329 "pmtexb2.f"
  4559.     do_fio(&c__1, ch__2, 15L);
  4560. #line 1329 "pmtexb2.f"
  4561.     e_wsfe();
  4562. #line 1330 "pmtexb2.f"
  4563.     s_wsfe(&io___175);
  4564. /* Writing concatenation */
  4565. #line 1330 "pmtexb2.f"
  4566.     i__2[0] = 1, a__2[0] = s;
  4567. #line 1330 "pmtexb2.f"
  4568.     i__2[1] = 14, a__2[1] = "input musictrp";
  4569. #line 1330 "pmtexb2.f"
  4570.     s_cat(ch__2, a__2, i__2, &c__2, 15L);
  4571. #line 1330 "pmtexb2.f"
  4572.     do_fio(&c__1, ch__2, 15L);
  4573. #line 1330 "pmtexb2.f"
  4574.     e_wsfe();
  4575. #line 1331 "pmtexb2.f"
  4576.     s_wsfe(&io___176);
  4577. /* Writing concatenation */
  4578. #line 1331 "pmtexb2.f"
  4579.     i__2[0] = 1, a__2[0] = s;
  4580. #line 1331 "pmtexb2.f"
  4581.     i__2[1] = 11, a__2[1] = "input pmtex";
  4582. #line 1331 "pmtexb2.f"
  4583.     s_cat(ch__3, a__2, i__2, &c__2, 12L);
  4584. #line 1331 "pmtexb2.f"
  4585.     do_fio(&c__1, ch__3, 12L);
  4586. #line 1331 "pmtexb2.f"
  4587.     e_wsfe();
  4588. #line 1332 "pmtexb2.f"
  4589.     if (*figbass) {
  4590. #line 1332 "pmtexb2.f"
  4591.     s_wsfe(&io___177);
  4592. /* Writing concatenation */
  4593. #line 1332 "pmtexb2.f"
  4594.     i__3[0] = 1, a__3[0] = s;
  4595. #line 1332 "pmtexb2.f"
  4596.     i__3[1] = 6, a__3[1] = "input ";
  4597. #line 1332 "pmtexb2.f"
  4598.     i__3[2] = *lbase, a__3[2] = basename;
  4599. #line 1332 "pmtexb2.f"
  4600.     i__3[3] = 4, a__3[3] = ".fig";
  4601. #line 1332 "pmtexb2.f"
  4602.     s_cat(ch__4, a__3, i__3, &c__4, 35L);
  4603. #line 1332 "pmtexb2.f"
  4604.     do_fio(&c__1, ch__4, *lbase + 11);
  4605. #line 1332 "pmtexb2.f"
  4606.     e_wsfe();
  4607. #line 1332 "pmtexb2.f"
  4608.     }
  4609. #line 1334 "pmtexb2.f"
  4610.     s_wsfe(&io___178);
  4611. /* Writing concatenation */
  4612. #line 1334 "pmtexb2.f"
  4613.     i__3[0] = 1, a__3[0] = s;
  4614. #line 1334 "pmtexb2.f"
  4615.     i__3[1] = 3, a__3[1] = "def";
  4616. #line 1334 "pmtexb2.f"
  4617.     i__3[2] = 1, a__3[2] = s;
  4618. #line 1334 "pmtexb2.f"
  4619.     i__3[3] = 12, a__3[3] = "autol#1#2#3{";
  4620. #line 1334 "pmtexb2.f"
  4621.     s_cat(ch__5, a__3, i__3, &c__4, 17L);
  4622. #line 1334 "pmtexb2.f"
  4623.     do_fio(&c__1, ch__5, 17L);
  4624. #line 1334 "pmtexb2.f"
  4625.     e_wsfe();
  4626. #line 1335 "pmtexb2.f"
  4627.     if (*figbass) {
  4628. #line 1335 "pmtexb2.f"
  4629.     s_wsfe(&io___179);
  4630. /* Writing concatenation */
  4631. #line 1335 "pmtexb2.f"
  4632.     i__4[0] = 1, a__4[0] = s;
  4633. #line 1335 "pmtexb2.f"
  4634.     i__4[1] = 6, a__4[1] = "global";
  4635. #line 1335 "pmtexb2.f"
  4636.     i__4[2] = 1, a__4[2] = s;
  4637. #line 1335 "pmtexb2.f"
  4638.     i__4[3] = 7, a__4[3] = "advance";
  4639. #line 1335 "pmtexb2.f"
  4640.     i__4[4] = 1, a__4[4] = s;
  4641. #line 1335 "pmtexb2.f"
  4642.     i__4[5] = 10, a__4[5] = "sysno by 1";
  4643. #line 1335 "pmtexb2.f"
  4644.     i__4[6] = 1, a__4[6] = s;
  4645. #line 1335 "pmtexb2.f"
  4646.     i__4[7] = 5, a__4[7] = "relax";
  4647. #line 1335 "pmtexb2.f"
  4648.     i__4[8] = 1, a__4[8] = s;
  4649. #line 1335 "pmtexb2.f"
  4650.     i__4[9] = 8, a__4[9] = "fixdrop%";
  4651. #line 1335 "pmtexb2.f"
  4652.     s_cat(ch__6, a__4, i__4, &c__10, 41L);
  4653. #line 1335 "pmtexb2.f"
  4654.     do_fio(&c__1, ch__6, 41L);
  4655. #line 1335 "pmtexb2.f"
  4656.     e_wsfe();
  4657. #line 1335 "pmtexb2.f"
  4658.     }
  4659. #line 1338 "pmtexb2.f"
  4660.     s_wsfe(&io___180);
  4661. /* Writing concatenation */
  4662. #line 1338 "pmtexb2.f"
  4663.     i__2[0] = 1, a__2[0] = s;
  4664. #line 1338 "pmtexb2.f"
  4665.     i__2[1] = 22, a__2[1] = "autolines{#1}{#2}{#3}}";
  4666. #line 1338 "pmtexb2.f"
  4667.     s_cat(ch__7, a__2, i__2, &c__2, 23L);
  4668. #line 1338 "pmtexb2.f"
  4669.     do_fio(&c__1, ch__7, 23L);
  4670. #line 1338 "pmtexb2.f"
  4671.     e_wsfe();
  4672. #line 1339 "pmtexb2.f"
  4673.     s_wsfe(&io___181);
  4674. /* Writing concatenation */
  4675. #line 1339 "pmtexb2.f"
  4676.     i__5[0] = 1, a__5[0] = s;
  4677. #line 1339 "pmtexb2.f"
  4678.     i__5[1] = 3, a__5[1] = "def";
  4679. #line 1339 "pmtexb2.f"
  4680.     i__5[2] = 1, a__5[2] = s;
  4681. #line 1339 "pmtexb2.f"
  4682.     i__5[3] = 4, a__5[3] = "ask{";
  4683. #line 1339 "pmtexb2.f"
  4684.     i__5[4] = 1, a__5[4] = s;
  4685. #line 1339 "pmtexb2.f"
  4686.     i__5[5] = 4, a__5[5] = "off{";
  4687. #line 1339 "pmtexb2.f"
  4688.     s_cat(ch__8, a__5, i__5, &c__6, 14L);
  4689. #line 1339 "pmtexb2.f"
  4690.     do_fio(&c__1, ch__8, 14L);
  4691. #line 1339 "pmtexb2.f"
  4692.     do_fio(&c__1, (char *)&comtop_1.iwaskpt, (ftnlen)sizeof(integer));
  4693. #line 1339 "pmtexb2.f"
  4694.     do_fio(&c__1, "pt}}", 4L);
  4695. #line 1339 "pmtexb2.f"
  4696.     e_wsfe();
  4697. #line 1341 "pmtexb2.f"
  4698.     s_wsfe(&io___182);
  4699. /* Writing concatenation */
  4700. #line 1341 "pmtexb2.f"
  4701.     i__2[0] = 1, a__2[0] = s;
  4702. #line 1341 "pmtexb2.f"
  4703.     i__2[1] = 10, a__2[1] = "musicsize=";
  4704. #line 1341 "pmtexb2.f"
  4705.     s_cat(ch__9, a__2, i__2, &c__2, 11L);
  4706. #line 1341 "pmtexb2.f"
  4707.     do_fio(&c__1, ch__9, 11L);
  4708. #line 1341 "pmtexb2.f"
  4709.     do_fio(&c__1, (char *)&(*musicsize), (ftnlen)sizeof(integer));
  4710. #line 1341 "pmtexb2.f"
  4711.     do_fio(&c__1, "%", 1L);
  4712. #line 1341 "pmtexb2.f"
  4713.     e_wsfe();
  4714. #line 1342 "pmtexb2.f"
  4715.     s_wsfe(&io___183);
  4716. /* Writing concatenation */
  4717. #line 1342 "pmtexb2.f"
  4718.     i__3[0] = 1, a__3[0] = s;
  4719. #line 1342 "pmtexb2.f"
  4720.     i__3[1] = 14, a__3[1] = "tracingstats=2";
  4721. #line 1342 "pmtexb2.f"
  4722.     i__3[2] = 1, a__3[2] = s;
  4723. #line 1342 "pmtexb2.f"
  4724.     i__3[3] = 5, a__3[3] = "relax";
  4725. #line 1342 "pmtexb2.f"
  4726.     s_cat(ch__10, a__3, i__3, &c__4, 21L);
  4727. #line 1342 "pmtexb2.f"
  4728.     do_fio(&c__1, ch__10, 21L);
  4729. #line 1342 "pmtexb2.f"
  4730.     e_wsfe();
  4731. #line 1343 "pmtexb2.f"
  4732.     s_wsfe(&io___184);
  4733. /* Writing concatenation */
  4734. #line 1343 "pmtexb2.f"
  4735.     i__2[0] = 1, a__2[0] = s;
  4736. #line 1343 "pmtexb2.f"
  4737.     i__2[1] = 6, a__2[1] = "hsize=";
  4738. #line 1343 "pmtexb2.f"
  4739.     s_cat(ch__11, a__2, i__2, &c__2, 7L);
  4740. #line 1343 "pmtexb2.f"
  4741.     do_fio(&c__1, ch__11, 7L);
  4742. #line 1343 "pmtexb2.f"
  4743.     i__6 = (integer) (comtop_1.widthpt + .1f);
  4744. #line 1343 "pmtexb2.f"
  4745.     do_fio(&c__1, (char *)&i__6, (ftnlen)sizeof(integer));
  4746. #line 1343 "pmtexb2.f"
  4747.     do_fio(&c__1, "pt", 2L);
  4748. #line 1343 "pmtexb2.f"
  4749.     e_wsfe();
  4750. #line 1344 "pmtexb2.f"
  4751.     s_wsfe(&io___185);
  4752. /* Writing concatenation */
  4753. #line 1344 "pmtexb2.f"
  4754.     i__2[0] = 1, a__2[0] = s;
  4755. #line 1344 "pmtexb2.f"
  4756.     i__2[1] = 6, a__2[1] = "vsize=";
  4757. #line 1344 "pmtexb2.f"
  4758.     s_cat(ch__11, a__2, i__2, &c__2, 7L);
  4759. #line 1344 "pmtexb2.f"
  4760.     do_fio(&c__1, ch__11, 7L);
  4761. #line 1344 "pmtexb2.f"
  4762.     i__6 = (integer) (comtop_1.height + .1f);
  4763. #line 1344 "pmtexb2.f"
  4764.     do_fio(&c__1, (char *)&i__6, (ftnlen)sizeof(integer));
  4765. #line 1344 "pmtexb2.f"
  4766.     do_fio(&c__1, "pt", 2L);
  4767. #line 1344 "pmtexb2.f"
  4768.     e_wsfe();
  4769. #line 1345 "pmtexb2.f"
  4770.     nvp = *nv;
  4771. #line 1346 "pmtexb2.f"
  4772.     if (*noinst == 0) {
  4773. #line 1346 "pmtexb2.f"
  4774.     nvp = 1;
  4775. #line 1346 "pmtexb2.f"
  4776.     }
  4777. #line 1347 "pmtexb2.f"
  4778.     s_wsfe(&io___187);
  4779. /* Writing concatenation */
  4780. #line 1347 "pmtexb2.f"
  4781.     i__3[0] = 1, a__3[0] = s;
  4782. #line 1347 "pmtexb2.f"
  4783.     i__3[1] = 3, a__3[1] = "def";
  4784. #line 1347 "pmtexb2.f"
  4785.     i__3[2] = 1, a__3[2] = s;
  4786. #line 1347 "pmtexb2.f"
  4787.     i__3[3] = 14, a__3[3] = "nbinstruments{";
  4788. #line 1347 "pmtexb2.f"
  4789.     s_cat(ch__12, a__3, i__3, &c__4, 19L);
  4790. #line 1347 "pmtexb2.f"
  4791.     do_fio(&c__1, ch__12, 19L);
  4792. #line 1347 "pmtexb2.f"
  4793.     do_fio(&c__1, (char *)&nvp, (ftnlen)sizeof(integer));
  4794. #line 1347 "pmtexb2.f"
  4795.     do_fio(&c__1, "}", 1L);
  4796. #line 1347 "pmtexb2.f"
  4797.     e_wsfe();
  4798. #line 1348 "pmtexb2.f"
  4799.     s_wsfe(&io___188);
  4800. /* Writing concatenation */
  4801. #line 1348 "pmtexb2.f"
  4802.     i__3[0] = 1, a__3[0] = s;
  4803. #line 1348 "pmtexb2.f"
  4804.     i__3[1] = 3, a__3[1] = "def";
  4805. #line 1348 "pmtexb2.f"
  4806.     i__3[2] = 1, a__3[2] = s;
  4807. #line 1348 "pmtexb2.f"
  4808.     i__3[3] = 11, a__3[3] = "topfacteur{";
  4809. #line 1348 "pmtexb2.f"
  4810.     s_cat(ch__13, a__3, i__3, &c__4, 16L);
  4811. #line 1348 "pmtexb2.f"
  4812.     do_fio(&c__1, ch__13, 16L);
  4813. #line 1348 "pmtexb2.f"
  4814.     do_fio(&c__1, (char *)&comtop_1.itopfacteur, (ftnlen)sizeof(integer));
  4815. #line 1348 "pmtexb2.f"
  4816.     do_fio(&c__1, "}", 1L);
  4817. #line 1348 "pmtexb2.f"
  4818.     e_wsfe();
  4819. #line 1350 "pmtexb2.f"
  4820.     s_wsfe(&io___189);
  4821. /* Writing concatenation */
  4822. #line 1350 "pmtexb2.f"
  4823.     i__3[0] = 1, a__3[0] = s;
  4824. #line 1350 "pmtexb2.f"
  4825.     i__3[1] = 3, a__3[1] = "def";
  4826. #line 1350 "pmtexb2.f"
  4827.     i__3[2] = 1, a__3[2] = s;
  4828. #line 1350 "pmtexb2.f"
  4829.     i__3[3] = 14, a__3[3] = "bottomfacteur{";
  4830. #line 1350 "pmtexb2.f"
  4831.     s_cat(ch__12, a__3, i__3, &c__4, 19L);
  4832. #line 1350 "pmtexb2.f"
  4833.     do_fio(&c__1, ch__12, 19L);
  4834. #line 1350 "pmtexb2.f"
  4835.     do_fio(&c__1, (char *)&comtop_1.ibotfacteur, (ftnlen)sizeof(integer));
  4836. #line 1350 "pmtexb2.f"
  4837.     do_fio(&c__1, "}", 1L);
  4838. #line 1350 "pmtexb2.f"
  4839.     e_wsfe();
  4840. #line 1352 "pmtexb2.f"
  4841.     s_wsfe(&io___190);
  4842. /* Writing concatenation */
  4843. #line 1352 "pmtexb2.f"
  4844.     i__3[0] = 1, a__3[0] = s;
  4845. #line 1352 "pmtexb2.f"
  4846.     i__3[1] = 3, a__3[1] = "def";
  4847. #line 1352 "pmtexb2.f"
  4848.     i__3[2] = 1, a__3[2] = s;
  4849. #line 1352 "pmtexb2.f"
  4850.     i__3[3] = 13, a__3[3] = "interfacteur{";
  4851. #line 1352 "pmtexb2.f"
  4852.     s_cat(ch__14, a__3, i__3, &c__4, 18L);
  4853. #line 1352 "pmtexb2.f"
  4854.     do_fio(&c__1, ch__14, 18L);
  4855. #line 1352 "pmtexb2.f"
  4856.     do_fio(&c__1, (char *)&comtop_1.interfacteur, (ftnlen)sizeof(integer));
  4857. #line 1352 "pmtexb2.f"
  4858.     do_fio(&c__1, "}", 1L);
  4859. #line 1352 "pmtexb2.f"
  4860.     e_wsfe();
  4861. #line 1354 "pmtexb2.f"
  4862.     if (*noinst > 0) {
  4863.  
  4864. /*  There are nv differenet instruments */
  4865.  
  4866. #line 1358 "pmtexb2.f"
  4867.     i__6 = *nv;
  4868. #line 1358 "pmtexb2.f"
  4869.     for (iv = 1; iv <= i__6; ++iv) {
  4870. #line 1359 "pmtexb2.f"
  4871.         s_wsfe(&io___192);
  4872. /* Writing concatenation */
  4873. #line 1359 "pmtexb2.f"
  4874.         i__3[0] = 1, a__3[0] = s;
  4875. #line 1359 "pmtexb2.f"
  4876.         i__3[1] = 9, a__3[1] = "nbportees";
  4877. #line 1359 "pmtexb2.f"
  4878.         i__3[2] = 3, a__3[2] = rnum + (iv - 1) * 3;
  4879. #line 1359 "pmtexb2.f"
  4880.         i__3[3] = 3, a__3[3] = "=1%";
  4881. #line 1359 "pmtexb2.f"
  4882.         s_cat(ch__13, a__3, i__3, &c__4, 16L);
  4883. #line 1359 "pmtexb2.f"
  4884.         do_fio(&c__1, ch__13, 16L);
  4885. #line 1359 "pmtexb2.f"
  4886.         e_wsfe();
  4887. #line 1360 "pmtexb2.f"
  4888.         s_wsfe(&io___193);
  4889. /* Writing concatenation */
  4890. #line 1360 "pmtexb2.f"
  4891.         i__7[0] = 1, a__6[0] = s;
  4892. #line 1360 "pmtexb2.f"
  4893.         i__7[1] = 6, a__6[1] = "global";
  4894. #line 1360 "pmtexb2.f"
  4895.         i__7[2] = 1, a__6[2] = s;
  4896. #line 1360 "pmtexb2.f"
  4897.         i__7[3] = 8, a__6[3] = "cleftoks";
  4898. #line 1360 "pmtexb2.f"
  4899.         i__7[4] = 3, a__6[4] = rnum + (iv - 1) * 3;
  4900. #line 1360 "pmtexb2.f"
  4901.         i__7[5] = 3, a__6[5] = "={{";
  4902. #line 1360 "pmtexb2.f"
  4903.         clefnum_(ch__15, 1L, clef + iv, 1L);
  4904. #line 1360 "pmtexb2.f"
  4905.         i__7[6] = 1, a__6[6] = ch__15;
  4906. #line 1360 "pmtexb2.f"
  4907.         i__7[7] = 12, a__6[7] = "}{0}{0}{0}}%";
  4908. #line 1360 "pmtexb2.f"
  4909.         s_cat(ch__4, a__6, i__7, &c__8, 35L);
  4910. #line 1360 "pmtexb2.f"
  4911.         do_fio(&c__1, ch__4, 35L);
  4912. #line 1360 "pmtexb2.f"
  4913.         e_wsfe();
  4914. #line 1362 "pmtexb2.f"
  4915.         for (lname = 24; lname >= 2; --lname) {
  4916. #line 1363 "pmtexb2.f"
  4917.         if (comtop_1.iname[(iv - 1) * 24 + (lname - 1)] != ' ') {
  4918. #line 1363 "pmtexb2.f"
  4919.             goto L4;
  4920. #line 1363 "pmtexb2.f"
  4921.         }
  4922. #line 1364 "pmtexb2.f"
  4923. /* L3: */
  4924. #line 1364 "pmtexb2.f"
  4925.         }
  4926. #line 1365 "pmtexb2.f"
  4927. L4:
  4928. #line 1366 "pmtexb2.f"
  4929.         s_wsfe(&io___195);
  4930. /* Writing concatenation */
  4931. #line 1366 "pmtexb2.f"
  4932.         i__7[0] = 1, a__6[0] = s;
  4933. #line 1366 "pmtexb2.f"
  4934.         i__7[1] = 3, a__6[1] = "def";
  4935. #line 1366 "pmtexb2.f"
  4936.         i__7[2] = 1, a__6[2] = s;
  4937. #line 1366 "pmtexb2.f"
  4938.         i__7[3] = 10, a__6[3] = "instrument";
  4939. #line 1366 "pmtexb2.f"
  4940.         i__7[4] = 3, a__6[4] = rnum + (iv - 1) * 3;
  4941. #line 1366 "pmtexb2.f"
  4942.         i__7[5] = 1, a__6[5] = "{";
  4943. #line 1366 "pmtexb2.f"
  4944.         i__7[6] = lname, a__6[6] = comtop_1.iname + (iv - 1) * 24;
  4945. #line 1366 "pmtexb2.f"
  4946.         i__7[7] = 1, a__6[7] = "}";
  4947. #line 1366 "pmtexb2.f"
  4948.         s_cat(ch__16, a__6, i__7, &c__8, 44L);
  4949. #line 1366 "pmtexb2.f"
  4950.         do_fio(&c__1, ch__16, lname + 20);
  4951. #line 1366 "pmtexb2.f"
  4952.         e_wsfe();
  4953. #line 1368 "pmtexb2.f"
  4954. /* L1: */
  4955. #line 1368 "pmtexb2.f"
  4956.     }
  4957. #line 1369 "pmtexb2.f"
  4958.     } else {
  4959.  
  4960. /*  There is one inst. with nv voices */
  4961.  
  4962. #line 1373 "pmtexb2.f"
  4963.     s_wsfe(&io___196);
  4964. /* Writing concatenation */
  4965. #line 1373 "pmtexb2.f"
  4966.     i__2[0] = 1, a__2[0] = s;
  4967. #line 1373 "pmtexb2.f"
  4968.     i__2[1] = 11, a__2[1] = "nbporteesi=";
  4969. #line 1373 "pmtexb2.f"
  4970.     s_cat(ch__3, a__2, i__2, &c__2, 12L);
  4971. #line 1373 "pmtexb2.f"
  4972.     do_fio(&c__1, ch__3, 12L);
  4973. #line 1373 "pmtexb2.f"
  4974.     do_fio(&c__1, (char *)&(*nv), (ftnlen)sizeof(integer));
  4975. #line 1373 "pmtexb2.f"
  4976.     e_wsfe();
  4977. #line 1374 "pmtexb2.f"
  4978.     s_wsfe(&io___197);
  4979. /* Writing concatenation */
  4980. #line 1374 "pmtexb2.f"
  4981.     i__2[0] = 1, a__2[0] = s;
  4982. #line 1374 "pmtexb2.f"
  4983.     i__2[1] = 11, a__2[1] = "nbporteesi=";
  4984. #line 1374 "pmtexb2.f"
  4985.     s_cat(ch__3, a__2, i__2, &c__2, 12L);
  4986. #line 1374 "pmtexb2.f"
  4987.     do_fio(&c__1, ch__3, 12L);
  4988. #line 1374 "pmtexb2.f"
  4989.     do_fio(&c__1, (char *)&(*nv), (ftnlen)sizeof(integer));
  4990. #line 1374 "pmtexb2.f"
  4991.     e_wsfe();
  4992. /* Writing concatenation */
  4993. #line 1375 "pmtexb2.f"
  4994.     i__3[0] = 1, a__3[0] = s;
  4995. #line 1375 "pmtexb2.f"
  4996.     i__3[1] = 6, a__3[1] = "global";
  4997. #line 1375 "pmtexb2.f"
  4998.     i__3[2] = 1, a__3[2] = s;
  4999. #line 1375 "pmtexb2.f"
  5000.     i__3[3] = 24, a__3[3] = "cleftoksi={{0}{0}{0}{0}}";
  5001. #line 1375 "pmtexb2.f"
  5002.     s_cat(tstring, a__3, i__3, &c__4, 40L);
  5003. #line 1376 "pmtexb2.f"
  5004.     s_wsfe(&io___199);
  5005. #line 1376 "pmtexb2.f"
  5006.     do_fio(&c__1, tstring, 40L);
  5007. #line 1376 "pmtexb2.f"
  5008.     e_wsfe();
  5009. #line 1377 "pmtexb2.f"
  5010.     i__6 = *nv;
  5011. #line 1377 "pmtexb2.f"
  5012.     for (iv = 1; iv <= i__6; ++iv) {
  5013. #line 1378 "pmtexb2.f"
  5014.         iposn = iv * 3 + 18;
  5015. #line 1379 "pmtexb2.f"
  5016.         clefnum_(ch__15, 1L, clef + iv, 1L);
  5017. #line 1379 "pmtexb2.f"
  5018.         tstring[iposn - 1] = ch__15[0];
  5019. #line 1380 "pmtexb2.f"
  5020.         s_wsfe(&io___201);
  5021. #line 1380 "pmtexb2.f"
  5022.         do_fio(&c__1, tstring, 40L);
  5023. #line 1380 "pmtexb2.f"
  5024.         e_wsfe();
  5025. #line 1381 "pmtexb2.f"
  5026. /* L2: */
  5027. #line 1381 "pmtexb2.f"
  5028.     }
  5029. #line 1382 "pmtexb2.f"
  5030.     s_wsfe(&io___202);
  5031. #line 1382 "pmtexb2.f"
  5032.     do_fio(&c__1, tstring, 40L);
  5033. #line 1382 "pmtexb2.f"
  5034.     e_wsfe();
  5035. #line 1383 "pmtexb2.f"
  5036.     }
  5037. #line 1384 "pmtexb2.f"
  5038.     s_wsfe(&io___203);
  5039. /* Writing concatenation */
  5040. #line 1384 "pmtexb2.f"
  5041.     i__2[0] = 1, a__2[0] = s;
  5042. #line 1384 "pmtexb2.f"
  5043.     i__2[1] = 18, a__2[1] = "signaturegenerale{";
  5044. #line 1384 "pmtexb2.f"
  5045.     s_cat(ch__12, a__2, i__2, &c__2, 19L);
  5046. #line 1384 "pmtexb2.f"
  5047.     do_fio(&c__1, ch__12, 19L);
  5048. #line 1384 "pmtexb2.f"
  5049.     do_fio(&c__1, (char *)&comtop_1.isig, (ftnlen)sizeof(integer));
  5050. #line 1384 "pmtexb2.f"
  5051.     do_fio(&c__1, "}%", 2L);
  5052. #line 1384 "pmtexb2.f"
  5053.     e_wsfe();
  5054. #line 1385 "pmtexb2.f"
  5055.     s_wsfe(&io___204);
  5056. /* Writing concatenation */
  5057. #line 1385 "pmtexb2.f"
  5058.     i__3[0] = 1, a__3[0] = s;
  5059. #line 1385 "pmtexb2.f"
  5060.     i__3[1] = 3, a__3[1] = "def";
  5061. #line 1385 "pmtexb2.f"
  5062.     i__3[2] = 1, a__3[2] = s;
  5063. #line 1385 "pmtexb2.f"
  5064.     i__3[3] = 17, a__3[3] = "gluemaxskip{7pt}%";
  5065. #line 1385 "pmtexb2.f"
  5066.     s_cat(ch__17, a__3, i__3, &c__4, 22L);
  5067. #line 1385 "pmtexb2.f"
  5068.     do_fio(&c__1, ch__17, 22L);
  5069. #line 1385 "pmtexb2.f"
  5070.     e_wsfe();
  5071. #line 1386 "pmtexb2.f"
  5072.     if (comtop_1.imeter == 0) {
  5073. #line 1387 "pmtexb2.f"
  5074.     s_wsfe(&io___205);
  5075. /* Writing concatenation */
  5076. #line 1387 "pmtexb2.f"
  5077.     i__3[0] = 1, a__3[0] = s;
  5078. #line 1387 "pmtexb2.f"
  5079.     i__3[1] = 13, a__3[1] = "generalmeter{";
  5080. #line 1387 "pmtexb2.f"
  5081.     i__3[2] = 1, a__3[2] = s;
  5082. #line 1387 "pmtexb2.f"
  5083.     i__3[3] = 10, a__3[3] = "meterfrac{";
  5084. #line 1387 "pmtexb2.f"
  5085.     s_cat(ch__18, a__3, i__3, &c__4, 25L);
  5086. #line 1387 "pmtexb2.f"
  5087.     do_fio(&c__1, ch__18, 25L);
  5088. #line 1387 "pmtexb2.f"
  5089.     do_fio(&c__1, (char *)&comtop_1.mtrnum, (ftnlen)sizeof(integer));
  5090. #line 1387 "pmtexb2.f"
  5091.     do_fio(&c__1, "}{", 2L);
  5092. #line 1387 "pmtexb2.f"
  5093.     do_fio(&c__1, (char *)&comtop_1.mtrden, (ftnlen)sizeof(integer));
  5094. #line 1387 "pmtexb2.f"
  5095.     do_fio(&c__1, "}}%", 3L);
  5096. #line 1387 "pmtexb2.f"
  5097.     e_wsfe();
  5098. #line 1390 "pmtexb2.f"
  5099.     } else if (comtop_1.imeter <= 4) {
  5100. #line 1391 "pmtexb2.f"
  5101.     s_wsfe(&io___206);
  5102. /* Writing concatenation */
  5103. #line 1391 "pmtexb2.f"
  5104.     i__3[0] = 1, a__3[0] = s;
  5105. #line 1391 "pmtexb2.f"
  5106.     i__3[1] = 13, a__3[1] = "generalmeter{";
  5107. #line 1391 "pmtexb2.f"
  5108.     i__3[2] = 1, a__3[2] = s;
  5109. #line 1391 "pmtexb2.f"
  5110.     i__3[3] = 6, a__3[3] = "meterN";
  5111. #line 1391 "pmtexb2.f"
  5112.     s_cat(ch__10, a__3, i__3, &c__4, 21L);
  5113. #line 1391 "pmtexb2.f"
  5114.     do_fio(&c__1, ch__10, 21L);
  5115. #line 1391 "pmtexb2.f"
  5116.     do_fio(&c__1, (char *)&comtop_1.imeter, (ftnlen)sizeof(integer));
  5117. #line 1391 "pmtexb2.f"
  5118.     do_fio(&c__1, "}%", 2L);
  5119. #line 1391 "pmtexb2.f"
  5120.     e_wsfe();
  5121. #line 1393 "pmtexb2.f"
  5122.     } else if (comtop_1.imeter == 5) {
  5123. #line 1394 "pmtexb2.f"
  5124.     s_wsfe(&io___207);
  5125. /* Writing concatenation */
  5126. #line 1394 "pmtexb2.f"
  5127.     i__3[0] = 1, a__3[0] = s;
  5128. #line 1394 "pmtexb2.f"
  5129.     i__3[1] = 12, a__3[1] = "generalmeter";
  5130. #line 1394 "pmtexb2.f"
  5131.     i__3[2] = 1, a__3[2] = s;
  5132. #line 1394 "pmtexb2.f"
  5133.     i__3[3] = 10, a__3[3] = "allabreve%";
  5134. #line 1394 "pmtexb2.f"
  5135.     s_cat(ch__19, a__3, i__3, &c__4, 24L);
  5136. #line 1394 "pmtexb2.f"
  5137.     do_fio(&c__1, ch__19, 24L);
  5138. #line 1394 "pmtexb2.f"
  5139.     e_wsfe();
  5140. #line 1395 "pmtexb2.f"
  5141.     } else if (comtop_1.imeter == 6) {
  5142. #line 1396 "pmtexb2.f"
  5143.     s_wsfe(&io___208);
  5144. /* Writing concatenation */
  5145. #line 1396 "pmtexb2.f"
  5146.     i__3[0] = 1, a__3[0] = s;
  5147. #line 1396 "pmtexb2.f"
  5148.     i__3[1] = 12, a__3[1] = "generalmeter";
  5149. #line 1396 "pmtexb2.f"
  5150.     i__3[2] = 1, a__3[2] = s;
  5151. #line 1396 "pmtexb2.f"
  5152.     i__3[3] = 7, a__3[3] = "meterC%";
  5153. #line 1396 "pmtexb2.f"
  5154.     s_cat(ch__10, a__3, i__3, &c__4, 21L);
  5155. #line 1396 "pmtexb2.f"
  5156.     do_fio(&c__1, ch__10, 21L);
  5157. #line 1396 "pmtexb2.f"
  5158.     e_wsfe();
  5159. #line 1397 "pmtexb2.f"
  5160.     }
  5161. #line 1398 "pmtexb2.f"
  5162.     ipi = comtop_1.fracindent * comtop_1.widthpt + .1f;
  5163. #line 1399 "pmtexb2.f"
  5164.     if (ipi < 10) {
  5165. #line 1400 "pmtexb2.f"
  5166.     s_wsfe(&io___210);
  5167. /* Writing concatenation */
  5168. #line 1400 "pmtexb2.f"
  5169.     i__2[0] = 1, a__2[0] = s;
  5170. #line 1400 "pmtexb2.f"
  5171.     i__2[1] = 10, a__2[1] = "parindent ";
  5172. #line 1400 "pmtexb2.f"
  5173.     s_cat(ch__9, a__2, i__2, &c__2, 11L);
  5174. #line 1400 "pmtexb2.f"
  5175.     do_fio(&c__1, ch__9, 11L);
  5176. #line 1400 "pmtexb2.f"
  5177.     do_fio(&c__1, (char *)&ipi, (ftnlen)sizeof(integer));
  5178. #line 1400 "pmtexb2.f"
  5179.     do_fio(&c__1, "pt", 2L);
  5180. #line 1400 "pmtexb2.f"
  5181.     e_wsfe();
  5182. #line 1401 "pmtexb2.f"
  5183.     } else {
  5184. #line 1402 "pmtexb2.f"
  5185.     s_wsfe(&io___211);
  5186. /* Writing concatenation */
  5187. #line 1402 "pmtexb2.f"
  5188.     i__2[0] = 1, a__2[0] = s;
  5189. #line 1402 "pmtexb2.f"
  5190.     i__2[1] = 10, a__2[1] = "parindent ";
  5191. #line 1402 "pmtexb2.f"
  5192.     s_cat(ch__9, a__2, i__2, &c__2, 11L);
  5193. #line 1402 "pmtexb2.f"
  5194.     do_fio(&c__1, ch__9, 11L);
  5195. #line 1402 "pmtexb2.f"
  5196.     do_fio(&c__1, (char *)&ipi, (ftnlen)sizeof(integer));
  5197. #line 1402 "pmtexb2.f"
  5198.     do_fio(&c__1, "pt", 2L);
  5199. #line 1402 "pmtexb2.f"
  5200.     e_wsfe();
  5201. #line 1403 "pmtexb2.f"
  5202.     }
  5203. #line 1404 "pmtexb2.f"
  5204.     s_wsfe(&io___212);
  5205. /* Writing concatenation */
  5206. #line 1404 "pmtexb2.f"
  5207.     i__3[0] = 1, a__3[0] = s;
  5208. #line 1404 "pmtexb2.f"
  5209.     i__3[1] = 4, a__3[1] = "null";
  5210. #line 1404 "pmtexb2.f"
  5211.     i__3[2] = 1, a__3[2] = s;
  5212. #line 1404 "pmtexb2.f"
  5213.     i__3[3] = 7, a__3[3] = "bigskip";
  5214. #line 1404 "pmtexb2.f"
  5215.     s_cat(ch__20, a__3, i__3, &c__4, 13L);
  5216. #line 1404 "pmtexb2.f"
  5217.     do_fio(&c__1, ch__20, 13L);
  5218. #line 1404 "pmtexb2.f"
  5219.     e_wsfe();
  5220. #line 1405 "pmtexb2.f"
  5221.     s_wsfe(&io___213);
  5222. /* Writing concatenation */
  5223. #line 1405 "pmtexb2.f"
  5224.     i__2[0] = 1, a__2[0] = s;
  5225. #line 1405 "pmtexb2.f"
  5226.     i__2[1] = 12, a__2[1] = "debutmorceau";
  5227. #line 1405 "pmtexb2.f"
  5228.     s_cat(ch__20, a__2, i__2, &c__2, 13L);
  5229. #line 1405 "pmtexb2.f"
  5230.     do_fio(&c__1, ch__20, 13L);
  5231. #line 1405 "pmtexb2.f"
  5232.     e_wsfe();
  5233. #line 1406 "pmtexb2.f"
  5234.     s_wsfe(&io___214);
  5235. /* Writing concatenation */
  5236. #line 1406 "pmtexb2.f"
  5237.     i__3[0] = 1, a__3[0] = s;
  5238. #line 1406 "pmtexb2.f"
  5239.     i__3[1] = 3, a__3[1] = "def";
  5240. #line 1406 "pmtexb2.f"
  5241.     i__3[2] = 1, a__3[2] = s;
  5242. #line 1406 "pmtexb2.f"
  5243.     i__3[3] = 12, a__3[3] = "freqbarno{5}";
  5244. #line 1406 "pmtexb2.f"
  5245.     s_cat(ch__5, a__3, i__3, &c__4, 17L);
  5246. #line 1406 "pmtexb2.f"
  5247.     do_fio(&c__1, ch__5, 17L);
  5248. #line 1406 "pmtexb2.f"
  5249.     e_wsfe();
  5250. #line 1407 "pmtexb2.f"
  5251.     s_wsfe(&io___215);
  5252. /* Writing concatenation */
  5253. #line 1407 "pmtexb2.f"
  5254.     i__3[0] = 1, a__3[0] = s;
  5255. #line 1407 "pmtexb2.f"
  5256.     i__3[1] = 13, a__3[1] = "linesinpage=0";
  5257. #line 1407 "pmtexb2.f"
  5258.     i__3[2] = 1, a__3[2] = s;
  5259. #line 1407 "pmtexb2.f"
  5260.     i__3[3] = 5, a__3[3] = "relax";
  5261. #line 1407 "pmtexb2.f"
  5262.     s_cat(ch__21, a__3, i__3, &c__4, 20L);
  5263. #line 1407 "pmtexb2.f"
  5264.     do_fio(&c__1, ch__21, 20L);
  5265. #line 1407 "pmtexb2.f"
  5266.     e_wsfe();
  5267. #line 1408 "pmtexb2.f"
  5268.     return 0;
  5269. } /* topfile_ */
  5270.  
  5271. /* Character */ VOID clefnum_(char *ret_val, ftnlen ret_val_len, char *
  5272.     clefname, ftnlen clefname_len)
  5273. {
  5274. #line 1412 "pmtexb2.f"
  5275.     if (*clefname == 'b') {
  5276. #line 1413 "pmtexb2.f"
  5277.     *ret_val = '6';
  5278. #line 1414 "pmtexb2.f"
  5279.     } else if (*clefname == 'a') {
  5280. #line 1415 "pmtexb2.f"
  5281.     *ret_val = '3';
  5282. #line 1416 "pmtexb2.f"
  5283.     } else if (*clefname == 't') {
  5284. #line 1417 "pmtexb2.f"
  5285.     *ret_val = '0';
  5286. #line 1418 "pmtexb2.f"
  5287.     }
  5288. #line 1419 "pmtexb2.f"
  5289.     return ;
  5290. } /* clefnum_ */
  5291.  
  5292. integer ni_(real *x)
  5293. {
  5294.     /* System generated locals */
  5295.     integer ret_val;
  5296.  
  5297. #line 1422 "pmtexb2.f"
  5298.     if (*x >= 0.f) {
  5299. #line 1423 "pmtexb2.f"
  5300.     ret_val = *x + .5001f;
  5301. #line 1424 "pmtexb2.f"
  5302.     } else {
  5303. #line 1425 "pmtexb2.f"
  5304.     ret_val = *x - .5001f;
  5305. #line 1426 "pmtexb2.f"
  5306.     }
  5307. #line 1427 "pmtexb2.f"
  5308.     return ret_val;
  5309. } /* ni_ */
  5310.  
  5311. /* Subroutine */ int setupb_(real *xelsk, integer *nnb, real *sumx, real *
  5312.     sumy, integer *ipb, integer *islope, integer *nolev1, integer *nornb)
  5313. {
  5314.     /* System generated locals */
  5315.     integer i__1, i__2;
  5316.     real r__1, r__2;
  5317.     doublereal d__1;
  5318.  
  5319.     /* Builtin functions */
  5320.     double pow_dd(doublereal *, doublereal *);
  5321.     integer i_sign(integer *, integer *);
  5322.     double sqrt(doublereal);
  5323.  
  5324.     /* Local variables */
  5325.     static real beta, smed, smin, elsperns;
  5326.     static integer i, j;
  5327.     static real t, ybeam;
  5328.     static integer nindx;
  5329.     static real slope[120], ynote;
  5330.     static integer n1, n2, in;
  5331.     extern integer ni_(real *);
  5332.     static integer nscmid;
  5333.     static real dnolev;
  5334.     static integer nolevo, ibc;
  5335.     extern /* Subroutine */ int setupb2_(real *, integer *, real *, real *, 
  5336.         integer *, integer *, integer *);
  5337.     static integer inb, jnb;
  5338.     static real off;
  5339.     static integer nsc;
  5340.     static real deficit;
  5341.     static integer iul;
  5342.     static real syb, ssq, off1, off2, elsksum;
  5343.     extern integer log2_(integer *);
  5344.  
  5345.  
  5346. /* The outer combo algorithm */
  5347.  
  5348. /* ccccccccccc */
  5349. /* c */
  5350. /* c  pmtex.inc */
  5351. /* c */
  5352. /* ccccccccccc */
  5353. #line 1436 "pmtexb2.f"
  5354.     /* Parameter adjustments */
  5355. #line 1436 "pmtexb2.f"
  5356.     --nornb;
  5357. #line 1436 "pmtexb2.f"
  5358.     --ipb;
  5359. #line 1436 "pmtexb2.f"
  5360.     --xelsk;
  5361. #line 1436 "pmtexb2.f"
  5362.  
  5363. #line 1436 "pmtexb2.f"
  5364.     /* Function Body */
  5365. #line 1436 "pmtexb2.f"
  5366.     ibc = all_1.ibmcnt[all_1.iv - 1];
  5367. #line 1437 "pmtexb2.f"
  5368.     n1 = all_1.ipl[all_1.iv + all_1.ibm1[all_1.iv + ibc * 5 - 6] * 5 - 6];
  5369. #line 1438 "pmtexb2.f"
  5370.     n2 = all_1.ipl[all_1.iv + all_1.ibm2[all_1.iv + ibc * 5 - 6] * 5 - 6];
  5371. #line 1439 "pmtexb2.f"
  5372.     nornb[all_1.iv] = 0;
  5373.  
  5374. /* Need to figure how many elemskips to the each note. Use the list, */
  5375. /* counting only those members that have a non-zero interval to next note 
  5376. */
  5377.  
  5378. #line 1444 "pmtexb2.f"
  5379.     elsksum = 0.f;
  5380. #line 1445 "pmtexb2.f"
  5381.     *nnb = 0;
  5382. #line 1446 "pmtexb2.f"
  5383.     *sumx = 0.f;
  5384. #line 1447 "pmtexb2.f"
  5385.     *sumy = 0.f;
  5386. #line 1448 "pmtexb2.f"
  5387.     i__1 = n2;
  5388. #line 1448 "pmtexb2.f"
  5389.     for (in = n1; in <= i__1; ++in) {
  5390. #line 1449 "pmtexb2.f"
  5391.     if (all_1.list[(in << 2) - 4] == all_1.iv && all_1.acc[all_1.iv + 
  5392. #line 1449 "pmtexb2.f"
  5393.         all_1.list[(in << 2) - 3] * 5 - 6] != 'a') {
  5394. #line 1450 "pmtexb2.f"
  5395.         ++(*nnb);
  5396. #line 1451 "pmtexb2.f"
  5397.         ipb[*nnb] = all_1.list[(in << 2) - 3];
  5398. #line 1452 "pmtexb2.f"
  5399.         xelsk[*nnb] = elsksum;
  5400. #line 1453 "pmtexb2.f"
  5401.         *sumx += elsksum;
  5402. #line 1454 "pmtexb2.f"
  5403.         *sumy += all_1.nolev[all_1.iv + ipb[*nnb] * 5 - 6];
  5404. #line 1455 "pmtexb2.f"
  5405.         if (all_1.orn[all_1.iv + ipb[*nnb] * 5 - 6] != 'x') {
  5406. #line 1455 "pmtexb2.f"
  5407.         ++nornb[all_1.iv];
  5408. #line 1455 "pmtexb2.f"
  5409.         }
  5410. #line 1456 "pmtexb2.f"
  5411.     }
  5412. #line 1457 "pmtexb2.f"
  5413.     if (in < n2 && all_1.list[(in << 2) - 1] != 0) {
  5414. #line 1458 "pmtexb2.f"
  5415.         i__2 = all_1.list[(in << 2) - 1] / 2;
  5416. #line 1458 "pmtexb2.f"
  5417.         nindx = log2_(&i__2) + 1;
  5418. #line 1459 "pmtexb2.f"
  5419.         d__1 = (doublereal) ((nindx - 1) / 2.f);
  5420. #line 1459 "pmtexb2.f"
  5421.         elsperns = pow_dd(&c_b763, &d__1);
  5422. #line 1460 "pmtexb2.f"
  5423.         elsksum += elsperns;
  5424. #line 1461 "pmtexb2.f"
  5425.     }
  5426. #line 1462 "pmtexb2.f"
  5427. /* L2: */
  5428. #line 1462 "pmtexb2.f"
  5429.     }
  5430. #line 1463 "pmtexb2.f"
  5431.     nsc = 0;
  5432. #line 1464 "pmtexb2.f"
  5433.     i__1 = *nnb - 1;
  5434. #line 1464 "pmtexb2.f"
  5435.     for (inb = 1; inb <= i__1; ++inb) {
  5436. #line 1465 "pmtexb2.f"
  5437.     i__2 = *nnb;
  5438. #line 1465 "pmtexb2.f"
  5439.     for (jnb = inb + 1; jnb <= i__2; ++jnb) {
  5440. #line 1466 "pmtexb2.f"
  5441.         ++nsc;
  5442. #line 1467 "pmtexb2.f"
  5443.         slope[nsc - 1] = (all_1.nolev[all_1.iv + ipb[jnb] * 5 - 6] - 
  5444. #line 1467 "pmtexb2.f"
  5445.             all_1.nolev[all_1.iv + ipb[inb] * 5 - 6]) / (xelsk[jnb] - 
  5446. #line 1467 "pmtexb2.f"
  5447.             xelsk[inb]);
  5448. #line 1469 "pmtexb2.f"
  5449.         if ((r__1 = slope[nsc - 1], dabs(r__1)) < 1e-4f) {
  5450. #line 1470 "pmtexb2.f"
  5451.         ++nsc;
  5452. #line 1471 "pmtexb2.f"
  5453.         slope[nsc - 1] = slope[nsc - 2];
  5454. #line 1472 "pmtexb2.f"
  5455.         ++nsc;
  5456. #line 1473 "pmtexb2.f"
  5457.         slope[nsc - 1] = slope[nsc - 2];
  5458. #line 1474 "pmtexb2.f"
  5459.         }
  5460. #line 1475 "pmtexb2.f"
  5461. /* L5: */
  5462. #line 1475 "pmtexb2.f"
  5463.     }
  5464. #line 1475 "pmtexb2.f"
  5465.     }
  5466. /*       write(*,'(a7,1x,9f8.2/(8x,9f8.2))')'slopes:',(slope(i),i=1,nsc) 
  5467. */
  5468. #line 1477 "pmtexb2.f"
  5469.     if (nsc == 1) {
  5470. #line 1478 "pmtexb2.f"
  5471.     smed = slope[0];
  5472. #line 1479 "pmtexb2.f"
  5473.     goto L6;
  5474. #line 1480 "pmtexb2.f"
  5475.     }
  5476. #line 1481 "pmtexb2.f"
  5477.     nscmid = nsc / 2 + 1;
  5478. #line 1482 "pmtexb2.f"
  5479.     i__2 = nscmid;
  5480. #line 1482 "pmtexb2.f"
  5481.     for (i = 1; i <= i__2; ++i) {
  5482. #line 1483 "pmtexb2.f"
  5483.     i__1 = nsc;
  5484. #line 1483 "pmtexb2.f"
  5485.     for (j = i + 1; j <= i__1; ++j) {
  5486. #line 1484 "pmtexb2.f"
  5487.         if (slope[j - 1] < slope[i - 1]) {
  5488. #line 1485 "pmtexb2.f"
  5489.         t = slope[j - 1];
  5490. #line 1486 "pmtexb2.f"
  5491.         slope[j - 1] = slope[i - 1];
  5492. #line 1487 "pmtexb2.f"
  5493.         slope[i - 1] = t;
  5494. #line 1488 "pmtexb2.f"
  5495.         }
  5496. #line 1489 "pmtexb2.f"
  5497. /* L7: */
  5498. #line 1489 "pmtexb2.f"
  5499.     }
  5500. #line 1489 "pmtexb2.f"
  5501.     }
  5502. #line 1490 "pmtexb2.f"
  5503.     smed = slope[nscmid - 1];
  5504. #line 1491 "pmtexb2.f"
  5505.     if (nsc == nsc / 2 << 1 && (r__1 = slope[nscmid - 2], dabs(r__1)) < (r__2 
  5506. #line 1491 "pmtexb2.f"
  5507.         = slope[nscmid - 1], dabs(r__2))) {
  5508. #line 1491 "pmtexb2.f"
  5509.     smed = slope[nscmid - 2];
  5510. #line 1491 "pmtexb2.f"
  5511.     }
  5512. #line 1493 "pmtexb2.f"
  5513. L6:
  5514. #line 1494 "pmtexb2.f"
  5515.     r__1 = smed * all_1.slfac;
  5516. #line 1494 "pmtexb2.f"
  5517.     *islope = ni_(&r__1);
  5518. #line 1495 "pmtexb2.f"
  5519.     if (abs(*islope) > 9) {
  5520. #line 1495 "pmtexb2.f"
  5521.     *islope = i_sign(&c__9, islope);
  5522. #line 1495 "pmtexb2.f"
  5523.     }
  5524. /*       beta = (sumy-smed*sumx)/nnb */
  5525. #line 1497 "pmtexb2.f"
  5526.     beta = (*sumy - *islope / all_1.slfac * *sumx) / *nnb;
  5527. #line 1498 "pmtexb2.f"
  5528.     *nolev1 = beta + .5f;
  5529. /* #### Check if any stems are too short */
  5530. #line 1500 "pmtexb2.f"
  5531.     smin = 100.f;
  5532. #line 1501 "pmtexb2.f"
  5533.     iul = -1;
  5534. #line 1502 "pmtexb2.f"
  5535.     if (all_1.ul[all_1.iv + ibc * 5 - 6] == 'u') {
  5536. #line 1502 "pmtexb2.f"
  5537.     iul = 1;
  5538. #line 1502 "pmtexb2.f"
  5539.     }
  5540. #line 1503 "pmtexb2.f"
  5541.     ssq = 0.f;
  5542. #line 1504 "pmtexb2.f"
  5543.     syb = 0.f;
  5544. #line 1505 "pmtexb2.f"
  5545.     i__1 = *nnb;
  5546. #line 1505 "pmtexb2.f"
  5547.     for (inb = 1; inb <= i__1; ++inb) {
  5548. #line 1506 "pmtexb2.f"
  5549.     ybeam = *nolev1 + iul * all_1.stemlen + *islope * xelsk[inb] / 
  5550. #line 1506 "pmtexb2.f"
  5551.         all_1.slfac;
  5552. #line 1507 "pmtexb2.f"
  5553.     syb += ybeam;
  5554. #line 1508 "pmtexb2.f"
  5555.     ynote = (real) all_1.nolev[all_1.iv + ipb[inb] * 5 - 6];
  5556. #line 1509 "pmtexb2.f"
  5557.     off = ybeam - ynote;
  5558. #line 1510 "pmtexb2.f"
  5559.     if (inb == 1) {
  5560. #line 1511 "pmtexb2.f"
  5561.         off1 = off;
  5562. #line 1512 "pmtexb2.f"
  5563.     } else if (inb == *nnb) {
  5564. #line 1513 "pmtexb2.f"
  5565.         off2 = off;
  5566. #line 1514 "pmtexb2.f"
  5567.     }
  5568. #line 1515 "pmtexb2.f"
  5569.     ssq += off * off;
  5570. /* Computing MIN */
  5571. #line 1516 "pmtexb2.f"
  5572.     r__1 = smin, r__2 = iul * off;
  5573. #line 1516 "pmtexb2.f"
  5574.     smin = dmin(r__1,r__2);
  5575. #line 1517 "pmtexb2.f"
  5576. /* L4: */
  5577. #line 1517 "pmtexb2.f"
  5578.     }
  5579. #line 1518 "pmtexb2.f"
  5580.     dnolev = 0.f;
  5581. #line 1519 "pmtexb2.f"
  5582.     if (smin < all_1.stemmin) {
  5583. #line 1520 "pmtexb2.f"
  5584.     deficit = all_1.stemmin - smin;
  5585. #line 1521 "pmtexb2.f"
  5586.     nolevo = *nolev1;
  5587. #line 1522 "pmtexb2.f"
  5588.     r__1 = *nolev1 + iul * deficit;
  5589. #line 1522 "pmtexb2.f"
  5590.     *nolev1 = ni_(&r__1);
  5591. #line 1523 "pmtexb2.f"
  5592.     dnolev = (real) (*nolev1 - nolevo);
  5593. #line 1524 "pmtexb2.f"
  5594.     off1 += dnolev;
  5595. #line 1525 "pmtexb2.f"
  5596.     off2 += dnolev;
  5597. #line 1526 "pmtexb2.f"
  5598.     }
  5599. /* Computing 2nd power */
  5600. #line 1527 "pmtexb2.f"
  5601.     r__1 = dnolev;
  5602. #line 1527 "pmtexb2.f"
  5603.     ssq = ssq + dnolev * 2 * (syb - *sumy) + r__1 * r__1;
  5604. #line 1528 "pmtexb2.f"
  5605.     if (sqrt(ssq / *nnb) > all_1.stemmax && (dabs(off1) < all_1.stemmax || 
  5606. #line 1528 "pmtexb2.f"
  5607.         dabs(off2) < all_1.stemmax)) {
  5608. /*#### The final check before switching is that first and last stems a
  5609. ren't*/
  5610. /*     both excessive. */
  5611. #line 1532 "pmtexb2.f"
  5612.     setupb2_(&xelsk[1], nnb, sumx, sumy, &ipb[1], islope, nolev1);
  5613. #line 1533 "pmtexb2.f"
  5614.     }
  5615. #line 1534 "pmtexb2.f"
  5616.     return 0;
  5617. } /* setupb_ */
  5618.  
  5619. /* Subroutine */ int setupb2_(real *xelsk, integer *nnb, real *sumx, real *
  5620.     sumy, integer *ipb, integer *islope, integer *nolev1)
  5621. {
  5622.     /* System generated locals */
  5623.     integer i__1, i__2;
  5624.     real r__1, r__2;
  5625.     doublereal d__1;
  5626.  
  5627.     /* Builtin functions */
  5628.     double pow_dd(doublereal *, doublereal *);
  5629.     integer i_sign(integer *, integer *);
  5630.  
  5631.     /* Local variables */
  5632.     static real beta, smin, elsperns, y, delta, ybeam;
  5633.     static integer nindx;
  5634.     static real ynote;
  5635.     static integer n1, n2;
  5636.     static real sumxx, sumxy, em;
  5637.     static integer in;
  5638.     extern integer ni_(real *);
  5639.     static integer nolevo, ibc, inb;
  5640.     static real deficit;
  5641.     static integer iul;
  5642.     static real elsksum;
  5643.     extern integer log2_(integer *);
  5644.  
  5645.  
  5646. /* The MEAN SQUARE slope algorithm */
  5647.  
  5648. /* ccccccccccc */
  5649. /* c */
  5650. /* c  pmtex.inc */
  5651. /* c */
  5652. /* ccccccccccc */
  5653. #line 1543 "pmtexb2.f"
  5654.     /* Parameter adjustments */
  5655. #line 1543 "pmtexb2.f"
  5656.     --ipb;
  5657. #line 1543 "pmtexb2.f"
  5658.     --xelsk;
  5659. #line 1543 "pmtexb2.f"
  5660.  
  5661. #line 1543 "pmtexb2.f"
  5662.     /* Function Body */
  5663. #line 1543 "pmtexb2.f"
  5664.     ibc = all_1.ibmcnt[all_1.iv - 1];
  5665. #line 1544 "pmtexb2.f"
  5666.     n1 = all_1.ipl[all_1.iv + all_1.ibm1[all_1.iv + ibc * 5 - 6] * 5 - 6];
  5667. #line 1545 "pmtexb2.f"
  5668.     n2 = all_1.ipl[all_1.iv + all_1.ibm2[all_1.iv + ibc * 5 - 6] * 5 - 6];
  5669.  
  5670. /* Need to figure how many elemskips to the each note. Use the list, */
  5671. /* counting only those members that have a non-zero interval to next note 
  5672. */
  5673.  
  5674. #line 1550 "pmtexb2.f"
  5675.     elsksum = 0.f;
  5676. #line 1551 "pmtexb2.f"
  5677.     *nnb = 0;
  5678. #line 1552 "pmtexb2.f"
  5679.     ipb[1] = n1;
  5680. #line 1553 "pmtexb2.f"
  5681.     *sumx = 0.f;
  5682. #line 1554 "pmtexb2.f"
  5683.     sumxx = 0.f;
  5684. #line 1555 "pmtexb2.f"
  5685.     *sumy = 0.f;
  5686. #line 1556 "pmtexb2.f"
  5687.     sumxy = 0.f;
  5688. #line 1557 "pmtexb2.f"
  5689.     i__1 = n2;
  5690. #line 1557 "pmtexb2.f"
  5691.     for (in = n1; in <= i__1; ++in) {
  5692. #line 1558 "pmtexb2.f"
  5693.     if (all_1.list[(in << 2) - 4] == all_1.iv && all_1.acc[all_1.iv + 
  5694. #line 1558 "pmtexb2.f"
  5695.         all_1.list[(in << 2) - 3] * 5 - 6] != 'a') {
  5696. #line 1559 "pmtexb2.f"
  5697.         ++(*nnb);
  5698. #line 1560 "pmtexb2.f"
  5699.         ipb[*nnb] = all_1.list[(in << 2) - 3];
  5700. #line 1561 "pmtexb2.f"
  5701.         xelsk[*nnb] = elsksum;
  5702. #line 1562 "pmtexb2.f"
  5703.         *sumx += elsksum;
  5704. #line 1563 "pmtexb2.f"
  5705.         sumxx += elsksum * elsksum;
  5706. #line 1564 "pmtexb2.f"
  5707.         y = (real) all_1.nolev[all_1.iv + all_1.list[(in << 2) - 3] * 5 - 
  5708. #line 1564 "pmtexb2.f"
  5709.             6];
  5710. #line 1565 "pmtexb2.f"
  5711.         *sumy += y;
  5712. #line 1566 "pmtexb2.f"
  5713.         sumxy += elsksum * y;
  5714. #line 1567 "pmtexb2.f"
  5715.     }
  5716. #line 1568 "pmtexb2.f"
  5717.     if (in < n2 && all_1.list[(in << 2) - 1] != 0) {
  5718. #line 1569 "pmtexb2.f"
  5719.         i__2 = all_1.list[(in << 2) - 1] / 2;
  5720. #line 1569 "pmtexb2.f"
  5721.         nindx = log2_(&i__2) + 1;
  5722. #line 1570 "pmtexb2.f"
  5723.         d__1 = (doublereal) ((nindx - 1) / 2.f);
  5724. #line 1570 "pmtexb2.f"
  5725.         elsperns = pow_dd(&c_b763, &d__1);
  5726. #line 1571 "pmtexb2.f"
  5727.         elsksum += elsperns;
  5728. #line 1572 "pmtexb2.f"
  5729.     }
  5730. #line 1573 "pmtexb2.f"
  5731. /* L2: */
  5732. #line 1573 "pmtexb2.f"
  5733.     }
  5734. #line 1574 "pmtexb2.f"
  5735.     delta = *nnb * sumxx - *sumx * *sumx;
  5736. #line 1575 "pmtexb2.f"
  5737.     em = (*nnb * sumxy - *sumx * *sumy) / delta;
  5738. #line 1576 "pmtexb2.f"
  5739.     r__1 = em * all_1.slfac;
  5740. #line 1576 "pmtexb2.f"
  5741.     *islope = ni_(&r__1);
  5742. #line 1577 "pmtexb2.f"
  5743.     if (abs(*islope) > 9) {
  5744. #line 1578 "pmtexb2.f"
  5745.     *islope = i_sign(&c__9, islope);
  5746. #line 1579 "pmtexb2.f"
  5747.     beta = (*sumy - *islope / all_1.slfac * *sumx) / *nnb;
  5748. #line 1580 "pmtexb2.f"
  5749.     } else {
  5750. #line 1581 "pmtexb2.f"
  5751.     beta = (*sumy * sumxx - *sumx * sumxy) / delta;
  5752. #line 1582 "pmtexb2.f"
  5753.     }
  5754. #line 1583 "pmtexb2.f"
  5755.     *nolev1 = beta + .5f;
  5756. /* #### Check if any stems are too short */
  5757. #line 1585 "pmtexb2.f"
  5758.     smin = 100.f;
  5759. #line 1586 "pmtexb2.f"
  5760.     iul = -1;
  5761. #line 1587 "pmtexb2.f"
  5762.     if (all_1.ul[all_1.iv + ibc * 5 - 6] == 'u') {
  5763. #line 1587 "pmtexb2.f"
  5764.     iul = 1;
  5765. #line 1587 "pmtexb2.f"
  5766.     }
  5767. #line 1588 "pmtexb2.f"
  5768.     i__1 = *nnb;
  5769. #line 1588 "pmtexb2.f"
  5770.     for (inb = 1; inb <= i__1; ++inb) {
  5771. #line 1589 "pmtexb2.f"
  5772.     ybeam = *nolev1 + iul * all_1.stemlen + *islope * xelsk[inb] / 
  5773. #line 1589 "pmtexb2.f"
  5774.         all_1.slfac;
  5775. #line 1590 "pmtexb2.f"
  5776.     ynote = (real) all_1.nolev[all_1.iv + ipb[inb] * 5 - 6];
  5777. /* Computing MIN */
  5778. #line 1591 "pmtexb2.f"
  5779.     r__1 = smin, r__2 = iul * (ybeam - ynote);
  5780. #line 1591 "pmtexb2.f"
  5781.     smin = dmin(r__1,r__2);
  5782. #line 1592 "pmtexb2.f"
  5783. /* L4: */
  5784. #line 1592 "pmtexb2.f"
  5785.     }
  5786. #line 1593 "pmtexb2.f"
  5787.     if (smin < all_1.stemmin) {
  5788. #line 1594 "pmtexb2.f"
  5789.     deficit = all_1.stemmin - smin;
  5790. #line 1595 "pmtexb2.f"
  5791.     nolevo = *nolev1;
  5792. #line 1596 "pmtexb2.f"
  5793.     r__1 = *nolev1 + iul * deficit;
  5794. #line 1596 "pmtexb2.f"
  5795.     *nolev1 = ni_(&r__1);
  5796. #line 1597 "pmtexb2.f"
  5797.     }
  5798. #line 1598 "pmtexb2.f"
  5799.     return 0;
  5800. } /* setupb2_ */
  5801.  
  5802.