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)  

process_score.c
Go to the documentation of this file.
1 # include "autosp.h"
2 
3 # define MAX_STAFFS 9
4 
5 # define SMALL_NOTE 512
6 # define SP(note) (SMALL_NOTE/note)
7 /* note = { 256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 } */
8 # define MAX_SPACING 2*SP(1)
9 int staffs[MAX_STAFFS]; /* number of staffs for ith instrument*/
10 bool active[MAX_STAFFS]; /* is staff i active? */
12 int spacing; /* spacing for current notes */
14 char global_skip_str[7][16];
15 int ninstr; /* number of instruments */
16 int nstaffs; /* number of staffs */
17 int nastaffs; /* number of active staffs; */
20 bool Changeclefs; /* output \Changeclefs after \def\atnextbar */
21 char TransformNotes2[SHORT_LEN]; /* 2nd argument of \TransformNotes */
24  /* instrument size as set by setsize or by default ("\\@one") */
26  /* nummerical intrument size */
27 int staff_instr[MAX_STAFFS]; /* instrument for each staff */
28 
29 char line[LINE_LEN]; /* line of input */
30 
31 void process_line ();
32 
33 void process_command (char **ln);
34 
35 void process_line ()
36 {
37  char *ln;
38  ln = &line[0];
39  while ( *ln != '\0')
40  {
41  while (*ln == ' ') { ln++; fputc (' ', outfile); }
42  if (*ln == '%') {
43  fprintf (outfile, "%s", ln);
44  return;
45  }
46  process_command (&ln);
47  }
48 }
50 /* process .aspc file */
51 {
52  int c; int i;
53  lineno = 0;
54  for (i=1; i < MAX_STAFFS; i++)
55  {
56  staffs[i] = 1;
57  active[i] = true;
58  bar_rest[i] = false;
59  append (instrument_size[i], NULL, "\\normalvalue", SHORT_LEN);
60  instr_numsize[i] = 1.0;
61  }
63  restbars = 0;
64  ninstr = 1; /* number of instruments */
65  nstaffs = 1; /* number of staffs */
66  nastaffs = 1; /* number of active staffs; */
68  oldspacing_staff = 0;
69  Changeclefs = false; /* output \Changeclefs after \def\atnextbar */
70 
71  TransformNotes2[0] = '\0';
72  TransformNotesDefined = false;
73 
74  append (global_skip_str[0], NULL, "", 16);
75  append (global_skip_str[1], NULL, "\\qqsk", 16);
76  append (global_skip_str[2], NULL, "\\hqsk", 16);
77  append (global_skip_str[3], NULL, "\\tqsk", 16);
78  append (global_skip_str[4], NULL, "\\qsk", 16);
79  append (global_skip_str[5], NULL, "\\qsk\\qqsk", 16);
80  append (global_skip_str[6], NULL, "\\qsk\\hqsk", 16);
81 
82  c = getc (infile);
83  while ( c != EOF )
84  {
85  ungetc (c, infile);
86  if (fgets(line, LINE_LEN, infile) == NULL)
87  error ("Unexpected EOF.");
88  if (strlen (line) == LINE_LEN-1)
89  error ("Line too long.");
90  lineno++;
91  process_line ();
92  c = getc (infile);
93  } /* c == EOF */
94 }
95 
static int lineno
Definition: aftopl.c:19
#define SHORT_LEN
Definition: autosp.c:108
#define fgets
Definition: xxstdio.h:29
#define error(a)
Definition: dviinfo.c:48
#define c(n)
Definition: gpos-common.c:150
static FILE * infile
Definition: rdjpgcom.c:61
static FILE * outfile
Definition: wrjpgcom.c:80
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p scientific i
Definition: afcover.h:80
#define EOF
Definition: afmparse.c:59
#define LINE_LEN
Definition: utils.c:42
#define getc
Definition: line.c:39
#define fprintf
Definition: mendex.h:64
int spacing
Definition: process_score.c:12
void process_command(char **ln)
signed char bar_rest[9]
Definition: process_score.c:11
int oldspacing_staff
Definition: process_score.c:19
int nstaffs
Definition: process_score.c:16
signed char active[9]
Definition: process_score.c:10
#define MAX_SPACING
Definition: process_score.c:8
int ninstr
Definition: process_score.c:15
int old_spacing
Definition: process_score.c:18
int staff_instr[9]
Definition: process_score.c:27
#define MAX_STAFFS
Definition: process_score.c:3
int staffs[9]
Definition: process_score.c:9
char TransformNotes2[256]
Definition: process_score.c:21
char global_skip_str[7][16]
Definition: process_score.c:14
signed char Changeclefs
Definition: process_score.c:20
float instr_numsize[9]
Definition: process_score.c:25
void process_score()
Definition: process_score.c:49
signed char TransformNotesDefined
Definition: process_score.c:22
char instrument_size[9][256]
Definition: process_score.c:23
int restbars
Definition: process_score.c:13
void process_line()
Definition: process_score.c:35
int nastaffs
Definition: process_score.c:17
Definition: bdf.c:133
#define ungetc(c, f)
Definition: t1stdio.h:106
*job_name strlen((char *) job_name) - 4)
#define append(a, b)
Definition: y.tab.c:257