From fabf53486884f78f54855a7b4a59cb105d83f638 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 20 Jul 2003 11:48:43 +0000 Subject: [PATCH] * buildscripts/new-chords.py (help): add help text * Documentation/user/introduction.itely (Typography and program architecture): fixes. * Documentation/user/GNUmakefile (DVIPS_PAPERSIZE): set A4 paper for texinfo and dvips. This fixes problems with PDF output of the wrong size. * stepmake/stepmake/texinfo-rules.make ($(outdir)/%.dvi): add TEXINFO_PAPERSIZE variable --- ChangeLog | 7 ++ Documentation/user/GNUmakefile | 3 - Documentation/user/introduction.itely | 116 +++++++++--------- NEWS | 7 +- .../{new-chords.py => convert-new-chords.py} | 75 ++++++++++- config.make.in | 2 + input/regression/GNUmakefile | 1 + make/lilypond.redhat.spec.in | 2 +- make/ly-rules.make | 4 +- make/mutopia-rules.make | 4 +- stepmake/stepmake/tex-vars.make | 3 +- stepmake/stepmake/texinfo-rules.make | 3 +- stepmake/stepmake/texinfo-vars.make | 1 + 13 files changed, 155 insertions(+), 73 deletions(-) rename buildscripts/{new-chords.py => convert-new-chords.py} (71%) diff --git a/ChangeLog b/ChangeLog index f6507d1614..31bf2ecbc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2003-07-20 Han-Wen Nienhuys + * VERSION: release 1.7.27 + + * buildscripts/new-chords.py (help): add help text + + * Documentation/user/introduction.itely (Typography and program + architecture): fixes. + * Documentation/user/GNUmakefile (DVIPS_PAPERSIZE): set A4 paper for texinfo and dvips. This fixes problems with PDF output of the wrong size. diff --git a/Documentation/user/GNUmakefile b/Documentation/user/GNUmakefile index 06d695ac8e..409ca8ec23 100644 --- a/Documentation/user/GNUmakefile +++ b/Documentation/user/GNUmakefile @@ -28,9 +28,6 @@ STEPMAKE_TEMPLATES=tex texinfo omf documentation OMF_FILES += $(outdir)/lilypond-internals.html.omf -TEXINFO_PAPERSIZE = @afourpaper -DVIPS_PAPERSIZE = a4 - LOCALSTEPMAKE_TEMPLATES=lilypond ly LILYPOND_BOOK_FLAGS=--extra-options '-e "(ly:set-option (quote internal-type-checking) \#t)"' diff --git a/Documentation/user/introduction.itely b/Documentation/user/introduction.itely index 92affee6ab..3c9f721797 100644 --- a/Documentation/user/introduction.itely +++ b/Documentation/user/introduction.itely @@ -16,7 +16,8 @@ that we love to see and love to play from. @menu * Music notation and engraving:: -* Computerized typography:: +* Notation and engraving in LilyPond:: +* Typography and program architecture:: * Music representation:: * Example applications:: * About this manual:: @@ -31,14 +32,14 @@ that we love to see and love to play from. @cindex typography Making sheet music may seem trivial, ``you print 5 lines, and then put -in the notes at different heights'', but as one learns more of it, the -opposite turns out to be true. There are two problems when making -sheet music. First, one has to master music notation: the science of -knowing which symbols to use when what. Second, one has to master -music engraving: the art of placing symbols such that they look -elegant. - -Common music notation has its roots in the medieval centuries. In this +in the notes at different heights'', but as you learn more of it, the +opposite turns out to be true. One has to master two difficult +tasks. First, one has to master music notation: the science of knowing +which symbols to use when what. Second, one has to master music +engraving: the art of placing symbols such that the result looks +pleasing. + +Common music notation has its roots in the medieval time. In this time, monks started to write down hints that indicated how their sacred music was sung. These hints, neumes, gradually became simpler, and at some point became the note heads. Lines were added to the @@ -53,30 +54,18 @@ counterpoint in the early renaissance. The graphic language of notation is still under development; the innovations of contemporary music require still newer and more complex notations. -In summary, common music notation encompasses such a wide scope of -music inherently is complex: there are many rules, and for every rule -there are exceptional situations where they do not apply. The result -is that LilyPond cannot support each and every form of notation in -existence. Rather, we focus on a specific style and idiom: we take -inspiration from late-romantic music printed at the beginning of the -20th century. Most of the contemporary music after that, and most of -the music going back to 17th century can be written in this -idiom. That is not a fundamental limit, though. There is support for -some modern notation like clusters, and older notation, such as white -mensural and gregorian notation, is being worked on. - -The term music engraving derives from the traditional process of -music printing. Only a few decades ago, sheet music was made by -cutting and stamping the music into zinc or pewter plates, -mirrored. The plate would be inked, and the depressions caused by the -cutting and stamping would hold ink. An image was formed by pressing -paper to the plate. The stamping and cutting was completely done by -hand. Making corrections was cumbersome, so engraving had to be done -correctly in one go. As you can imagine this was a highly specialized -skill, much more so than the traditional process of printing books. +The term music engraving derives from the traditional process of music +printing. Only a few decades ago, sheet music was made by cutting and +stamping the music into zinc or pewter plates, mirrored. The plate +would be inked, and the depressions caused by the cutting and stamping +would hold ink. An image was formed by pressing paper to the +plate. The stamping and cutting was completely done by hand. Making +corrections was cumbersome, so engraving had to be done correctly in +one go. Of course, this was a highly specialized skill, much more so +than the traditional process of printing books. @cindex craftsmanship @cindex master -In the traditional German craftsmanship six years of full-time +In the traditional German system of craftsmanship six years of full-time training, more than any other craft, were required before a student could call himself a master of the art. After that many more years of practical experience were needed to become an established music @@ -84,26 +73,43 @@ engraver. Even today, with the use of high-speed computers and advanced software, music requires lots of manual fine tuning before it is acceptable for publication. -Sheet music is performance material, hence everything is done to aid -the musician in letting him perform better. Music often is far away -from its reader---it might be on a music stand. To make it clearly +Sheet music is performance material: everything is done to aid the +musician in letting him perform better. Music often is far away from +its reader---it might be on a music stand. To make it clearly readable, traditionally printed sheet music always uses bold symbols, on heavy staff lines, and is printed on large sheets of paper. This ``strong'' look is also present in the horizontal spacing. To minimize the number of page breaks, (hand-engraved) sheet music is spaced very tightly. Yet, by a careful distribution of white space, -the feeling of balance is retained, and clutters of black are avoided. +the feeling of balance is retained, and a clutter of symbols is +avoided. + + +@node Notation and engraving in LilyPond +@section Notation and engraving in LilyPond + +Common music notation encompasses such a wide scope of music, and +therefore inherently is complex: there are many rules, and for every +rule there are exceptional situations where they do not apply. The +result is that LilyPond cannot support each and every form of notation +in existence. Rather, we focus on a specific style and idiom: we take +inspiration from late-romantic music printed at the beginning of the +20th century. Most of the contemporary music after that, and most of +the music going back to 17th century can be written in this +idiom. That is not a fundamental limit, though. There is support for +some modern notation like clusters, and older notation, such as white +mensural and gregorian notation, is being worked on. We have used these observations in designing LilyPond. The images below shows the flat symbol. On the left, a scan from a Henle edition, which was made by a computer, and in the center is the flat from a -B@"{a}renreiter edition of the same music. The symbols have noticeable -differences: the left image is much lighter, the staff lines are -thinner, and the glyph has a straight layout with sharp corners. By -contrast, the B@"{a}renreiter has a bold and almost voluptuous rounded -look. Our flat symbol is designed after, among others, this one. It -is tuned it to harmonize with the thickness of our staff lines, which -are also much thicker than Henle's lines. +B@"{a}renreiter edition of the same music. The left scan illustrates +typical flaws of computer print: the symbol is much lighter, the staff +lines are thinner, and the glyph has a straight layout with sharp +corners. By contrast, the B@"{a}renreiter has a bold and almost +voluptuous rounded look. Our flat symbol is designed after, among +others, this one. It is tuned it to harmonize with the thickness of +our staff lines, which are also much thicker than Henle's lines. @multitable @columnfractions .1 .3 .3 .3 @item @tab @@ -172,19 +178,19 @@ and with some corrections. Can you spot which fragment is which? @cindex regular rhythms @cindex regular spacing -The fragment that was printed uses only quarter notes: notes that are -played in a constant rhythm. The spacing should reflect -that. Unfortunately, the eye deceives us a little: the eye not only -notices the distance between note heads, but also between consecutive -stems. As a result, the notes of an up-stem/down-stem combination -should be put farther apart, and the notes of a down-up combination -should be put closer together, all depending on the combined vertical -positions of the notes. The first two measures are printed with this -correction, the last two measures without. The notes in the last two -measures form down-stem/up-stems clumps of notes. - -@node Computerized typography -@section Computerized typography +The fragment only uses quarter notes: notes that are played in a +constant rhythm. The spacing should reflect that. Unfortunately, the +eye deceives us a little: not only does it notice the distance between +note heads, it also takes into account the distance between +consecutive stems. As a result, the notes of an up-stem/down-stem +combination should be put farther apart, and the notes of a down-up +combination should be put closer together, all depending on the +combined vertical positions of the notes. The first two measures are +printed with this correction, the last two measures without. The notes +in the last two measures form down-stem/up-stems clumps of notes. + +@node Typography and program architecture +@section Typography and program architecture Producing good engraving requires skill and knowledge. It was our challenge to see if we could put such typographical knowledge into a diff --git a/NEWS b/NEWS index 83c47531f2..21575dea33 100644 --- a/NEWS +++ b/NEWS @@ -21,7 +21,9 @@ exported as XML. << PITCHES >> -In version 2.0, this syntax will be changed to +It is not necessary to update files to this syntax, but it will be for +using LilyPond version 2.0. In version 2.0, this syntax will be +changed to < PITCHES > for chords @@ -29,6 +31,9 @@ and \simultaneous { .. } for simultaneous music. +To convert your files from to <>, use the script +included in buildscripts/convert-new-chords.py + ** A new uniform postfix syntax for articulation has been introduced. A beamed slurred pair of eighth notes can be entered as diff --git a/buildscripts/new-chords.py b/buildscripts/convert-new-chords.py similarity index 71% rename from buildscripts/new-chords.py rename to buildscripts/convert-new-chords.py index 65292b7dd9..59a2081941 100644 --- a/buildscripts/new-chords.py +++ b/buildscripts/convert-new-chords.py @@ -123,12 +123,13 @@ marker_str = '%% new-chords-done %%' def sub_chords (str): if re.search (marker_str,str): return str - str= re.sub (r'\\<', '@STARTCRESC@', str) str= re.sub (r'\\>', '@STARTDECRESC@', str) str= re.sub (r'([_^-])>', r'\1@ACCENT@', str) str = re.sub ('<([^<>{}]+)>', sub_chord, str) - + str = re.sub (r'\\! *@STARTCHORD@([^@]+)@ENDCHORD@', + r'@STARTCHORD@\1@ENDCHORD@-\!', + str) str = re.sub ('<([^?])', r'%s\1' % simstart, str) str = re.sub ('>([^?])', r'%s\1' % simend, str) str = re.sub ('@STARTCRESC@', r'\\<', str) @@ -139,11 +140,76 @@ def sub_chords (str): str = re.sub (r'@ACCENT@', '>', str) return str -(opts, files)= getopt.getopt( sys.argv[1:], 'e',['edit']) +def articulation_substitute (str): + str = re.sub (r"""([^-])\[ *([a-z]+[,']*[!?]?[0-9:]*\.*)""", + r" \1 \2-[", str) + str = re.sub (r"""([^-])\) *([a-z]+[,']*[!?]?[0-9:]*\.*)""", + r"\1 \2-)", str) + str = re.sub (r"""([^-])\\! *([a-z]+[,']*[!?]?[0-9:]*\.*)""", + r"\1 \2-\\!", str) + return str + +def help (): + print r""" +new-chords.py -- update .ly files to new syntax. + +Usage: + new-chords.py [OPTIONS] FILE(S) + +Options + + -e, --edit in-place edit + -h, --help this help + +Description + + This script converts old chord notation to new chord notation, i.e. + + \< + + becomes + + <> -\< -) + + It will also convert slur-end, beam-start and cresc-end to postfix + notation, i.e. + + [ \! )a + + becomes + + a-\!-)-[ + + By default, the script will print the result on stdout. Use with -e + if you are confident that it does the right thing. + +Warning + + This conversion does not convert all files correctly. It is + recommended to verify the output of the new file manually. + In particular, files with extensive Scheme code (markups, like + + #'(italic "foo") + + and Scheme function definitions may be garbled by the textual + substitution. + +""" + + +(opts, files)= getopt.getopt( sys.argv[1:], 'eh',['help','edit']) edit = 0 for (o,a) in opts: if o == '-e' or o == '--edit': edit = 1 + if o == '-h' or o == '--help': + help () + sys.exit (0) + +if not files: + print 'Error: no input files.\n use -h for help.' + sys.exit(2) + for a in files: str = open (a).read() @@ -153,6 +219,7 @@ for a in files: sys.stderr.write ("processing %s\n" %a) str = sub_chords (str) + marker_str + '\n' + str = articulation_substitute (str) if edit: open (a + '.NEW', 'w').write (str) @@ -166,8 +233,6 @@ for a in files: ## regexes for postfix slur & beam: ## #PYTHON -## ([^-])\[ *([a-z]+[!?]?[,']*[0-9:]+\.*) -> " \1 \2-[" -## ([^-])\( *([a-z]+[!?]?[,']*[0-9:]+\.*) -> "\1 \2-(" ## #EMACS ## \([^-]\)\[ *\([a-z]+[!?]?[,']*[0-9:]*\.*\) diff --git a/config.make.in b/config.make.in index c13d6e9160..98a21c0734 100644 --- a/config.make.in +++ b/config.make.in @@ -97,3 +97,5 @@ SHELL = @SHELL@ TAR = @TAR@ YACC = @YACC@ ZIP = @ZIP@ + +PAPERSIZE=a4 diff --git a/input/regression/GNUmakefile b/input/regression/GNUmakefile index 7c395aed38..036407306c 100644 --- a/input/regression/GNUmakefile +++ b/input/regression/GNUmakefile @@ -4,6 +4,7 @@ STEPMAKE_TEMPLATES=documentation texinfo tex LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc LILYPOND_BOOK_FLAGS=--extra-options '-e "(ly:set-option (quote internal-type-checking) \#t)"' + include $(depth)/make/stepmake.make TITLE=LilyPond Regression Tests diff --git a/make/lilypond.redhat.spec.in b/make/lilypond.redhat.spec.in index f64db8489d..7f2cc2f7b6 100644 --- a/make/lilypond.redhat.spec.in +++ b/make/lilypond.redhat.spec.in @@ -138,7 +138,7 @@ scrollkeeper-update %{_bindir}/musedata2ly %{_bindir}/pmx2ly - +%doc buildscripts/out/convert-new-chords %if %{info} %{_infodir}/* diff --git a/make/ly-rules.make b/make/ly-rules.make index 519f0798e0..f270389fbb 100644 --- a/make/ly-rules.make +++ b/make/ly-rules.make @@ -55,8 +55,8 @@ $(outdir)/%-book.ps: $(outdir)/%.ps pstops '2:0L@.7(21cm,0)+1L@.7(21cm,14.85cm)' $<.tmp $@ $(outdir)/%.pdf: $(outdir)/%.dvi - dvips -u +lilypond.map -o $@.pdfps -Ppdf $< - ps2pdf $@.pdfps $@ + dvips -u +lilypond.map -o $@.pdfps -t $(DVIPS_PAPERSIZE) -Ppdf $< + ps2pdf -sPAPERSIZE=$(DVIPS_PAPERSIZE) $@.pdfps $@ $(outdir)/%.html.omf: %.tely diff --git a/make/mutopia-rules.make b/make/mutopia-rules.make index bd95ef14e2..03cba6f2e9 100644 --- a/make/mutopia-rules.make +++ b/make/mutopia-rules.make @@ -31,8 +31,8 @@ $(outdir)/%.dvi: %.ly $(outdir)/%.pdf: $(outdir)/%.dvi - dvips -u +lilypond.map -o $@.pdfps -Ppdf $< - ps2pdf $@.pdfps $@ + dvips -u +lilypond.map -t $(DVIPS_PAPERSIZE) -o $@.pdfps -Ppdf $< + ps2pdf -sPAPERSIZE=$(DVIPS_PAPERSIZE) $@.pdfps $@ $(outdir)-$(PAPERSIZE)/%.dvi: %.ly $(PYTHON) $(LY2DVI) --output=$@ --dependencies --set=papersize=$(PAPERSIZE) $< diff --git a/stepmake/stepmake/tex-vars.make b/stepmake/stepmake/tex-vars.make index e417f4ab7a..c54ae55c8f 100644 --- a/stepmake/stepmake/tex-vars.make +++ b/stepmake/stepmake/tex-vars.make @@ -1,5 +1,4 @@ export TEXPICTS:=$(outdir)$(PATHSEP)$(TEXPICTS) -# better not define DVIPS_PAPERSIZE here, -# since it must be synched with the texinfo setting. +DVIPS_PAPERSIZE=$(PAPERSIZE) diff --git a/stepmake/stepmake/texinfo-rules.make b/stepmake/stepmake/texinfo-rules.make index 9c96e0990b..9baf80dba1 100644 --- a/stepmake/stepmake/texinfo-rules.make +++ b/stepmake/stepmake/texinfo-rules.make @@ -9,7 +9,6 @@ $(outdir)/%.html: $(outdir)/%.texi # we want footers even if website builds (or is built) partly $(footify) $@ - $(outdir)/%.html.omf: %.texi $(call GENERATE_OMF,html) @@ -26,7 +25,7 @@ $(outdir)/%/%.html: $(outdir)/%.texi $(deep-footify) $(sort $(wildcard $(outdir)/$(*F)/*.html)) $(outdir)/%.dvi: $(outdir)/%.texi - cd $(outdir); texi2dvi --batch -t $(TEXINFO_PAPERSIZE) $( $@ +TEXINFO_PAPERSIZE_OPTION= $(if $(findstring $(PAPERSIZE),a4),,-t @afourpaper) -- 2.39.2