From a86677ef5317e0f51b75fa9028d6365ffa40e307 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 22 Feb 2004 23:46:16 +0000 Subject: [PATCH] (construct-chord): process transposition after processing explicit-11. --- ChangeLog | 8 ++++++++ Documentation/topdocs/NEWS.texi | 15 +++++++++++++++ Documentation/user/refman.itely | 12 +++++++++++- input/regression/quote.ly | 10 ++++------ input/test/music-creation.ly | 11 ++++++----- lily/my-lily-lexer.cc | 1 + lily/parser.yy | 17 ++++++++++++++++- ly/declarations-init.ly | 6 ++++-- make/lilypond.redhat.spec.in | 4 ++++ scm/chord-entry.scm | 21 ++++++++++++--------- scm/output-tex.scm | 12 +++++++----- scripts/lilypond-book.py | 6 +++--- 12 files changed, 91 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index f36cba17b4..409312b4f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ +2004-02-23 Han-Wen Nienhuys + + * scm/chord-entry.scm (construct-chord): process transposition + after processing explicit-11. + 2004-02-22 Han-Wen Nienhuys + * lily/parser.yy (add_quote): add syntax for adding quotes: + \addquote "id-string" Music + * scripts/lilypond-book.py (do_file): do not overwrite input file. * scripts/convert-ly.py (conv): add rules for name changes. diff --git a/Documentation/topdocs/NEWS.texi b/Documentation/topdocs/NEWS.texi index e795c7b736..32d53d7fbf 100644 --- a/Documentation/topdocs/NEWS.texi +++ b/Documentation/topdocs/NEWS.texi @@ -18,6 +18,21 @@ Version 2.1.13 @itemize @bullet +@item Cue notes can now be quoted directly from the parts that +contain them. For example, + +@verbatim +\addquote oboe \notes\relative c' { fis4 fis fis fis } + +\score { + \notes \relative c'' { + c8 d8 \quote 2 oboe es8 gis + } +} +@end verbatim + + + @item The naming of exported Scheme functions now follows Scheme conventions. Changes be applied to Scheme files with convert-ly: diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index eae57ba908..10c1061d1e 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -4069,6 +4069,7 @@ some common problems in orchestral music. * Automatic part combining:: * Hiding staves:: * Different editions from one source:: +* Quoting other voices:: * Sound output for transposing instruments:: @end menu @@ -4467,7 +4468,7 @@ first part (with context called @code{one}) always gets up stems, and If you just want the merging parts, and not the textual markings, you may set the property @var{soloADue} to false: -@lilypond[verbatim,raggedright,fragment] +@lilypond[verbatim,raggedright,fragment,relative=1] \new Staff << \set Staff.soloADue = ##f \partcombine @@ -4598,6 +4599,15 @@ of symbols, for example, Examples: @inputfileref{input/regression,tag-filter.ly}. +@node Quoting other voices +@subsection Quoting other voices + +TODO: document! + + + + + @node Sound output for transposing instruments @subsection Sound output for transposing instruments diff --git a/input/regression/quote.ly b/input/regression/quote.ly index 27f5fb6762..fb6241af25 100644 --- a/input/regression/quote.ly +++ b/input/regression/quote.ly @@ -7,13 +7,11 @@ music may be quoted. " } \version "2.1.26" -bla = \notes\relative c' { fis4 fis fis fis } - -#(add-quotable "bla" bla) +\addquote bla \notes\relative c' { fis4 fis fis fis } \score { \notes \relative c'' { - c8 d8 \quote 2 "bla" es8 gis - } + c8 d8 \quote 2 bla es8 gis + } } - + diff --git a/input/test/music-creation.ly b/input/test/music-creation.ly index ce5e3f120e..db0204b7e0 100644 --- a/input/test/music-creation.ly +++ b/input/test/music-creation.ly @@ -1,4 +1,5 @@ -\version "1.9.6" %% or actually: 1.7.1 ... +\version "2.1.26" + % possible rename to scheme- something. -gp \header { texidoc = "@cindex Scheme Music Creation You can create music expressions from Scheme. The @@ -7,18 +8,18 @@ mechanism for this is rather clumsy to use, so avoid it if possible. " #(define (make-note-req p d) (let* ((ml (make-music-by-name 'NoteEvent))) - (ly:set-mus-property! ml 'duration d) - (ly:set-mus-property! ml 'pitch p) + (ly:music-set-property! ml 'duration d) + (ly:music-set-property! ml 'pitch p) ml)) #(define (make-note elts) (let* ((ml (make-music-by-name 'EventChord))) - (ly:set-mus-property! ml 'elements elts) + (ly:music-set-property! ml 'elements elts) ml)) #(define (seq-music-list elts) (let* ((ml (make-music-by-name 'SequentialMusic))) - (ly:set-mus-property! ml 'elements elts) + (ly:music-set-property! ml 'elements elts) ml)) diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index cceb376a6f..53acda5cdd 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -29,6 +29,7 @@ static Keyword_ent the_key_tab[]={ {"acciaccatura", ACCIACCATURA}, {"accepts", ACCEPTS}, {"addlyrics", ADDLYRICS}, + {"addquote", ADDQUOTE}, {"alias", ALIAS}, {"alternative", ALTERNATIVE}, {"apply", APPLY}, diff --git a/lily/parser.yy b/lily/parser.yy index c296bef3f9..1ff6ab489e 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -237,6 +237,7 @@ yylex (YYSTYPE *s, void * v) %token ACCEPTS %token ADDLYRICS +%token ADDQUOTE %token NEWADDLYRICS %token ALIAS %token ALTERNATIVE @@ -422,6 +423,8 @@ toplevel_expression: lilypond_header { THIS->input_file_->header_ = $1; } + | add_quote { + } | score_block { Score * sc = $1; @@ -465,6 +468,7 @@ toplevel_expression: } ; + embedded_scm: SCM_T | SCM_IDENTIFIER @@ -1333,6 +1337,17 @@ chord_body_element: } ; +add_quote: + ADDQUOTE string Music { + static SCM adder; + if (!adder) + adder = scm_c_eval_string ("add-quotable"); + + scm_call_2 (adder, $2, $3->self_scm ()); + scm_gc_unprotect_object ($3->self_scm ()); + } + ; + command_element: command_req { $$ = MY_MAKE_MUSIC("EventChord"); @@ -1363,7 +1378,7 @@ command_element: quote->set_property ("duration", $2); quote->set_property ("quoted-events", evs); } else { - THIS->here_input ().warning (_f ("Can\'t find music.")); + THIS->here_input ().warning (_f ("Can\'t find music")); quote = MY_MAKE_MUSIC ("Event"); } quote->set_spot (THIS->here_input ()); diff --git a/ly/declarations-init.ly b/ly/declarations-init.ly index 1e2f355132..b95af19271 100644 --- a/ly/declarations-init.ly +++ b/ly/declarations-init.ly @@ -45,7 +45,7 @@ melismaEnd = #(make-span-event 'ManualMelismaEvent STOP) % Do units first; must be done before any units are specified. \paper { - unit = "mm" + unit = "mm" %% ugh: coupled to LilyPond C++ code. mm = 1.0 in = 25.4 pt = #(/ in 72.27) @@ -130,4 +130,6 @@ partCombineListener = \paper { % reset default duration unusedEntry = \notes { c4 } -#(define musicQuotes (make-hash-table)) + +% must have size argument for GUILE 1.6 compat. +#(define musicQuotes (make-hash-table 29)) diff --git a/make/lilypond.redhat.spec.in b/make/lilypond.redhat.spec.in index fbc31225ea..88421d3fd1 100644 --- a/make/lilypond.redhat.spec.in +++ b/make/lilypond.redhat.spec.in @@ -106,6 +106,10 @@ fi # chkfontpath --remove=%{_datadir}/share/lilypond/@TOPLEVEL_VERSION@/fonts/type1/ +%postun +if [ -f /usr/share/lilypond/%{version}/ls-R ]; then + rm -f /usr/share/lilypond/%{version}/ls-R +fi %post documentation scrollkeeper-update diff --git a/scm/chord-entry.scm b/scm/chord-entry.scm index 0c4b8bb03a..bc408de71f 100644 --- a/scm/chord-entry.scm +++ b/scm/chord-entry.scm @@ -65,7 +65,7 @@ Entry point for the parser. (define (interpret-additions chord mods) "Interpret additions. TODO: should restrict modifier use?" - + (cond ((null? mods) chord) ((ly:pitch? (car mods)) @@ -168,15 +168,14 @@ the bass specified. (if (procedure? lead-mod) (set! base-chord (lead-mod base-chord))) - (set! complete-chord (if start-additions (interpret-additions base-chord flat-mods) (interpret-removals base-chord flat-mods) )) - (set! complete-chord (map (lambda (x) (ly:pitch-transpose x root)) - (sort complete-chord ly:pitch\\begin\s*{document})''', source) preamble = source[:m.start (0)] latex_document = LATEX_DOCUMENT % vars () @@ -757,7 +756,9 @@ def do_file (input_filename): + format2ext[format]) - if os.path.samefile (output_filename, input_fullname): + if (os.path.exists (input_filename) and + os.path.exists (output_filename) and + os.path.samefile (output_filename, input_fullname)): ly.error (_("Output would overwrite input file; use --output.")) sys.exit (2) @@ -767,7 +768,6 @@ def do_file (input_filename): ly.progress (_ ("Reading %s...") % input_fullname) source = in_handle.read () - print 'hoai', source, in_handle ly.progress ('\n') snippet_types = ( -- 2.39.2