]> git.donarmstrong.com Git - lilypond.git/commitdiff
Merge branch 'master' into translation
authorFrancisco Vila <francisco.vila@hispalinux.es>
Fri, 27 Apr 2012 22:49:19 +0000 (00:49 +0200)
committerFrancisco Vila <francisco.vila@hispalinux.es>
Fri, 27 Apr 2012 22:49:19 +0000 (00:49 +0200)
Documentation/changes.tely
Documentation/learning/fundamental.itely
Documentation/notation/expressive.itely
Documentation/notation/fretted-strings.itely
Documentation/web/news-front.itexi
lily/dispatcher.cc
lily/fingering-engraver.cc
lily/include/dispatcher.hh
lily/rhythmic-music-iterator.cc
ly/music-functions-init.ly
scm/define-event-classes.scm

index e57bbe7562eba77fe817a45b9d492552fcc550a8..e69766caccdd2b537760b52fe00e5fff873ae262 100644 (file)
@@ -138,33 +138,32 @@ the Scheme function @code{event-chord-wrap!}  converts to the old
 representation; using one of those might be easiest for keeping legacy
 code operative.
 
-The advantages of making input and music match more closely are
-numerous: music functions previously worked differently when used inside
-or outside of chords.  Now they are the same, including all the
-possibilities of argument parsing.  You can now use music variables
-inside of chords: a construct like
+The following three items are consequences of this change.
+
+@item
+Music functions now work the same when used inside or outside of chords,
+including all the possibilities of argument parsing.  Music variables
+can be used inside of chords: a construct like
 @lilypond[verbatim,quote,ragged-right]
 tonic=fis'
 { <\tonic \transpose c g \tonic> }
 @end lilypond
 @noindent
-would have been unthinkable previously.  You can use
-@code{#@{@dots{}#@}} for constructing chord constituents.  Music
-functions inside of chords are no longer specially treated and thus
-accept the same arguments as outside of chords.  @code{\tweak} now works
-on single notes without needing to wrap them in a chord.  In theory, it
-can also work on command events and lyrics now.  Since that was not
-possible before, it depends on luck on a case-by-case basis whether the
-tweak internals are already receiving the necessary information.  Users
-are asked to report those cases where they find @code{\tweak} not
-working according to reasonable expectations.
+now works as expected.  One can use @code{#@{@dots{}#@}} for
+constructing chord constituents.  @code{\tweak} now works on single
+notes without needing to wrap them in a chord.  Using it on command
+events and lyrics is now possible, but not likely to give results yet.
+
+@item
+The repetitive chord entry aid @code{q} has been reimplemented.
+Repeated chords are now replaced right before interpreting a music
+expression.  In case the user wants to retain some events of the
+original chord, he can run the repeat chord replacement function
+@code{\chordRepeats} manually.
 
 @item
-As one consequence, it was possible to reimplement the repetitive chord
-entry aid @code{q}.  Repeated chords are now replaced right before
-interpreting a music expression.  In case the user wants to retain
-some events of the original chord, he can run the repeat chord
-replacement function @code{\chordRepeats} manually.
+String numbers and right hand fingerings on single notes now appear
+without having to be written inside of chord brackets.
 
 @item
 Scheme expressions inside of embedded Lilypond (@code{#@{@dots{}#@}})
index 847c8489e750718470c5e6d6a4af6f3f8bb514ba..a419121dcab455f346f2cf6e2000a57b4f203897 100644 (file)
@@ -578,10 +578,10 @@ In fact, a Voice layer or context is the only one which can contain
 music.  If a Voice context is not explicitly declared one is created
 automatically, as we saw at the beginning of this chapter.  Some
 instruments such as an Oboe can play only one note at a time.  Music
-written for such instruments is monophonic and requires just a single
-voice.  Instruments which can play more than one note at a time like
-the piano will often require multiple voices to encode the different
-concurrent notes and rhythms they are capable of playing.
+written for such instruments requires just a single voice.  Instruments
+which can play more than one note at a time like the piano will often
+require multiple voices to encode the different concurrent notes and
+rhythms they are capable of playing.
 
 A single voice can contain many notes in a chord, of course,
 so when exactly are multiple voices needed?  Look first at
@@ -616,7 +616,7 @@ The fragments must also be separated with double backward slashes,
 @code{\\}, to place them in separate voices.  Without these, the
 notes would be entered into a single voice, which would usually
 cause errors.  This technique is particularly suited to pieces of
-music which are largely monophonic with occasional short sections
+music which are largely homophonic with occasional short sections
 of polyphony.
 
 Here's how we split the chords above into two voices and add both
@@ -1027,22 +1027,21 @@ markup, ties, slurs, and dynamics:
 }
 @end lilypond
 
-Now let's look at three different ways to notate the same passage
-of polyphonic music, each of which is advantageous in different
+Now let's look at three different ways to notate the same passage of
+polyphonic music, each of which is advantageous in different
 circumstances, using the example from the previous section.
 
-An expression that appears directly inside a @code{<< >>} belongs
-to the main voice (but, note, @strong{not} in a @code{<< \\ >>}
-construct).  This is useful when extra voices appear while the
-main voice is playing.  Here is a more correct rendition of our
-example.  The red diamond-shaped notes
-demonstrate that the main melody is now in a single voice context,
+An expression that appears directly inside a @code{<< >>} belongs to the
+main voice (but, note, @strong{not} in a @code{<< \\ >>} construct).
+This is useful when extra voices appear while the main voice is playing.
+Here is a more correct rendition of our example.  The red diamond-shaped
+notes demonstrate that the main melody is now in a single voice context,
 permitting a phrasing slur to be drawn over them.
 
 @lilypond[quote,ragged-right,verbatim]
 \new Staff \relative c' {
   \voiceOneStyle
-  % The following notes are monophonic
+  % This section is homophonic
   c16^( d e f
   % Start simultaneous section of three voices
   <<
index 0d86f3e639dd7b1344726ce61b11e680dd37e088..d38175ce4858544b5b34f441de1c4ab1a93ef64e 100644 (file)
@@ -989,18 +989,14 @@ indicates the pitch interval that the fall or doit will extend
 @emph{beyond} the main note.
 
 @lilypond[verbatim,quote,relative=2]
-c2-\bendAfter #+4
-c2-\bendAfter #-4
-c2-\bendAfter #+6.5
-c2-\bendAfter #-6.5
-c2-\bendAfter #+8
-c2-\bendAfter #-8
+c2\bendAfter #+4
+c2\bendAfter #-4
+c2\bendAfter #+6.5
+c2\bendAfter #-6.5
+c2\bendAfter #+8
+c2\bendAfter #-8
 @end lilypond
 
-The dash @code{-} immediately preceding the @code{\bendAfter}
-command is @emph{required} when writing falls and doits.
-
-
 @snippets
 
 @lilypondfile[verbatim,quote,texidoc,doctitle]
index e8deaafb8c9402363d8e4f9195a39416d2d4c82d..31bbe5ca9711a797cca28d77bcd5164c46cbf97f 100644 (file)
@@ -97,25 +97,25 @@ Notation Reference:
 @cindex fingering vs. string numbers
 
 The string on which a note should be played may be indicated by
-appending @code{\@var{number}} to a note inside a chord construct
-@code{<>}.
-
-@warning{String numbers @strong{must} be defined inside a chord
-construct even if there is only a single note.}
+appending @code{\@var{number}} to a note.
 
 @lilypond[verbatim,quote,relative=0]
 \clef "treble_8"
-<c\5>4 <e\4> <g\3>2
+c4\5 e\4 g2\3
 <c,\5 e\4 g\3>1
 @end lilypond
 
 When fingerings and string indications are used together, their
-placement is controlled by the order in which the two items appear
-in the code:
+placement can be controlled by the order in which the two items appear
+in the code @emph{only} if they appear inside of an explicit chord:
+applied to whole chords or single notes @emph{outside} of chords,
+fingerings are placed using a different mechanism.
 
 @lilypond[verbatim,quote,relative=1]
 \clef "treble_8"
-<g\3-0>2
+g4\3-0
+g-0\3
+<g\3-0>
 <g-0\3>
 @end lilypond
 
@@ -224,16 +224,16 @@ symbols = {
 
 By default pitches are assigned to the lowest playing position on the
 fret-board (first position).  Open strings are automatically preferred.
-If you would like a certain pitch to be played on a specific string
-you can add a string number indication to the pitch name.  If you
-define pitch names and string numbers without a chord construct
-(@code{<>}) the string number indications do not appear in traditional
-notation.  It is much more comfortable to define the playing position
-by using the value of @code{minimumFret}.  The default value for
-minimumFret is 0.
+If you would like a certain pitch to be played on a specific string you
+can add a string number indication to the pitch name.  If you don't want
+to have string number indications appear in traditional notation, you
+can override the respective stencil.  Usually it will be more
+comfortable to define the playing position by using the value of
+@code{minimumFret}.  The default value for minimumFret is 0.
 
 
 @lilypond[quote,ragged-right,verbatim]
+\layout { \override Voice.StringNumber #'stencil = ##f }
 \new StaffGroup <<
    \new Staff \relative c {
      \clef "treble_8"
@@ -269,7 +269,7 @@ as @code{\tabChordRepeats}.
 
 @lilypond[quote,verbatim]
 guitar = \relative c' {
-  r8 <gis-6 cis-6 b-0>~ q4 q8~ q q4
+  r8 <gis-2 cis-3 b-0>~ q4 q8~ q q4
 }
 
 \new StaffGroup <<
@@ -374,6 +374,7 @@ Harmonic indications can be added to tablature notation as sounding
 pitches:
 
 @lilypond[verbatim,quote]
+\layout { \override Voice.StringNumber #'stencil = ##f }
 firstHarmonic = {
   d'4\4\harmonic
   g'4\3\harmonic
@@ -521,14 +522,17 @@ written.
 
 @lilypond[quote,ragged-right,verbatim]
 <<
-  \new Staff {
+  \new Voice \with {
+    \override StringNumber #'stencil = ##f
+  } {
     \clef "bass_8"
     \relative c, {
       c4 d e f
     }
   }
-  \new TabStaff {
-    \set TabStaff.stringTunings = #bass-tuning
+  \new TabStaff \with {
+    stringTunings = #bass-tuning
+  } {
     \relative c, {
       c4 d e f
     }
@@ -1576,28 +1580,27 @@ with non-monotonic tunings.
 @funindex rightHandFinger
 @funindex \rightHandFinger
 
-Right-hand fingerings @var{p-i-m-a} must be entered within a
-chord construct @code{<>} for them to be printed in the score,
-even when applied to a single note.
+Right-hand fingerings @var{p-i-m-a} must be entered using
+@code{\rightHandFinger} followed by a number.
 
-@warning{There @strong{must} be a hyphen before
-@code{@bs{}rightHandFinger} and a space before the closing @code{>}.}
+@warning{If the number is entered in Scheme notation, remember to append
+a space before following it with a closing @code{>} or similar.}
 
 @lilypond[quote,verbatim,relative=0]
 \clef "treble_8"
-<c-\rightHandFinger #1 >4
-<e-\rightHandFinger #2 >
-<g-\rightHandFinger #3 >
-<c-\rightHandFinger #4 >
-<c,-\rightHandFinger #1 e-\rightHandFinger #2
- g-\rightHandFinger #3 c-\rightHandFinger #4 >1
+c4\rightHandFinger #1
+e\rightHandFinger #2
+g\rightHandFinger #3
+c\rightHandFinger #4
+<c,\rightHandFinger #1 e\rightHandFinger #2
+ g\rightHandFinger #3 c\rightHandFinger #4 >1
 @end lilypond
 
 For convenience, you can abbreviate @code{\rightHandFinger} to something
 short, for example @code{RH},
 
 @example
-#(define RH rightHandFinger)
+RH=#rightHandFinger
 @end example
 
 
index 98a26577096d5b4ef96fff0594efcb3d6c4c6a7b..33ca5dee82183080de4a71c7d06e395e747d411c 100644 (file)
@@ -9,6 +9,20 @@
 @c used for news about the upcoming release; see CG 10.2
 
 
+@newsItem
+@subsubheading LilyPond takes part in Google Summer of Code 2012!  @emph{April 25, 2012}
+
+Being a part of @uref{http://www.gnu.org/, GNU project}, we are participating in
+@uref{http://www.google-melange.com/gsoc/homepage/google/gsoc2012,
+Google Summer of Code program}, which offers students stipends for
+working on open source software.
+
+Our contributor Janek WarchoĊ‚ was accepted for 2012 edition of GSoC.
+He will be working on advanced lyrics positioning in LilyPond.
+
+@newsEnd
+
+
 @newsItem
 @subsubheading Release candidate 5 of 2.16 - LilyPond 2.15.37 released!  @emph{April 19, 2012}
 
index 94519021abe43ccb4def37ce25fa595e3dd676a9..4db7c93a1555a66a9cffc6772ea9ac349a263379 100644 (file)
@@ -173,6 +173,27 @@ Dispatcher::dispatch (SCM sev)
 #endif
 }
 
+bool
+Dispatcher::is_listened (Stream_event *ev)
+{
+  SCM class_symbol = ev->get_property ("class");
+  if (!scm_is_symbol (class_symbol))
+    {
+      warning (_ ("Event class should be a symbol"));
+      return false;
+    }
+
+  for (SCM cl = scm_call_1 (ly_lily_module_constant ("ly:make-event-class"), class_symbol);
+       scm_is_pair (cl); cl = scm_cdr (cl))
+    {
+      SCM list = scm_hashq_ref (listeners_, scm_car (cl), SCM_EOL);
+      if (scm_is_pair (list))
+        return true;
+    }
+  return false;
+}
+
+
 void
 Dispatcher::broadcast (Stream_event *ev)
 {
index 355e102c6f4f4b7e31be2a7f8fcca1d6e4001a74..a364947b08eb363e02718616aab51a359d07136b 100644 (file)
@@ -39,7 +39,6 @@ protected:
   void stop_translation_timestep ();
   void process_music ();
   DECLARE_TRANSLATOR_LISTENER (fingering);
-  DECLARE_TRANSLATOR_LISTENER (stroke_finger);
   DECLARE_ACKNOWLEDGER (rhythmic_head);
   DECLARE_ACKNOWLEDGER (stem);
 
@@ -54,17 +53,6 @@ Fingering_engraver::listen_fingering (Stream_event *ev)
   events_.push_back (ev);
 }
 
-IMPLEMENT_TRANSLATOR_LISTENER (Fingering_engraver, stroke_finger);
-void
-Fingering_engraver::listen_stroke_finger (Stream_event * /* ev */)
-{
-  /*
-    FIXME: should do something.
-
-    This function is mainly here to shut up a warning
-   */
-}
-
 void
 Fingering_engraver::acknowledge_stem (Grob_info inf)
 {
index d812b27c63ccf73021db1e714db672999b5f1083..b11167121bb93ebf2b1a83f8c3ec7f0349bdbccf 100644 (file)
@@ -39,6 +39,7 @@ class Dispatcher
 public:
   Dispatcher ();
   void broadcast (Stream_event *ev);
+  bool is_listened (Stream_event *ev);
   void add_listener (Listener, SCM event_class);
   void remove_listener (Listener, SCM event_class);
   void register_as_listener (Dispatcher *dist);
index 1246e3854272ec622ef10e1766a9bb1024e2be96..427436a12f00ba96c0c96ac438056cf36dfa1b49 100644 (file)
@@ -59,17 +59,12 @@ Rhythmic_music_iterator::process (Moment m)
           SCM unlistened = SCM_EOL;
           for (; scm_is_pair (arts); arts = scm_cdr (arts))
             {
-              if (scm_is_true
-                  (scm_call_2
-                   (ly_lily_module_constant ("any"),
-                    ly_lily_module_constant ("ly:is-listened-event-class"),
-                    scm_call_1
-                    (ly_lily_module_constant ("ly:make-event-class"),
-                     unsmob_stream_event (scm_car (arts))
-                     ->get_property ("class")))))
-                listened = scm_cons (scm_car (arts), listened);
+             SCM art = scm_car (arts);
+
+              if (c->event_source ()->is_listened (unsmob_stream_event (art)))
+                listened = scm_cons (art, listened);
               else
-                unlistened = scm_cons (scm_car (arts), unlistened);
+                unlistened = scm_cons (art, unlistened);
             }
           ev->set_property ("articulations", scm_reverse_x (unlistened, SCM_EOL));
           c->event_source ()->broadcast (ev);
index 80c3020ac04b7a2574ad72b85e59cad45edffaac..59a11264f7c741d84d3c854494adfd3f8cdfad2c 100644 (file)
@@ -178,7 +178,7 @@ barNumberCheck =
                                         cbn n))))))
 
 bendAfter =
-#(define-music-function (parser location delta) (real?)
+#(define-event-function (parser location delta) (real?)
    (_i "Create a fall or doit of pitch interval @var{delta}.")
    (make-music 'BendAfterEvent
               'delta-step delta))
@@ -952,7 +952,7 @@ for time signatures of @var{time-signature}.")
    (revert-time-signature-setting time-signature))
 
 rightHandFinger =
-#(define-music-function (parser location finger) (number-or-string?)
+#(define-event-function (parser location finger) (number-or-string?)
    (_i "Apply @var{finger} as a fingering indication.")
 
    (make-music
index 875993b4078b36ec5cda6d32d90a236329a65f00..fee440ad508f1924691f15d7e2e1e18e6eb20c78 100644 (file)
 (define unlistened-music-event-classes
   '(harmonic-event line-break-event page-break-event page-turn-event label-event
                   solo-one-event solo-two-event skip-event unisono-event
-                  part-combine-force-event break-dynamic-span-event))
+                  part-combine-force-event break-dynamic-span-event
+                  stroke-finger-event))
 
 ;; produce neater representation of music event tree.
 ;; TODO: switch to this representation for the event-classes list?