w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

prepmx.c
Go to the documentation of this file.
1 /* Output from p2c 1.21alpha-07.Dec.93, the Pascal-to-C translator */
2 /* From input file "prepmx.pas" */
3 
4 
5 #include "p2c.h"
6 
7 
8 #ifndef CONTROL_H
9 #include "control.h"
10 #endif
11 
12 #ifndef STRINGS_H
13 #include "strings.h"
14 #endif
15 
16 #ifndef GLOBALS_H
17 #include "globals.h"
18 #endif
19 
20 #ifndef PREAMBLE_H
21 #include "preamble.h"
22 #endif
23 
24 #ifndef LYRICS_H
25 #include "lyrics.h"
26 #endif
27 
28 #ifndef MTX_H
29 #include "mtx.h"
30 #endif
31 
32 #ifndef ANALYZE_H
33 #include "analyze.h"
34 #endif
35 
36 #ifndef MTXLINE_H
37 #include "mtxline.h"
38 #endif
39 
40 #ifndef STATUS_H
41 #include "status.h"
42 #endif
43 
44 #ifndef UPTEXT_H
45 #include "uptext.h"
46 #endif
47 
48 #ifndef NOTES_H
49 #include "notes.h"
50 #endif
51 
52 #ifndef MULTFILE_H
53 #include "multfile.h"
54 #endif
55 
56 #ifndef FILES_H
57 #include "files.h"
58 #endif
59 
60 #ifndef UTILITY_H
61 #include "utility.h"
62 #endif
63 
64 
65 /* CMO: addition/change by Christian Mondrup */
66 
67 /** M-Tx preprocessor to PMX Dirk Laurie */
68 
69 #define version "0.63a"
70 #define version_date "<8 April 2018>"
71 
72 /** See file "Corrections" for updates */
73 
74 /** To do next:
75 {* Current bugs:
76 {* Old bugs:
77  Does not check PMX syntax
78 {* Weaknesses that may later cause bugs:
79  Decisions sometimes made on note, sometimes on scan
80  Can 'here' overrun?
81  Where does one note stop and the next begin?
82  See comment on '!' in uptext
83 */
84 
85 #define chord_flat 't'
86 #define chord_left 'l'
87 
88 #define blind true
89 #define visible false
90 
91 
92 Static boolean last_bar;
94 /*, bars_of_rest*/
96 
97 
98 /* --------------- Bars and rests --------------- */
99 
101 {
102  Char repcode[256];
103  Char STR1[256];
104 
105  if (*bar == '\0')
106  return;
107  *repcode = '\0';
108  if (!strcmp(bar, "||"))
109  strcpy(repcode, "Rd");
110  else if (!strcmp(bar, "|]"))
111  strcpy(repcode, "RD");
112  else if (!strcmp(bar, "|:"))
113  strcpy(repcode, "Rl");
114  else if (!strcmp(bar, ":|:"))
115  strcpy(repcode, "Rlr");
116  else if (!strcmp(bar, ":|"))
117  strcpy(repcode, "Rr");
118  else if (last_bar && !strcmp(bar, "|"))
119  strcpy(repcode, "Rb");
120  if (*repcode != '\0') {
121  sprintf(STR1, " %s", repcode);
122  putLine(STR1);
123  }
124  *bar = '\0';
125 }
126 
127 
129 {
130  Char STR2[4];
131  Char STR3[256];
132 
133  if (bar_of_line == 1 && pedanticWarnings()) {
134  printf("Bar %d Voice %d", bar_no, voice);
135  warning(" Filling missing voice with rests", !print);
136  }
137  if (pickup > 0)
139  sprintf(STR2, "%s ", pause);
140  put(STR2, putspace);
141 }
142 
143 
144 /* Local variables for processLine: */
147  Char chords[256], note[256], cutnote[256], pretex[256];
148  short ngrace, nmulti;
150 
151  short l;
152  boolean in_group;
153 } ;
154 
155 Local void output(Char *note_, struct LOC_processLine *LINK)
156 {
157  Char note[256];
158  Char STR2[256];
159 
160  strcpy(note, note_);
161  if (*note != '\0')
162  { /* pretex is saved up until a spacing note or rest comes */
163  if (endsWith(note, "\\") && note[1] != '\\') {
164  curtail(note, '\\');
165  strcat(LINK->pretex, note);
166  *note = '\0';
167  return;
168  }
169  if (*LINK->pretex != '\0' && isNoteOrRest(note)) {
170  sprintf(note, "%s\\ %s", LINK->pretex, strcpy(STR2, note));
171  *LINK->pretex = '\0';
172  }
173  if (outlen > 0 && note[0] != ' ')
174  sprintf(note, " %s", strcpy(STR2, note));
175  put(note, nospace);
176  }
177  if (thisNote(LINK->voice) == nextvoice)
178  putLine("");
179 }
180 
181 Local void maybeDotted(Char *note, struct LOC_processLine *LINK)
182 {
183  if (strlen(note) < 2)
184  return;
185  if (note[1] == '"') {
186  note[1] = note[0];
187  strcat(LINK->pretex, "\\mtxDotted");
188  }
189 }
190 
191 /* Local variables for addChords: */
194  Char nt[256], labels[256];
195  boolean tieme;
198 } ;
199 
200 Local void outChord(struct LOC_addChords *LINK)
201 {
202  short k;
203  Char STR2[256];
204  short FORLIM;
205 
206  if (*LINK->nt == '\0')
207  return;
208  LINK->tieme = (LINK->nt[0] == '{');
209  if (LINK->tieme)
210  predelete(LINK->nt, 1);
211  if (*LINK->nt == '\0' || LINK->nt[0] < 'a' || LINK->nt[0] > 'g') {
212  sprintf(STR2, "Must have a note name at the start of \"%s\", not \"%c\"",
213  LINK->nt, LINK->nt[0]);
214  error(STR2, print);
215  }
216  renewChordPitch(LINK->LINK->voice, LINK->nt);
217  sprintf(LINK->LINK->chords + strlen(LINK->LINK->chords), " z%s", LINK->nt);
218  *LINK->nt = '\0';
219  FORLIM = strlen(LINK->labels);
220  for (k = 0; k <= FORLIM - 1; k++) {
221  if (chordPitch(LINK->LINK->voice) == LINK->pitches[k]) {
222  sprintf(LINK->LINK->chords + strlen(LINK->LINK->chords), " s%ct",
223  LINK->labels[k]);
224  LINK->labels[k] = ' ';
225  }
226  }
227  if (LINK->tieme) {
228  chordTie(LINK->LINK->voice, &LINK->lab);
229  sprintf(LINK->LINK->chords + strlen(LINK->LINK->chords), " s%ct",
230  LINK->lab);
231  }
232 }
233 
234 Local void addChords(struct LOC_processLine *LINK)
235 {
236  struct LOC_addChords V;
237  Char w[256];
238  short j = 1;
239  short mus_line;
240  paragraph_index0 chord_line;
241  boolean arpeggio;
242  Char STR1[256];
243  short FORLIM;
244 
245  V.LINK = LINK;
247  getChordTies(LINK->voice, V.pitches, V.labels);
248  *LINK->chords = '\0';
249  chord_line = chordLineNo(LINK->voice);
250  if (chord_line == 0)
251  LINK->no_chords = true;
252  if (LINK->no_chords)
253  return;
254  GetNextWord(w, P[chord_line-1], blank, dummy);
255  sprintf(STR1, "%c", barsym);
256  if (!strcmp(w, STR1) || *w == '\0')
257  LINK->no_chords = true;
258  sprintf(STR1, "%c", tilde);
259  if (!strcmp(w, STR1) || LINK->no_chords)
260  return;
261  mus_line = line_no;
262  line_no = orig_line_no[chord_line-1];
263  arpeggio = (w[0] == '?');
264  if (arpeggio) {
265  strcpy(LINK->chords, " ?");
266  predelete(w, 1);
267  }
268  *V.nt = '\0';
269  while (j <= strlen(w)) {
270  if (w[j-1] == '{' || strcmp(V.nt, "{") && w[j-1] >= 'a' && w[j-1] <= 'g')
271  outChord(&V);
272  else if (w[j-1] == chord_flat)
273  w[j-1] = 'f';
274  else if (w[j-1] == chord_left)
275  w[j-1] = 'e';
276  sprintf(V.nt + strlen(V.nt), "%c", w[j-1]);
277  j++;
278  }
279  if (*V.nt != '\0')
280  outChord(&V);
281  if (arpeggio)
282  strcat(LINK->chords, " ?");
283  strcat(LINK->note, LINK->chords);
284  FORLIM = strlen(V.labels);
285  for (j = 0; j <= FORLIM - 1; j++) {
286  if (V.labels[j] != ' ')
287  error("Tie on chord note started but not finished", print);
288  }
289  line_no = mus_line;
290 }
291 
292 Local Char *processOther(Char *Result, Char *note_,
293  struct LOC_processLine *LINK)
294 {
295  Char note[256];
296 
297  strcpy(note, note_);
298  switch (thisNote(LINK->voice)) {
299 
300  case other:
301  if (note[0] == grace_group) {
302  if (strlen(note) == 1)
303  LINK->ngrace = 1;
304  else
305  LINK->ngrace = pos1(note[1], digits);
306  if (LINK->ngrace > 0)
307  LINK->ngrace--;
308  }
309  break;
310 
311  /* For a zword, take note of pitch but do not change the contents */
312  /* Add spurious duration because repitch expects duration to be present */
313  case zword:
314  strcpy(LINK->cutnote, note);
315  predelete(LINK->cutnote, 1);
316  insertChar('4', LINK->cutnote, 2);
319  break;
320 
321  case lyrtag:
322  extractLyrtag(LINK->voice, note);
323  break;
324 
325  case rbrac:
326  endBeam(LINK->voice);
327  break;
328 
329  case rparen:
330  case rlparen:
331  endSlur(LINK->voice, note);
332  break;
333 
334  case lbrac:
335  beginBeam(LINK->voice, note);
336  break;
337 
338  case lparen:
339  maybeDotted(note, LINK);
340  beginSlur(LINK->voice, note);
341  break;
342 
343  case mword:
344  error3(LINK->voice, "Meter change must be the first word of its bar");
345  break;
346 
347  case atword:
348  lyricsAdjust(LINK->voice, note);
349  break;
350  }
351  return strcpy(Result, note);
352 }
353 
355 {
356  Char STR2[256];
357  Char STR3[256];
358 
359  while (bind_left[(long)nextNote(LINK->voice)])
360  sprintf(LINK->note + strlen(LINK->note), " %s",
362 }
363 
365 {
366  if (hasVerseNumber(LINK->voice))
367  strcat(LINK->pretex, "\\mtxVerse");
368  LINK->l = pos1(multi_group, LINK->note);
369  if (LINK->l > 0)
370  scan1(LINK->note, LINK->l + 1, &LINK->nmulti);
372  LINK->in_group = false;
373  if (LINK->ngrace > 0) {
374  LINK->in_group = true;
375  LINK->ngrace--;
376  } else {
377  if (LINK->nmulti > 0) {
378  LINK->in_group = true;
379  LINK->nmulti--;
380  }
381  }
384  if (!LINK->in_group) {
387  }
388  lookahead(LINK);
391  addChords(LINK);
392 }
393 
394 
395 /* ---------------------------------------------------------------- */
396 
398 {
399  struct LOC_processLine V;
400  paragraph_index par_line;
401  Char STR1[256];
402 
403  V.voice = voice_;
404  *V.pretex = '\0';
405  V.no_chords = false;
406  V.no_uptext = false;
407  par_line = musicLineNo(V.voice);
408  V.nmulti = 0;
409  V.ngrace = 0;
410  line_no = orig_line_no[par_line-1];
411  do {
412  getMusicWord(V.note, V.voice);
413  if (*V.note == '\0')
414  return;
415  /* if debugMode then writeln(voice,' ',note); */
416  switch (thisNote(V.voice)) {
417 
418  case rword:
419  if (*multi_bar_rest != '\0') {
420  if (uptextOnRests())
421  addUptext(V.voice, &V.no_uptext, V.pretex);
422  } else {
423  V.l = pos1(multi_group, V.note);
424  if (V.l > 0)
425  scan1(V.note, V.l + 1, &V.nmulti);
426  if (V.nmulti > 0) {
427  V.in_group = true;
428  V.nmulti--;
429  }
430  if (uptextOnRests())
431  addUptext(V.voice, &V.no_uptext, V.pretex);
432  if (!(isPause(V.note) || V.in_group))
433  /*0.63: allow rests in xtuples*/
434  resetDuration(V.voice, durationCode(V.note));
435  }
436  break;
437 
438  case abcdefg:
439  processUsual(&V);
440  break;
441 
442  case barword:
443  if (V.voice == nvoices) {
444  if (endOfBar(V.voice, bar_no))
445  strcpy(repeat_sign, V.note);
446  else
447  writeRepeat(V.note);
448  }
449  sprintf(STR1, "%c", barsym);
450  if (strcmp(V.note, STR1))
451  *V.note = '\0';
452  V.no_chords = false;
453  break;
454 
455  case FirstOnly:
456  if (V.voice != nvoices)
457  *V.note = '\0';
458  else
459  strcpy(V.note, processOther(STR1, V.note, &V));
460  break;
461 
462  default:
463  strcpy(V.note, processOther(STR1, V.note, &V));
464  break;
465  }
466  output(V.note, &V);
467  } while (!endOfBar(V.voice, bar_no));
468  if (!V.no_chords)
469  skipChordBar(V.voice);
470 }
471 
472 
473 /* ------------------------------------------------------------------- */
474 
476 {
477  short pn1, pn2;
478  Char w[256], new_command[256];
479 
480  if (nextNote(voice) != mword)
481  return;
482  getMusicWord(w, voice);
483  getMeter(w, &meternum, &meterdenom, &pn1, &pn2);
484  full_bar = meternum * (64 / meterdenom);
485  /* CMO: process denominator value with function PMXmeterdenom */
486  meterWord(new_command, meternum, PMXmeterdenom(meterdenom), pn1, pn2);
487  if (*new_meter != '\0' && strcmp(new_meter, new_command))
488  error3(voice, "The same meter change must appear in all voices");
489  strcpy(new_meter, new_command);
490 }
491 
492 
493 /* Local variables for musicParagraph: */
496 } ;
497 
499 {
500  paragraph_index i, FORLIM;
501 
502  FORLIM = para_len;
503  for (i = 0; i <= FORLIM - 1; i++) {
504  if (startsWith(P[i], double_comment)) {
505  predelete(P[i], 2);
506  putLine(P[i]);
507  strcpy(P[i], "%");
508  }
509  }
510 }
511 
513 {
514  paragraph_index0 m, cm;
515  voice_index voice, cvoice;
516  boolean ignore_voice;
517  boolean wrote_repeat = false;
518  boolean alone;
519  Char STR2[256];
520  Char STR3[256];
521 
522  if (bar_of_line > 1) {
523  sprintf(STR3, "%cBar %s", comment, toString(STR2, bar_no));
524  putLine(STR3);
525  }
527  if (last_bar && !strcmp(repeat_sign, "|"))
528  *repeat_sign = '\0';
530  *LINK->new_meter = '\0';
531  for (voice = nvoices; voice >= 1; voice--) {
532  if (musicLineNo(voice) > 0) {
535  }
536  }
537  if (last_bar && *LINK->new_meter == '\0' && nleft > pickup && meternum > 0)
538  meterChange(LINK->new_meter, nleft, 64, true);
539  if (*LINK->new_meter != '\0')
540  putLine(LINK->new_meter);
541  for (voice = nvoices; voice >= 1; voice--) {
542  ignore_voice = !selected[voice-1];
543  cvoice = companion(voice);
544  m = musicLineNo(voice);
545  cm = musicLineNo(cvoice);
546  alone = (voice == cvoice || m > 0 && cm == 0 ||
547  m == 0 && cm == 0 && voice < cvoice || !selected[cvoice-1]);
548  if (selected[voice-1]) {
549  if (m > 0)
551  else if (alone)
553  else
554  ignore_voice = true;
555  if (last_bar && *repeat_sign != '\0' && !wrote_repeat) {
557  wrote_repeat = true;
558  }
559  if (!ignore_voice) {
560  if (alone || voicePos(voice) == 1)
561  putLine(" /");
562  else
563  putLine(" //");
564  }
565  }
566  }
567  bar_no++;
568  pickup = 0;
569  putLine("");
570 }
571 
572 Local void putMeter(Char *new_meter_word, struct LOC_musicParagraph *LINK)
573 {
574  if (strcmp(new_meter_word, old_meter_word))
575  putLine(new_meter_word);
576  strcpy(old_meter_word, new_meter_word);
577 }
578 
580 {
581  short s, bars_of_rest;
582  Char mbr[256];
583  short FORLIM;
584  Char STR1[256];
585  Char STR3[256];
586 
587  strcpy(mbr, multi_bar_rest);
588  predelete(mbr, 2);
589  getNum(mbr, &bars_of_rest);
590  bar_no += bars_of_rest;
591  FORLIM = nstaves;
592  for (s = 1; s <= FORLIM; s++) {
593  if (pickup > 0)
595  sprintf(STR3, "rm%s /", toString(STR1, bars_of_rest));
596  putLine(STR3);
597  }
598  putLine("");
599 }
600 
601 
603 {
604  struct LOC_musicParagraph V;
605  voice_index0 j, nvoice;
606  Char lyrassign[256];
607  Char STR1[256];
608  Char STR2[256];
609  Char STR3[256], STR4[256], STR5[256];
610  voice_index0 FORLIM;
611  short FORLIM1;
612 
613  paragraphSetup(&nvoice);
614  if (nvoice == 0) {
615  nonMusic();
616  return;
617  }
618  if (nvoice > nvoices) {
619  if (nvoice == 0)
620  error("No voices! Did you remember to to supply a Style?", !print);
621  sprintf(STR4, "Paragraph has %s voices but Style allows only %s",
622  toString(STR1, nvoice), toString(STR2, nvoices));
623  error(STR4, !print);
624  return;
625  }
626  if (first_paragraph)
628  if (pmx_preamble_done && (!final_paragraph || nvoice > 0)) {
629  sprintf(STR5, "%c Paragraph %s line %s bar %s",
630  comment, toString(STR1, paragraph_no),
631  toString(STR2, orig_line_no[0]), toString(STR3, bar_no));
632  putLine(STR5);
633  }
634  testParagraph();
636  if (beVerbose())
638  /* ---- Knowing the score, we can start setting music ---------------- */
639  if (!pmx_preamble_done) {
640  doPMXpreamble();
641  sprintf(STR3, "%c Paragraph %s line %s bar ",
642  comment, toString(STR1, paragraph_no),
643  toString(STR2, orig_line_no[0]));
644  put(STR3, putspace);
645  if (pickup > 0)
646  putLine("0");
647  else
648  putLine("1");
649  }
650  putPMXlines(&V);
651  if (must_restyle)
652  restyle();
653  if (some_vocal && (nvoice > 0 || !final_paragraph)) {
654  FORLIM = ninstr;
655  for (j = 1; j <= FORLIM; j++) {
656  assignLyrics(j, lyrassign);
657  if (*lyrassign != '\0') {
658  sprintf(STR2, "\\\\%s\\", lyrassign);
659  putLine(STR2);
660  }
661  }
662  }
663  if (must_respace)
664  respace();
665  if (meternum == 0)
667  if (nleft > 0)
668  nbars++;
669  if (nbars == 0 && *multi_bar_rest != '\0')
670  processMBR(&V);
671  else {
672  FORLIM1 = nbars;
673  for (bar_of_line = 1; bar_of_line <= FORLIM1; bar_of_line++)
674  processOneBar(&V);
675  }
677 }
678 
679 
680 /* ----------------------------------------------------------------------- */
681 
683 
684 
685 Static void doMusic(void)
686 {
687  Char STR1[256], STR2[256];
688  Char STR4[256];
689 
690  first_paragraph = true;
691  pmx_preamble_done = false;
692  bar_no = 1;
693  *repeat_sign = '\0';
694  must_respace = false;
695  must_restyle = false;
696  do {
698  memcpy(orig_P, P, sizeof(paragraph));
699  if (para_len > 0 && !ignore_input && thisCase()) {
700  if (no_commands_yet) {
702  printFeatures(false);
703  one_beat = 64 / meterdenom;
705  if (nvoices > standardPMXvoices) {
706  sprintf(STR4, "You have %s voices; standard PMX can only handle %s",
708  warning(STR4, !print);
709  }
710  initMTX();
711  initUptext();
712  initStatus();
713  initLyrics();
714  no_commands_yet = false;
715  }
716  if (startsWithBracedWord(P[0]))
717  lyricsParagraph();
718  else {
719  musicParagraph();
720  first_paragraph = false;
722  }
723  }
725  } while (para_len != 0);
726 }
727 
728 
730 
731 
733 {
734  paragraph_index0 commands = 0, labels = 0, voices = 0, guff = 0;
736  Char w[256];
737 
738 /* p2c: prepmx.pas: Note: Eliminated unused assignment statement [338] */
739  for (i = 0; i <= para_len - 1; i++) {
740  if (!startsWith(P[i], "%")) {
741  NextWord(w, P[i], ' ', ':');
742  if (!endsWith(w, ":"))
743  guff++;
744  else if (strlen(w) < 3 || findVoice(w) > 0)
745  voices++;
746  else if (isCommand(w))
747  commands++;
748  else
749  labels++;
750  }
751  }
752  if (voices + guff > commands)
753  return false;
754  return true;
755 }
756 
757 
759 {
760  Char STR2[24];
761  Char STR3[30];
762 
763  putLine("---");
764  sprintf(STR2, "\\def\\mtxversion{%s}", version);
765  putLine(STR2);
766  sprintf(STR3, "\\def\\mtxdate{%s}", version_date);
767  putLine(STR3);
768  putLine("\\input mtx");
769 }
770 
771 
772 main(int argc, Char *argv[])
773 { /* ---- Main program ------------------------ */
777  printf("==> This is M-Tx %s (Music from TeXt) %s\n", version, version_date);
778 
779  mtxLevel(version);
780  OpenFiles();
781  no_commands_yet = true;
783  no_report_errors = false;
784  topOfPMXfile();
785  do {
788  if (control_paragraph) {
790  no_report_errors = true;
791  if (para_len == 0)
792  error("No music paragraphs!", !print);
793  }
794  } while (control_paragraph);
795  doPreamble();
796  doMusic();
797  if (!pmx_preamble_done)
798  error("No music paragraphs!", !print);
799  putLine("% Coded by M-Tx");
800  CloseFiles();
801  printf("PrePMX done. Now run PMX.\n");
802  _Escape(0);
804 }
805 
806 
807 
808 
809 /* End. */
void insertChar(char c, char *s, short p)
Definition: cfuncs.c:77
int _Escape(int exitcode)
Definition: cfuncs.c:11
void predelete(char *s, short l)
Definition: cfuncs.c:40
void getNum(char *line, short *k)
Definition: cfuncs.c:57
boolean startsWith(char *s1, char *s2)
Definition: cfuncs.c:72
void PASCAL_MAIN(int npars, char **pars)
Definition: cfuncs.c:23
short pos1(char c, char *s)
Definition: cfuncs.c:30
void scan1(char *s, short p, short *n)
Definition: cfuncs.c:26
#define Local
Definition: cfuncs.h:10
#define Static
Definition: cfuncs.h:9
static struct sed_label * labels
Definition: compile.c:117
boolean pedanticWarnings(void)
Definition: control.c:212
void mtxLevel(char *level)
Definition: control.c:126
boolean uptextOnRests(void)
Definition: control.c:224
void printFeatures(boolean anyway)
Definition: control.c:80
int dummy
Definition: dummy.c:29
int w
Definition: dviconv.c:26
void CloseFiles(void)
Definition: dvi2xx.c:1018
int strcmp()
Definition: coll.cpp:143
int printf()
char * strcpy()
#define error(a)
Definition: dviinfo.c:48
void OpenFiles(void)
Definition: files.c:246
boolean endOfInfile(void)
Definition: files.c:33
void readParagraph(char(*P)[256], short *no, paragraph_index0 *L)
Definition: files.c:328
void putLine(char *line)
Definition: files.c:81
static int voice
#define s
Definition: afcover.h:80
U_NAMESPACE_BEGIN UBool beVerbose
Definition: gennorm2.cpp:47
char * meterChange(char *Result, short n1, short n2, boolean blind)
Definition: globals.c:70
void getMeter(char *line_, short *meternum, short *meterdenom, short *pmnum, short *pmdenom)
Definition: globals.c:163
char old_meter_word[256]
Definition: globals.c:20
boolean isNoteOrRest(char *w)
Definition: globals.c:37
short outlen
Definition: globals.c:21
short PMXmeterdenom(short denom)
Definition: globals.c:303
char double_comment[3]
Definition: globals.c:12
boolean ignore_input
Definition: globals.c:22
char * meterWord(char *Result, short num, short denom, short pnum, short pdenom)
Definition: globals.c:58
boolean isPause(char *note)
Definition: globals.c:43
paragraph_index0 para_len
boolean pmx_preamble_done
boolean must_respace
Definition: globals.h:127
#define putspace
Definition: globals.h:71
short pickup
Definition: globals.h:116
short one_beat
short full_bar
Definition: globals.h:115
Char this_version[256]
Definition: globals.h:124
#define pause
Definition: globals.h:48
boolean must_restyle
Definition: globals.h:127
Char paragraph[100][256]
Definition: globals.h:92
short line_no
Definition: globals.h:115
short nleft
Definition: globals.h:117
#define grace_group
Definition: globals.h:51
char voice_index
Definition: globals.h:78
paragraph orig_P
Definition: globals.h:120
short meternum
Definition: globals.h:115
#define nospace
Definition: globals.h:72
paragraph P
voice_index0 nstaves
Definition: globals.h:114
boolean first_paragraph
Definition: globals.h:126
boolean some_vocal
Definition: globals.h:127
boolean final_paragraph
Definition: globals.h:126
short paragraph_no
Definition: globals.h:116
short meterdenom
Definition: globals.h:116
short nbars
Definition: globals.h:116
short bar_no
Definition: globals.h:116
Char this_version_date[256]
Definition: globals.h:124
line_nos orig_line_no
char paragraph_index
Definition: globals.h:76
#define blank
Definition: globals.h:55
#define barsym
Definition: globals.h:53
char voice_index0
Definition: globals.h:88
#define standardPMXvoices
Definition: globals.h:36
char paragraph_index0
Definition: globals.h:86
#define multi_group
Definition: globals.h:52
voice_index0 nvoices
Char multi_bar_rest[256]
Definition: globals.h:125
#define memcpy(d, s, n)
Definition: gsftopk.c:64
char comment[255+1]
Definition: hbf2gf.c:350
#define EXIT_SUCCESS
Definition: cdjpeg.h:175
small capitals from c petite p scientific i
Definition: afcover.h:80
void exit()
void warning(char msg[])
Definition: utils.c:72
#define sprintf
Definition: snprintf.c:44
void lyricsAdjust(voice_index voice, char *note)
Definition: lyrics.c:577
void lyricsParagraph(void)
Definition: lyrics.c:178
void assignLyrics(stave_index stave, char *lyrassign)
Definition: lyrics.c:518
boolean hasVerseNumber(voice_index voice)
Definition: lyrics.c:113
void initLyrics(void)
Definition: lyrics.c:317
void extractLyrtag(voice_index voice, char *note)
Definition: lyrics.c:371
void getSyllable(voice_index voice_, char *pretex)
Definition: lyrics.c:782
void includeStartString(void)
Definition: analyze.c:41
void paragraphSetup(voice_index0 *voice_)
Definition: analyze.c:313
void describeParagraph(void)
Definition: analyze.c:152
void testParagraph(void)
Definition: analyze.c:72
void initMTX(void)
Definition: mtx.c:468
void checkOctave(voice_index voice, char *note)
Definition: mtx.c:160
char * rests(char *Result, short len, short meterdenom, boolean blind)
Definition: mtx.c:72
void markDebeamed(voice_index voice, char *note)
Definition: mtx.c:189
boolean endOfBar(voice_index voice, short bar_no)
Definition: mtxline.c:422
music_word nextNote(voice_index voice)
Definition: mtxline.c:413
paragraph_index0 chordLineNo(voice_index voice)
Definition: mtxline.c:125
paragraph_index0 musicLineNo(voice_index voice)
Definition: mtxline.c:113
voice_index0 findVoice(char *w_)
Definition: mtxline.c:328
void skipChordBar(voice_index voice)
Definition: mtxline.c:81
music_word thisNote(voice_index voice)
Definition: mtxline.c:404
boolean bind_left[22]
Definition: mtxline.c:12
char * getMusicWord(char *Result, voice_index voice)
Definition: mtxline.c:440
void error3(voice_index voice, char *message)
Definition: mtxline.c:365
voice_index companion(voice_index voice)
Definition: mtxline.c:171
stave_index voicePos(voice_index voice)
Definition: mtxline.c:165
short beatsPerLine(void)
Definition: mtxline.c:59
void gotoBar(voice_index voice, short bar_no)
Definition: mtxline.c:431
boolean selected[15]
@ barword
Definition: mtxline.h:23
@ rword
Definition: mtxline.h:23
@ FirstOnly
Definition: mtxline.h:24
@ rbrac
Definition: mtxline.h:22
@ rlparen
Definition: mtxline.h:22
@ other
Definition: mtxline.h:22
@ mword
Definition: mtxline.h:23
@ lbrac
Definition: mtxline.h:22
@ nextvoice
Definition: mtxline.h:23
@ atword
Definition: mtxline.h:24
@ lparen
Definition: mtxline.h:22
@ rparen
Definition: mtxline.h:22
@ abcdefg
Definition: mtxline.h:22
@ zword
Definition: mtxline.h:22
@ lyrtag
Definition: mtxline.h:22
char durationCode(char *note)
Definition: notes.c:64
int k
Definition: otp-parser.c:70
unsigned digits[12]
Definition: out_routines.c:255
#define print(s)
Definition: pbmtoln03.c:48
#define V
Definition: pgmcrater.c:68
struct outDev * put
Definition: plain2.c:108
static void output(char *note_, struct LOC_processLine *LINK)
Definition: prepmx.c:155
#define chord_left
Definition: prepmx.c:86
static void lookahead(struct LOC_processLine *LINK)
Definition: prepmx.c:354
static void getMeterChange(voice_index voice, char *new_meter)
Definition: prepmx.c:475
static void processMBR(struct LOC_musicParagraph *LINK)
Definition: prepmx.c:579
static char repeat_sign[256]
Definition: prepmx.c:93
static boolean isControlParagraph(char(*P)[256], paragraph_index para_len)
Definition: prepmx.c:732
static boolean control_paragraph
Definition: prepmx.c:729
#define version_date
Definition: prepmx.c:70
static void doMusic(void)
Definition: prepmx.c:685
static void maybeDotted(char *note, struct LOC_processLine *LINK)
Definition: prepmx.c:181
static void addChords(struct LOC_processLine *LINK)
Definition: prepmx.c:234
static boolean no_report_errors
Definition: prepmx.c:729
static void musicParagraph(void)
Definition: prepmx.c:602
static void processLine(voice_index voice_, short bar_no)
Definition: prepmx.c:397
#define chord_flat
Definition: prepmx.c:85
static void putPMXlines(struct LOC_musicParagraph *LINK)
Definition: prepmx.c:498
static boolean no_commands_yet
Definition: prepmx.c:682
static boolean last_bar
Definition: prepmx.c:92
static void supplyRests(voice_index voice)
Definition: prepmx.c:128
static void processOneBar(struct LOC_musicParagraph *LINK)
Definition: prepmx.c:512
static void topOfPMXfile(void)
Definition: prepmx.c:758
static void processUsual(struct LOC_processLine *LINK)
Definition: prepmx.c:364
static void outChord(struct LOC_addChords *LINK)
Definition: prepmx.c:200
#define visible
Definition: prepmx.c:89
static void writeRepeat(char *bar)
Definition: prepmx.c:100
main(int argc, char *argv[])
Definition: prepmx.c:772
#define version
Definition: prepmx.c:69
static short bar_of_line
Definition: prepmx.c:95
static char * processOther(char *Result, char *note_, struct LOC_processLine *LINK)
Definition: prepmx.c:292
static void putMeter(char *new_meter_word, struct LOC_musicParagraph *LINK)
Definition: prepmx.c:572
int ninstr
Definition: process_score.c:15
int tilde
#define STR2(tok)
short int5[5]
Definition: status.h:49
void beginSlur(short voice, Char *note)
void initStatus(void)
short chordPitch(short voice)
void renewPitch(short voice, Char *note)
void endBeam(short voice)
void endSlur(short voice, Char *note)
void renewChordPitch(short voice, Char *note)
Definition: t1part.c:39
boolean tieme
Definition: prepmx.c:195
struct LOC_processLine * LINK
Definition: prepmx.c:193
char lab
Definition: prepmx.c:196
int5 pitches
Definition: prepmx.c:197
char nt[256]
Definition: prepmx.c:194
char labels[256]
Definition: prepmx.c:194
char new_meter[256]
Definition: prepmx.c:495
boolean no_chords
Definition: prepmx.c:149
voice_index voice
Definition: prepmx.c:146
char cutnote[256]
Definition: prepmx.c:147
char pretex[256]
Definition: prepmx.c:147
boolean no_uptext
Definition: prepmx.c:149
boolean in_group
Definition: prepmx.c:152
short ngrace
Definition: prepmx.c:148
char chords[256]
Definition: prepmx.c:147
short nmulti
Definition: prepmx.c:148
char note[256]
Definition: prepmx.c:147
int j
Definition: t4ht.c:1589
*job_name strlen((char *) job_name) - 4)
m
Definition: tex4ht.c:3990
void initUptext(void)
Definition: uptext.c:60
void addUptext(short voice_, boolean *no_uptext, char *pretex)
Definition: uptext.c:208
char * GetNextWord(char *Result, char *s, char Delim, char Term)
Definition: utility.c:40
boolean endsWith(char *s1_, char *s2)
Definition: utility.c:158
char * toString(char *Result, short n)
Definition: utility.c:96
char * NextWord(char *Result, char *s_, char Delim, char Term)
Definition: utility.c:64
short curtail(char *s, char c)
Definition: utility.c:82
boolean startsWithBracedWord(char *P_)
Definition: utility.c:135
void augmentPreamble(boolean control_para)
Definition: preamble.c:885
boolean thisCase(void)
Definition: preamble.c:872
void interpretCommands(void)
Definition: preamble.c:700
void restyle(void)
Definition: preamble.c:957
void preambleDefaults(void)
Definition: preamble.c:787
boolean isCommand(char *command_)
Definition: preamble.c:532
void nonMusic(void)
Definition: preamble.c:860
void doPreamble(void)
Definition: preamble.c:913
void doPMXpreamble(void)
Definition: preamble.c:1107
static char voices[256]
Definition: preamble.c:117
void respace(void)
Definition: preamble.c:935
void beginBeam(short voice, char *note)
Definition: status.c:395
void resetDuration(short voice, char dur)
Definition: status.c:189
void rememberDurations(void)
Definition: status.c:163
void activateBeamsAndSlurs(short voice)
Definition: status.c:199
void getChordTies(short voice, short *pitches, char *labels)
Definition: status.c:152
void chordTie(short voice, char *lab)
Definition: status.c:130
void saveStatus(short voice)
Definition: status.c:217
void restoreDurations(void)
Definition: status.c:173
#define argv
Definition: xmain.c:270
#define argc
Definition: xmain.c:269