|
|
Created:
10 years, 10 months ago by uliska Modified:
10 years, 10 months ago CC:
lilypond-devel_gnu.org Visibility:
Public. |
DescriptionIssue 3916: Add \alternatingTimeSignatures
A function to print a group of time signatures indicating a section
of music with (irregularly) changing meters.
Takes a list of lists, each sublist representing one time signature.
The first of the time signatures will be used to set the new effective
time signature, apart from that the function doesn't affect timing at all.
Patch Set 1 #Patch Set 2 : Fixing doc error #
Total comments: 1
Patch Set 3 : rewording doc section #Patch Set 4 : rewording doc section, now correctly rebased #
Total comments: 8
Patch Set 5 : reword docs according to Trevor's suggestions #
Total comments: 8
Patch Set 6 : Change to \fractionList, add argument validation and the printing of hyphens #MessagesTotal messages: 19
Fixing doc error
Sign in to reply to this message.
On 2014/05/09 09:02:44, uliska wrote: > Fixing doc error I think I found the issue (no new line after end of lilypond example). I'm very sorry that I currently can't test make doc due to an installation issue with dblatex. But I can't imagine any other spot here that could cause make doc to fail.
Sign in to reply to this message.
https://codereview.appspot.com/97110045/diff/20001/Documentation/notation/rhy... File Documentation/notation/rhythms.itely (right): https://codereview.appspot.com/97110045/diff/20001/Documentation/notation/rhy... Documentation/notation/rhythms.itely:1780: Different from compound time signatures As opposed to compound ... But the sentence is totally incomprehensible even when fixing that. "does not affect the musical structure because the different meters are used individually"? What is that supposed to mean?
Sign in to reply to this message.
rewording doc section
Sign in to reply to this message.
On 2014/05/10 08:33:44, uliska wrote: > rewording doc section Oops? This Patch set is invalid ...
Sign in to reply to this message.
rewording doc section, now correctly rebased
Sign in to reply to this message.
This is the right one, hopefully better understandable
Sign in to reply to this message.
I've suggested some style changes to conform to the rest of the NR. (We try to avoid referring to the reader with 'you', and entering LilyPond code within text, instead leaving the example to speak for itself.) Otherwise, LGTM. Trevor https://codereview.appspot.com/97110045/diff/60001/Documentation/notation/rhy... File Documentation/notation/rhythms.itely (right): https://codereview.appspot.com/97110045/diff/60001/Documentation/notation/rhy... Documentation/notation/rhythms.itely:1754: aren't printed individually. They are printed using the are not https://codereview.appspot.com/97110045/diff/60001/Documentation/notation/rhy... Documentation/notation/rhythms.itely:1762: Each sublist represents one time signature to be printed. Start a new para here. https://codereview.appspot.com/97110045/diff/60001/Documentation/notation/rhy... Documentation/notation/rhythms.itely:1765: behaviour using @code{\undo \omit Score.TimeSignature}. Printing the time signature changes in the following music may be suppressed: https://codereview.appspot.com/97110045/diff/60001/Documentation/notation/rhy... Documentation/notation/rhythms.itely:1784: the first given time signature, and you are responsible ... time signature, but subsequent time signature changes must be entered in the music as usual.
Sign in to reply to this message.
reword docs according to Trevor's suggestions
Sign in to reply to this message.
https://codereview.appspot.com/97110045/diff/60001/Documentation/notation/rhy... File Documentation/notation/rhythms.itely (right): https://codereview.appspot.com/97110045/diff/60001/Documentation/notation/rhy... Documentation/notation/rhythms.itely:1754: aren't printed individually. They are printed using the On 2014/05/10 09:52:40, Trevor Daniels wrote: > are not Done. https://codereview.appspot.com/97110045/diff/60001/Documentation/notation/rhy... Documentation/notation/rhythms.itely:1762: Each sublist represents one time signature to be printed. On 2014/05/10 09:52:40, Trevor Daniels wrote: > Start a new para here. Done. https://codereview.appspot.com/97110045/diff/60001/Documentation/notation/rhy... Documentation/notation/rhythms.itely:1765: behaviour using @code{\undo \omit Score.TimeSignature}. On 2014/05/10 09:52:40, Trevor Daniels wrote: > Printing the time signature changes in the following > music may be suppressed: Done. https://codereview.appspot.com/97110045/diff/60001/Documentation/notation/rhy... Documentation/notation/rhythms.itely:1784: the first given time signature, and you are responsible On 2014/05/10 09:52:41, Trevor Daniels wrote: > ... time signature, but subsequent time signature > changes must be entered in the music as usual. Done, but slightly modified to express the intention clearer
Sign in to reply to this message.
Come comments. https://codereview.appspot.com/97110045/diff/80001/ly/music-functions-init.ly File ly/music-functions-init.ly (right): https://codereview.appspot.com/97110045/diff/80001/ly/music-functions-init.ly... ly/music-functions-init.ly:144: #{ \once\override Staff.TimeSignature.stencil = Shouldn't this override be at Score level? https://codereview.appspot.com/97110045/diff/80001/ly/music-functions-init.ly... ly/music-functions-init.ly:149: #(map (lambda (x) #{ \markup \center-column #(map number->string x) #}) This assumes that the user will input lists of 2 elements. What if the user enters just one number, or more than two, for example \alternatingTimeSignatures #'((6 1 8)(5)) ? The function should either handle such input gracefully or emit a warning/error.
Sign in to reply to this message.
https://codereview.appspot.com/97110045/diff/80001/ly/music-functions-init.ly File ly/music-functions-init.ly (right): https://codereview.appspot.com/97110045/diff/80001/ly/music-functions-init.ly... ly/music-functions-init.ly:144: #{ \once\override Staff.TimeSignature.stencil = On 2014/05/10 20:49:09, janek wrote: > Shouldn't this override be at Score level? Any other ideas? I have the impression that Staff. works just as well? https://codereview.appspot.com/97110045/diff/80001/ly/music-functions-init.ly... ly/music-functions-init.ly:149: #(map (lambda (x) #{ \markup \center-column #(map number->string x) #}) On 2014/05/10 20:49:08, janek wrote: > This assumes that the user will input lists of 2 elements. What if the user > enters just one number, or more than two, for example \alternatingTimeSignatures > #'((6 1 8)(5)) ? The function should either handle such input gracefully or > emit a warning/error. Entering more than two numbers seems gracefully enough: A column of the given numbers will be created and the first two are used for the effective time. The result is self-explaining IMO. But entering only one number will actually fail with an error that doesn't point the user to the right place or cause. So I agree that this should be improved.
Sign in to reply to this message.
The score is harder to understand with this function, than it was after I expanded the function's contents in-line. The boundary of the action of this function (part timing, mostly printed representation) is hard to understand and remember. This version of the function does partial changes to the internal timing, and part to the printed indication. The built-in functions described in the manual up to this point make consistent changes to *both* LilyPond's counting of measures and to the printed time signature. https://codereview.appspot.com/97110045/diff/80001/ly/music-functions-init.ly File ly/music-functions-init.ly (right): https://codereview.appspot.com/97110045/diff/80001/ly/music-functions-init.ly... ly/music-functions-init.ly:130: alternatingTimeSignatures = The function does not do what its name implies, alternate time signatures, so you need a long explanation. LilyPond has a more understandable way to change the *printed* time-signature, with \override..stencil. I suggest you make a function to handle just the part that users might find difficult to do themselves: fractionList = #(define-scheme-function (parser location timesigs) (list?) (lambda (grob) (grob-interpret-markup grob ... \new Staff \relative c' { \time 6/8 \once\override Score.TimeSignature.stencil = \fractionList #'((6 8)(5 8)(1)) c8 c c c c c \override Score.TimeSignature.stencil = ##f \time 5/8 c8 c c c c \revert Score.TimeSignature.stencil \time 3/4 ... https://codereview.appspot.com/97110045/diff/80001/ly/music-functions-init.ly... ly/music-functions-init.ly:144: #{ \once\override Staff.TimeSignature.stencil = On 2014/05/10 22:38:29, uliska wrote: > I have the impression that Staff. works just as well? Well, if there are many staves, your function changes the initial time signature for the whole score, but prints the special indication only on one Staff, unless the user includes the function in each staff. (There is a context called Timing for the general case; Timing is usually the same as Score, unless the user has different meter in each Staff.)
Sign in to reply to this message.
On 2014/05/10 09:52:41, Trevor Daniels wrote: > (We try to avoid referring to the reader with 'you', Instruction manuals, especially those for a machine, usually make clear what actions the user takes versus what the machine does. This manual doesn't even use third person (as in "The user indicates the octave with..." and "The software chooses the traditional...") but prefers passive voice with the actor implied by contextual clues. Sometimes the only clue is the choice of modal verb between "can" or "might", "must" or "will".
Sign in to reply to this message.
This notation _may_ make a score harder to read than typing all meter changes explicitly. But the intention of this patch is not to provide a better notation but to better support an existing notation. https://codereview.appspot.com/97110045/diff/80001/ly/music-functions-init.ly File ly/music-functions-init.ly (right): https://codereview.appspot.com/97110045/diff/80001/ly/music-functions-init.ly... ly/music-functions-init.ly:130: alternatingTimeSignatures = On 2014/05/10 23:50:11, Keith wrote: > The function does not do what its name implies, alternate time signatures, so > you need a long explanation. > > LilyPond has a more understandable way to change the *printed* time-signature, > with \override..stencil. I suggest you make a function to handle just the part > that users might find difficult to do themselves: > fractionList = #(define-scheme-function > (parser location timesigs) (list?) > (lambda (grob) > (grob-interpret-markup grob > ... > > \new Staff \relative c' { > \time 6/8 > \once\override Score.TimeSignature.stencil = > \fractionList #'((6 8)(5 8)(1)) > c8 c c c c c > \override Score.TimeSignature.stencil = ##f > \time 5/8 > c8 c c c c > \revert Score.TimeSignature.stencil > \time 3/4 > ... After some consideration I agree that it is better to make the function a little bit more basic. This leaves the user somewhat more to type, but also leaves some flexibility to him: - user can decide which context to override in (e.g. if Timing has been moved) - user can decide to make the first actual \time different from the displayed (although I can't think that's an actual use case) https://codereview.appspot.com/97110045/diff/80001/ly/music-functions-init.ly... ly/music-functions-init.ly:144: #{ \once\override Staff.TimeSignature.stencil = On 2014/05/10 23:50:12, Keith wrote: > On 2014/05/10 22:38:29, uliska wrote: > > I have the impression that Staff. works just as well? > > Well, if there are many staves, your function changes the initial time signature > for the whole score, but prints the special indication only on one Staff, unless > the user includes the function in each staff. (There is a context called Timing > for the general case; Timing is usually the same as Score, unless the user has > different meter in each Staff.) That's true and a case I missed to check. So overriding in the Score context is the correct way. Of course this is obsolete with the principal change to the function I'm going to do.
Sign in to reply to this message.
Change to \fractionList, add argument validation and the printing of hyphens
Sign in to reply to this message.
It took a while because in the meantime Peter Bjuhr joined efforts, and we implemented the option of printing hyphens between the time signatures. While I don't like this and wouldn't use it personally, it's explicitly suggested by Gould. Additional changes: - change to \fractionList that only returns the stencil for overriding TimeSignature.stencil. This makes the function more versatile (also works when user moved Timing away from the Score context). - Issue a compiler warning when the argument doesn't consist of a list of two-element lists. One missing thing: I think the appearance of the hyphen should be configurable but I'm not sure about a consistent way to do so. What I would be able to implement is checking if the user has defined certain variables, and if he did use their content to define the appearance. But I don't think that's clean design and interface. I would prefer the user doing some \override, but I don't know how/if that can be achieved. But I would not make this feature (i.e. its lack) block the patch.
Sign in to reply to this message.
On 2014/05/16 07:06:46, uliska wrote: > It took a while because in the meantime Peter Bjuhr joined efforts, and we > implemented the option of printing hyphens between the time signatures. While I > don't like this and wouldn't use it personally, it's explicitly suggested by > Gould. > > Additional changes: > - change to \fractionList that only returns the stencil > for overriding TimeSignature.stencil. > This makes the function more versatile > (also works when user moved Timing away from the > Score context). > - Issue a compiler warning when the argument doesn't > consist of a list of two-element lists. > > One missing thing: > I think the appearance of the hyphen should be configurable but I'm not sure > about a consistent way to do so. > What I would be able to implement is checking if the user has defined certain > variables, and if he did use their content to define the appearance. But I don't > think that's clean design and interface. I would prefer the user doing some > \override, but I don't know how/if that can be achieved. > But I would not make this feature (i.e. its lack) block the patch. Well, we have \omit already. What if we had \appearance [markup] [grobname or music] Which would basically be the syntactic sugar for overriding the stencil with an appropriate grob-interpret-markup? That way one could just define some markup function for formatting time signatures and use it either in markup contexts or indeed for overriding a time signature.
Sign in to reply to this message.
|