PRIVATE char *beam_completion (char *s) /* \tq... */ { char *t; if (debug > 0) fprintf (stderr, "\nIn beam_completion: spacing=%d beaming=%d new_beaming=%d\n", spacing, beaming, new_beaming); if (beaming > spacing) { if (spacing != 0) fprintf (outfile, "\\en\n"); output_rests (true); switch (beaming) { case 256: case 128: case 64: fprintf (outfile,"%s", NNNOTES); break; case 32: fprintf (outfile,"%s", NNOTES); break; case 16: fprintf (outfile,"\\notes"); break; case 8: fprintf (outfile,"\\Notes"); break; default: error ("Beaming value not recognized"); } spacing = beaming; } t = strchr (s+1, '\\'); if (t == NULL) t = s + strlen(s); output_notes (t); new_beaming = 0; spacing = 8; return t; }
static void output_citeparts( fields *f, FILE *outptr, int level, int max ) { int orig_level; output_title( f, outptr, level ); output_names( f, outptr, level ); output_origin( f, outptr, level ); output_type( f, outptr, level ); output_language( f, outptr, level ); output_description( f, outptr, level ); if ( level >= 0 && level < max ) { output_tag( outptr, lvl2indent(level), "relatedItem", NULL, TAG_OPEN, TAG_NEWLINE, "type", "host", NULL ); output_citeparts( f, outptr, incr_level(level,1), max ); output_tag( outptr, lvl2indent(level), "relatedItem", NULL, TAG_CLOSE, TAG_NEWLINE, NULL ); } /* Look for original item things */ orig_level = original_items( f, level ); if ( orig_level ) { output_tag( outptr, lvl2indent(level), "relatedItem", NULL, TAG_OPEN, TAG_NEWLINE, "type", "original", NULL ); output_citeparts( f, outptr, orig_level, max ); output_tag( outptr, lvl2indent(level), "relatedItem", NULL, TAG_CLOSE, TAG_NEWLINE, NULL ); } output_abs( f, outptr, level ); output_notes( f, outptr, level ); output_toc( f, outptr, level ); output_key( f, outptr, level ); output_sn( f, outptr, level ); output_url( f, outptr, level ); output_part( f, outptr, level ); output_recordInfo( f, outptr, level ); }
PRIVATE char *semiautomatic_beam (char *s) { char *t; if ( prefix ("\\Dqbb", s) || prefix ("\\Tqbb", s) || prefix ("\\Qqbb", s) ) beaming = 16; else if ( prefix ("\\Dqb", s) || prefix ("\\Tqb", s) || prefix ("\\Qqb", s) ) beaming = 8; if (beaming > spacing) { if (spacing != 0) fprintf (outfile, "\\en\n"); output_rests (true); switch (beaming) { case 16: fprintf (outfile,"\\notes"); break; case 8: fprintf (outfile,"\\Notes"); break; default: error ("Beaming value not recognized"); } spacing = beaming; } t = strchr (s+1, '\\'); if (t == NULL) t = s + strlen(s); output_notes (t); return t; }
PRIVATE char *spacing_note (char *s, int new_spacing) { /* outputs from notes* to just after note at *s, if necessary, preceded by a new notes command; then updates notes. */ char *t; if (debug > 0) fprintf (stderr, "\nspacing_note: spacing=%d new_spacing=%d s=%s\n", spacing, new_spacing, s); if (spacing != new_spacing) { if (spacing != 0) fprintf (outfile,"\\en\n"); output_rests (true); switch (new_spacing) { /* start a new notes command */ case 128:fprintf (outfile,"%s", NNNOTES); break; case 64: fprintf (outfile,"%s", NNNOTES); break; case 32: fprintf (outfile,"%s", NNOTES); break; case 16: fprintf (outfile,"\\notes"); break; case 8: fprintf (outfile,"\\Notes"); break; case 4: fprintf (outfile,"\\NOtes"); break; case 2: fprintf (outfile,"\\NOTes"); break; case 1: fprintf (outfile,"\\NOTEs"); break; default: error ("Spacing value not recognized"); } spacing = new_spacing; } t = strchr (s+1, '\\'); if (t == NULL) t = s + strlen(s); output_notes (t); if (debug > 0) fprintf (stderr, "\nAfter spacing_note: spacing=%d notes=%s\n", spacing, notes); return notes; }
PRIVATE char *nonspacing_beam_termination (char *s) /* \ztq... */ { char *t; if (spacing == 0) { output_rests (true); fprintf (outfile,"\\znotes"); spacing = beaming; } t = strchr (s+1, '\\'); if (t == NULL) t = s + strlen(s); output_notes (t); new_beaming = 0; return t; }
PRIVATE char *tiny (char *s) /* \tinynotesize */ { char *t; if (spacing > 32) { if (spacing != 0) fprintf (outfile,"\\en\n"); /* for appoggiatura */ fprintf (outfile, NNNOTES); } spacing = 32; t = s + strlen(s); output_notes (t); return t; }
PRIVATE void synthesize_notes (void) /* generate well-spaced notes */ { char *s; s = notes; while (true) { if (debug > 0) fprintf (stderr, "\nIn synthesize s=%s\n", s); if (*s == '\0') { if (spacing == 0) { if (*notes == '\0') return; /* to avoid \znotes\en */ fprintf (outfile,"\\znotes"); } output_notes (s); fprintf (outfile,"\\en"); spacing = 0; return; } if ( prefix ("\\h", s) && !prefix ("\\hs", s) && !prefix ("\\hqsk", s) && !prefix ("\\hroff", s) && !prefix ("\\hloff", s) ) s = spacing_note (s, 2); else if ( prefix ("\\hs", s) && !prefix ("\\hsk", s) ) s = spacing_note (s, 32); else if ( prefix ("\\q", s) && !prefix ("\\qb", s) && !prefix ("\\qs", s) && !prefix ("\\qqsk", s) ) s = spacing_note (s, 4); else if ( prefix ("\\qs", s) && !prefix ("\\qsk", s) ) s = spacing_note (s, 16); else if ( prefix("\\qb", s) ) s = beam_note (s); else if ( prefix ("\\ccccc", s) ) s = spacing_note (s, 128); else if ( prefix ("\\cccc", s) ) s = spacing_note (s, 64); else if ( prefix ("\\ccc", s) ) s = spacing_note (s, 32); else if ( prefix ("\\cc", s) && !prefix ("\\ccharnote", s) ) s = spacing_note (s, 16); else if ( prefix ("\\c", s) && !prefix ("\\cna", s) && !prefix ("\\csh", s) && !prefix ("\\cfl", s) && !prefix ("\\curve", s) && !prefix ("\\ccharnote", s) ) s = spacing_note (s, 8); else if ( prefix ("\\ds", s ) && !prefix ("\\dsh", s) ) s = spacing_note (s, 8); else if ( prefix ("\\wh", s) || prefix ("\\pa", s) || prefix ("\\breve", s) ) s = spacing_note (s, 1); else if ( prefix ("\\Hpause", s) ) s = spacing_note (s, 2); else if ( prefix("\\ib",s) || prefix("\\Ib",s) || prefix("\\nb",s) ) s = beam_initiation (s); else if ( prefix("\\Dq",s) || prefix("\\Tq",s) || prefix("\\Qq",s) ) s = semiautomatic_beam (s); else if ( prefix("\\tb", s) ) s = beam_termination (s); else if ( prefix("\\tq", s) ) s = beam_completion (s); else if ( prefix("\\ztq", s) ) s = nonspacing_beam_termination (s); else if ( prefix("\\tinynotesize", s)) s = tiny (s); else if ( prefix("\\slur", s) || prefix("\\tie", s) || prefix("\\sslur", s) || prefix("\\bslur", s) ) s = simple (s); else if ( prefix("\\zchar", s) || prefix("\\lchar", s) || prefix("\\cchar", s) ) { char *t; /* need to skip two arguments */ s = strchr (s+1, '}'); /* first } */ s = strchr (s+1, '}'); /* second } */ t = strchr(s+1,'\\'); if (t == NULL) t = s + strlen(s); s = t; } else /* non-spacing; skip to next command */ { char *t; t = strchr(s+1,'\\'); if (t == NULL) t = s + strlen(s); s = t; } } }