From: Han-Wen Nienhuys Date: Sun, 13 Oct 2002 22:16:28 +0000 (+0000) Subject: * lily/music.cc (name): bugfix X-Git-Tag: release/1.7.4~23 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=fdbdb54603ca665d6f971b2b1694f677ba69ecce;p=lilypond.git * lily/music.cc (name): bugfix * lily/piano-pedal-engraver.cc (try_music): fix pedals. * lily/input-file-results.cc (code): set-point-and-click! -> set-point-and-click --- diff --git a/ChangeLog b/ChangeLog index 0917334fc7..de50228cfb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-10-14 Han-Wen Nienhuys + + * lily/music.cc (name): bugfix + + * lily/piano-pedal-engraver.cc (try_music): fix pedals. + + * lily/input-file-results.cc (code): set-point-and-click! -> + set-point-and-click + 2002-10-13 Han-Wen Nienhuys * Use uniform ly: prefix for exported scheme primitive functions. diff --git a/Documentation/user/internals.itely b/Documentation/user/internals.itely index 81d7e672ff..3ab73dc107 100644 --- a/Documentation/user/internals.itely +++ b/Documentation/user/internals.itely @@ -660,11 +660,11 @@ about how music is stored. @lilypond[verbatim,singleline] #(define (testfunc x) - (if (equal? (ly-get-mus-property x 'text) "foo") - (ly-set-mus-property! x 'text "bar")) + (if (equal? (ly:get-mus-property x 'text) "foo") + (ly:set-mus-property! x 'text "bar")) ;; recurse - (ly-set-mus-property! x 'elements - (map testfunc (ly-get-mus-property x 'elements))) + (ly:set-mus-property! x 'elements + (map testfunc (ly:get-mus-property x 'elements))) (display x) x) @@ -685,12 +685,12 @@ A final example is a function that reverses a piece of music in time: @lilypond[verbatim,singleline] #(define (reverse-music music) - (let* ((elements (ly-get-mus-property music 'elements)) + (let* ((elements (ly:get-mus-property music 'elements)) (reversed (reverse elements)) - (span-dir (ly-get-mus-property music 'span-direction))) - (ly-set-mus-property! music 'elements reversed) + (span-dir (ly:get-mus-property music 'span-direction))) + (ly:set-mus-property! music 'elements reversed) (if (dir? span-dir) - (ly-set-mus-property! music 'span-direction (- span-dir))) + (ly:set-mus-property! music 'span-direction (- span-dir))) (map reverse-music reversed) music)) diff --git a/Documentation/user/invoking.itexi b/Documentation/user/invoking.itexi index b6d34c0a33..ea699c3f10 100644 --- a/Documentation/user/invoking.itexi +++ b/Documentation/user/invoking.itexi @@ -43,8 +43,8 @@ The following options are supported: @item -e,--evaluate=@var{expr} Evaluate the Scheme @var{expr} before parsing any @file{.ly} files. Multiple @code{-e} options may be given, they will be evaluated -sequentially. The function @code{ly-set-option} allows for access to -some internal variables. Use @code{-e '(ly-option-usage')} for more +sequentially. The function @code{ly:set-option} allows for access to +some internal variables. Use @code{-e '(ly:option-usage')} for more information. @item -f,--format=@var{format} diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 20adac1d36..d3f2dda3f0 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -725,7 +725,7 @@ fonts. Refer to the Xdvi documentation for more information. To use point-and-click, add one of these lines to the top of your .ly file. @example -#(set-point-and-click! 'line) +#(ly:set-point-and-click 'line) @end example @cindex line-location @@ -765,7 +765,7 @@ apply @file{server.el.patch} (version 21.2 and earlier). At the top of the @code{ly} file, replace the @code{set!} line with the following line, @example -#(set-point-and-click! 'line-column) +#(ly:set-point-and-click 'line-column) @end example @cindex line-colomn-location and set @code{XEDITOR} to @code{emacsclient --no-wait +%l:%c %f}. diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index 31d0363008..9a05dff775 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -2387,7 +2387,7 @@ conductor's score. \include "os-music.ly" \include "paper13.ly" -#(set-point-and-click! 'line-column) +#(ly:set-point-and-click 'line-column) #(define text-flat '((font-relative-size . -2) (music "accidentals--1"))) @@ -2472,11 +2472,11 @@ First we need to include the music definitions we made in @separate @example -#(set-point-and-click! 'line-column) +#(ly:set-point-and-click 'line-column) @end example This piece of Scheme code executes the function -@code{set-point-and-click!} with the argument +@code{ly:set-point-and-click} with the argument @code{line-column}. Editing input files can be complicated if you're working with large files: if you're digitizing existing music, you have to synchronize the .ly file, the sheet music on your lap and the sheet diff --git a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly index edc1f9b2e4..ed039d2237 100644 --- a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly +++ b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-1.ly @@ -1,4 +1,4 @@ -#(set-point-and-click! 'line-column) +#(ly:set-point-and-click 'line-column) opus = "BWV 924" piece = "1" @@ -18,7 +18,7 @@ Lemoine puts fermatas on ending bar lines everywhere. -\version "1.5.72" +\version "1.7.3" lowstaff = \translator "Staff" = "lower" diff --git a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly index db203fce4e..9304e4d6d4 100644 --- a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly +++ b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-2.ly @@ -1,10 +1,10 @@ -#(set-point-and-click! 'line-column) +#(ly:set-point-and-click 'line-column) opus= "BWV 939" piece = "2" -\version "1.5.72" +\version "1.7.3" upper = \context Staff \notes\relative c{ \context Voice=i \property Voice.TextScript \set #'font-style = #'italic diff --git a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-3.ly b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-3.ly index 45681e07d3..b426a36309 100644 --- a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-3.ly +++ b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-3.ly @@ -1,4 +1,4 @@ -#(set-point-and-click! 'line-column) +#(ly:set-point-and-click 'line-column) opus= "BWV 999" piece = "3" @@ -14,7 +14,7 @@ note, some have dotted half notes. This file was partly generated using m4. %} -\version "1.5.72" +\version "1.7.3" upper = \notes \transpose c'' { diff --git a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly index a1b45db8f2..cfeda21167 100644 --- a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly +++ b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-5.ly @@ -1,9 +1,9 @@ -#(set-point-and-click! 'line-column) +#(ly:set-point-and-click 'line-column) piece = "5" opus = "BWV 926" -\version "1.5.72" +\version "1.7.3" upper = \context Staff \notes\relative c \context Voice=i { diff --git a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-6.ly b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-6.ly index d678d0b14f..0334e5a8f7 100644 --- a/input/mutopia/J.S.Bach/Petites-Preludes/preludes-6.ly +++ b/input/mutopia/J.S.Bach/Petites-Preludes/preludes-6.ly @@ -1,9 +1,9 @@ -#(set-point-and-click! 'line-column) +#(ly:set-point-and-click 'line-column) opus = "BWV 940" piece = "6" -\version "1.5.72" +\version "1.7.3" diff --git a/input/mutopia/J.S.Bach/wtk1-fugue1.ly b/input/mutopia/J.S.Bach/wtk1-fugue1.ly index 0a6303a852..5aeedcdf0d 100644 --- a/input/mutopia/J.S.Bach/wtk1-fugue1.ly +++ b/input/mutopia/J.S.Bach/wtk1-fugue1.ly @@ -19,9 +19,9 @@ enteredby = "Shay Rojansky" %{ TODO: use autobeaming. %} -\version "1.5.72" +\version "1.7.3" -% #(set-point-and-click! 'line-column) +% #(ly:set-point-and-click 'line-column) tenor = \context Voice = tenor \notes \relative c' { diff --git a/input/regression/pc-mmrest.ly b/input/regression/pc-mmrest.ly index 48a3a13a40..71d2b58d54 100644 --- a/input/regression/pc-mmrest.ly +++ b/input/regression/pc-mmrest.ly @@ -1,10 +1,10 @@ -\version "1.5.72" +\version "1.7.3" \header { texidoc="Multi measure rests of second voice should not disappear." } -#(set-point-and-click! 'line-column) +#(ly:set-point-and-click 'line-column) one = \notes\relative c'' { f4 \!e-.\f r2| diff --git a/input/tutorial/miniatures.ly b/input/tutorial/miniatures.ly index c7d27f5f1d..4c3daf2b84 100644 --- a/input/tutorial/miniatures.ly +++ b/input/tutorial/miniatures.ly @@ -1,10 +1,10 @@ -\version "1.5.72" +\version "1.7.3" \header { title = "Two miniatures" tagline = "Small is beatiful" } -#(set-point-and-click! 'line-column) +#(ly:set-point-and-click 'line-column) \paper { linewidth = -1.0 } diff --git a/input/tutorial/os-flute-2.ly b/input/tutorial/os-flute-2.ly index 8586e97589..2d606cfae5 100644 --- a/input/tutorial/os-flute-2.ly +++ b/input/tutorial/os-flute-2.ly @@ -1,4 +1,4 @@ -\version "1.5.72" +\version "1.7.3" \include "os-music.ly" \include "paper16.ly" @@ -26,4 +26,4 @@ % switch off settings of -score file, so the rest of the % tutorial isn't \special -#(set-point-and-click! 'none) +#(ly:set-point-and-click 'none) diff --git a/input/tutorial/os-score.ly b/input/tutorial/os-score.ly index 2d923dad79..0f37c9a5a9 100644 --- a/input/tutorial/os-score.ly +++ b/input/tutorial/os-score.ly @@ -1,10 +1,10 @@ -\version "1.5.72" +\version "1.7.3" \include "os-music.ly" \include "paper13.ly" -#(set-point-and-click! 'line-column) +#(ly:set-point-and-click 'line-column) #(define text-flat '((font-relative-size . -2) (music "accidentals--1"))) \score { diff --git a/lily/input-file-results.cc b/lily/input-file-results.cc index 9ed2878c08..c0cc86763a 100644 --- a/lily/input-file-results.cc +++ b/lily/input-file-results.cc @@ -33,11 +33,14 @@ #include "ly-modules.hh" -LY_DEFINE(ly_set_point_and_click_x, "ly:set-point-and-click!", 1, 0, 0, +/* + no ! suffix since it doesn't modify 1st argument. + */ +LY_DEFINE(ly_set_point_and_click_x, "ly:set-point-and-click", 1, 0, 0, (SCM what), - "Set the options for Point-and-click source specials output. The -argument is a symbol. Possible options are @code{none} (no source specials), -@code{line} and @code{line-column}") + "Set the options for Point-and-click source specials output. The\n" +"argument is a symbol. Possible options are @code{none} (no source specials),\n" +"@code{line} and @code{line-column}") { /* UGH. diff --git a/lily/music.cc b/lily/music.cc index f7b734c238..ba6e8ce3c5 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -40,12 +40,12 @@ Music::internal_is_music_type (SCM k)const } String -Music::name ()const +Music::name () const { SCM nm = get_mus_property ("name"); - if (gh_string_p (nm)) + if (gh_symbol_p (nm)) { - return ly_scm2string (nm); + return ly_symbol2string (nm); } else { diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index 4140c596e0..c2e7c5eaf8 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -168,7 +168,7 @@ Piano_pedal_engraver::try_music (Music *m) { String nm = p->name_ + String ("Event"); if (gh_equal_p (m->get_mus_property ("name") , - scm_makfrom0str (nm.to_str0()))) + gh_symbol2scm (nm.to_str0()))) { Direction d = to_dir (m->get_mus_property ("span-direction")); p->req_l_drul_[d] = m; @@ -469,7 +469,6 @@ Piano_pedal_engraver::typeset_all () if (p->finished_bracket_) { - Grob * l = p->finished_bracket_->get_bound (LEFT); Grob * r = p->finished_bracket_->get_bound (RIGHT); if (!r) { diff --git a/ly/init.ly b/ly/init.ly index 1d6a26434b..fbb3ad6938 100644 --- a/ly/init.ly +++ b/ly/init.ly @@ -3,7 +3,7 @@ #(define-public point-and-click #f) #(define-public midi-debug #f) -\version "1.5.68" +\version "1.7.3" \include "declarations-init.ly" diff --git a/ly/midi-init.ly b/ly/midi-init.ly index a13f29d9eb..17c7709d07 100644 --- a/ly/midi-init.ly +++ b/ly/midi-init.ly @@ -2,6 +2,5 @@ \midi { \tempo 4=60 \include "performer-init.ly" -% unfold_all = "1" } diff --git a/ly/spanners-init.ly b/ly/spanners-init.ly index 3f24cf04ea..166108f4ad 100644 --- a/ly/spanners-init.ly +++ b/ly/spanners-init.ly @@ -1,11 +1,6 @@ \version "1.7.3" -#(define (make-span-event type spandir) - (let* ((m (make-music-by-name type))) - (ly:set-mus-property! m 'span-direction spandir) - m - )) groupOpen = #(make-span-event 'NoteGroupingEvent START) groupClose = #(make-span-event 'NoteGroupingEvent STOP) @@ -55,6 +50,7 @@ endcresc = \spanevent \stop "crescendo" % better name sustainstart/stop? sustainUp = #(make-span-event 'SustainPedalEvent STOP) +sustainDown = #(make-span-event 'SustainPedalEvent START) unaCorda = #(make-span-event 'UnaCordaEvent START) treCorde = #(make-span-event 'UnaCordaEvent STOP) diff --git a/scm/music-functions.scm b/scm/music-functions.scm index f078e40da4..57eee132f5 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -67,7 +67,7 @@ written by Rune Zedeler. " (if (equal? (ly:get-mus-property music 'iterator-ctor) Chord_tremolo_iterator::constructor) - (shift-ly:duration-log music (ly:intlog2 (ly:get-mus-property music 'repeat-count)) 0) + (shift-duration-log music (ly:intlog2 (ly:get-mus-property music 'repeat-count)) 0) ) (ly:set-mus-property! music 'length Repeated_music::unfolded_music_length) @@ -250,6 +250,13 @@ this is not an override m )) +(define-public (make-span-event type spandir) + (let* ( + (m (make-music-by-name type)) + ) + (ly:set-mus-property! m 'span-direction spandir) + m + )) (define-public (set-mus-properties! m alist) "Set all of ALIST as properties of M." diff --git a/scripts/convert-ly.py b/scripts/convert-ly.py index 7223cc30a2..01c7e9771e 100644 --- a/scripts/convert-ly.py +++ b/scripts/convert-ly.py @@ -1060,11 +1060,14 @@ if 1: r'pitch<\?', r'dir\?', 'music-duration-compress', + 'set-point-and-click!' ] origre = r'\b(%s)' % string.join (changed, '|') str = re.sub (origre, r'ly:\1',str) + str = re.sub ('set-point-and-click!', 'set-point-and-click', str) + return str conversions.append (((1,7,3), conv, 'ly- -> ly:'))