lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Create \= command for setting spanner-id (issue 268050045 by address


From: dak
Subject: Re: Create \= command for setting spanner-id (issue 268050045 by address@hidden)
Date: Sun, 04 Oct 2015 03:58:31 +0000

Reviewers: thomasmorley651,


https://codereview.appspot.com/268050045/diff/1/Documentation/notation/expressive.itely
File Documentation/notation/expressive.itely (right):

https://codereview.appspot.com/268050045/diff/1/Documentation/notation/expressive.itely#newcode724
Documentation/notation/expressive.itely:724: them with @code{\=}
followed by an identifying number or string.
On 2015/10/04 00:45:35, thomasmorley651 wrote:
If we explain the needed label may be number or string, why not give
an example
for each in the code below.

Because the documentation needs to be complete but the examples show the
intended practice?  spanner-id is a string and there does not seem to be
a point not to admit strings with \= but I don't expect anything but
numbers to be in use at Voice-level.  when non-Voice level slurs are
supported by discriminating using spanner-id, I expect something like a
regexp or the first letter to be the distinguishing feature.  Granted,
that may make digits (which don't combine with letters) not even the
best idea as base.  The main advantage is that they save you from
inventing a name for something ad-hoc.

https://codereview.appspot.com/268050045/diff/1/Documentation/notation/expressive.itely#newcode728
Documentation/notation/expressive.itely:728: <c~ f\=1( g\=2( >2 <c e\=1)
a\=2) >
On 2015/10/04 00:45:35, thomasmorley651 wrote:
Am I correct this example does only work with the fix for issue 4625
applied?

Yes.  I saw no point in avoiding 4625 here as it likely will be the most
common reason to use \= and it has no bikesheddable elements that could
still require changing this example.  It's conceivable to assign
in-chord slurs in sequence by default so that no slur id is required.
But that would be a rather complex extension.  So this example is likely
to remain relevant for a while.

Description:
Create \= command for setting spanner-id

Also contains commits:

NR: document \= in slur sections


Make some regtests use \= instead of their own definitions

Please review this at https://codereview.appspot.com/268050045/

Affected files (+39, -22 lines):
  M Documentation/learning/common-notation.itely
  M Documentation/notation/expressive.itely
  M input/regression/phrasing-slur-multiple.ly
  M input/regression/slur-multiple.ly
  M ly/spanners-init.ly


Index: Documentation/learning/common-notation.itely
diff --git a/Documentation/learning/common-notation.itely b/Documentation/learning/common-notation.itely index e5b3a652a34487e14ddc15a0afc78f35ef5b9f8c..9ce651fc02c13e40cff9363c6f5ab49317c934d8 100644
--- a/Documentation/learning/common-notation.itely
+++ b/Documentation/learning/common-notation.itely
@@ -334,9 +334,8 @@ starting note and ending note are marked with @code{(} and
 Music Glossary: @rglos{slur}, @rglos{phrasing}.

 Slurs to indicate longer @notation{phrasing} can be entered with
address@hidden(} and @code{\)}.  You can have both @notation{slurs}
-and phrasing slurs at the same time, but you cannot have
-simultaneous slurs or simultaneous phrasing slurs.
address@hidden(} and @code{\)}.  You can have both @notation{slurs} and
+phrasing slurs at the same time.

 @lilypond[verbatim,quote]
 \relative { g'4\( g8( a) b( c) b4\) }
Index: Documentation/notation/expressive.itely
diff --git a/Documentation/notation/expressive.itely b/Documentation/notation/expressive.itely index 52259c6c95abf2e223d03929e0b07fc828f5cf52..f999363cb4d69e9da17b000f7d2b135164addd13 100644
--- a/Documentation/notation/expressive.itely
+++ b/Documentation/notation/expressive.itely
@@ -714,10 +714,20 @@ Slurs may be manually placed above or below the staff; see
 @cindex slur, phrasing
 @cindex slurs, multiple
 @cindex slurs, simultaneous
address@hidden \=

-Simultaneous or overlapping slurs are not permitted, but a phrasing
-slur can overlap a slur.  This permits two slurs to be printed at
-once.  For details, see @ref{Phrasing slurs}.
+Simultaneous or overlapping slurs require special attention.  Most
+occurences of outer slurs actually indicate phrasing, and phrasing
+slurs may overlap a regular slur, see @ref{Phrasing slurs}.  When
+multiple regular slurs are needed in a single @code{Voice},
+matching slur starts and ends need to be labelled by preceding
+them with @code{\=} followed by an identifying number or string.
+
address@hidden,quote]
+\fixed c' {
+  <c~ f\=1( g\=2( >2 <c e\=1) a\=2) >
+}
address@hidden lilypond

 @cindex slur style
 @cindex slur, solid
@@ -878,7 +888,8 @@ may be manually placed above or below the staff; see
 @cindex phrasing slur, simultaneous
 @cindex phrasing slur, multiple

-Simultaneous or overlapping phrasing slurs are not permitted.
+Simultaneous or overlapping phrasing slurs are entered using
address@hidden as with regular slurs, see @ref{Slurs}.

 @funindex phrasingSlurDashed
 @funindex \phrasingSlurDashed
Index: input/regression/phrasing-slur-multiple.ly
diff --git a/input/regression/phrasing-slur-multiple.ly b/input/regression/phrasing-slur-multiple.ly index 08487af5d9386df8b3381b87d4ed34d10f65235f..adf8221845b9a8077eca0c446bb161607f51aee3 100644
--- a/input/regression/phrasing-slur-multiple.ly
+++ b/input/regression/phrasing-slur-multiple.ly
@@ -1,4 +1,4 @@
-\version "2.19.22"
+\version "2.19.29"

 #(ly:set-option 'warning-as-error #f)
 #(ly:expect-warning (_ "already have phrasing slur"))
@@ -12,14 +12,10 @@ slur will not be generated. However, one can can create a second slur with
 a different spanner-id."
 }

-sp=#(define-event-function (n e) (index? ly:event?)
-     (set! (ly:music-property e 'spanner-id) (format "sp~a" n))
-     e)
-
 \relative {
% This will give warnings ("Already have phrasing slur" and "Cannot end phrasing slur")
-  c''4\(\(\sp1\( d4\)\(\sp1\( e4\) f\) |
+  c''4\(\(\=1\( d4\)\(\=1\( e4\) f\) |
% This will give two overlapping slurs and "unterminated phrasing slur" from above
-  d\(  d\sp2\( e\) f\sp2\) |
+  d\(  d\=2\( e\) f\=2\) |

 }
Index: input/regression/slur-multiple.ly
diff --git a/input/regression/slur-multiple.ly b/input/regression/slur-multiple.ly index a5e8b38c6061885d878f8fa49eb7a222b1adef94..007b69773ec293a7d30af9d6043bda472b3fde3b 100644
--- a/input/regression/slur-multiple.ly
+++ b/input/regression/slur-multiple.ly
@@ -1,4 +1,4 @@
-\version "2.19.22"
+\version "2.19.29"

 #(ly:set-option 'warning-as-error #f)
 #(ly:expect-warning (_ "already have slur"))
@@ -12,14 +12,10 @@ slur will not be generated. However, one can can create a second slur with
 a different spanner-id."
 }

-sp=#(define-event-function (n e) (index? ly:event?)
-     (set! (ly:music-property e 'spanner-id) (format "sp~a" n))
-     e)
-
 \relative {
   % This will give warnings ("Already have slur" and "Cannot end slur")
-  c''4((\sp1( d4)(\sp1( e4) f) |
+  c''4((\=1( d4)(\=1( e4) f) |
   % This will give two overlapping slurs and "unterminated slur" from above
-  d(  d\sp2( e) f\sp2) |
+  d(  d\=2( e) f\=2) |

 }
Index: ly/spanners-init.ly
diff --git a/ly/spanners-init.ly b/ly/spanners-init.ly
index 50cf12dbb2d188db45321083b1fd40bd21f0d418..756a55579e377935ab3b7242db358a54eb499576 100644
--- a/ly/spanners-init.ly
+++ b/ly/spanners-init.ly
@@ -1,4 +1,19 @@
-\version "2.16.0"
+\version "2.19.29"
+
+"\\=" =
+#(define-event-function (id event) (number-or-string? ly:event?)
+  (_i "This sets the @code{spanner-id} property of the following
address@hidden to the given @var{id} (numbers will be converted to a
+string).  This can be used to tell LilyPond how to connect overlapping
+or parallel slurs or phrasing slurs within a single @code{Voice}.
address@hidden,verbatim]
+\\fixed c' { c\\=1( d\\=2( e\\=1) f\\=2) }
address@hidden lilypond\n")
+  (set! (ly:music-property event 'spanner-id)
+       (if (number? id)
+           (number->string id)
+           id))
+  event)

 startGroup = #(make-span-event 'NoteGroupingEvent START)
 stopGroup = #(make-span-event 'NoteGroupingEvent STOP)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]