Re: Voice switching étude
On Dec 10, 2014, at 23:52 , Dan Eble wrote: > > Here’s a trick: routing music to different voices without using the > Part_combine_iterator. Instead, it uses the same infrastructure as for staff > switching. updated to generate per-part \change commands from the split list generated by \partcombine — Dan \version "2.19.15" % These are the parts that will be combined. The explicit \change % commands mimic \partcombineApart; they override the automated % decisions and send each part to its own voice. one = \relative { f'4 b b \change Voice = "1" b } two = \relative { b'4 b f \change Voice = "2" f } % Generate a split list using \partcombine. Context changes in the % input parts cause warnings, so strip them for this step. killContextChanges = #(define-music-function (parser location music) (ly:music?) (music-filter (lambda (m) (not (eq? (ly:music-property m 'name) 'ContextChange))) music)) combined = \partcombine \killContextChanges \one \killContextChanges \two % % Translate the split list to a sequence of \change commands for each part. % #(define part-one-slot-map ;; each entry is (split state . context id) '((apart . 1) (apart-silence . 1) (chords . shared) (silence1 . shared) (silence2 . null) (solo1 . shared) (solo2 . null) (unisono . shared) (unisilence . shared))) #(define part-two-slot-map ;; each entry is (split state . context id) '((apart . 2) (apart-silence . 2) (chords . shared) (silence1 . null) (silence2 . shared) (solo1 . null) (solo2 . shared) (unisono . null) (unisilence . null))) voiceChanges = #(define-music-function (parser location slot-map partcombinemusic) (list? ly:music?) (let ((m (list)) (prevMoment ZERO-MOMENT) (prevSlot (assq-ref slot-map 'apart))) (define (handle-split split) (let* ((moment (car split)) (slot (assq-ref slot-map (cdr split (if (not (eq? prevSlot slot)) (let ((dur (ly:moment-sub moment prevMoment))) (if (not (equal? dur ZERO-MOMENT)) (set! m (cons (make-music 'SkipEvent 'duration (make-duration-of-length dur)) m))) (set! m (cons (make-music 'ContextChange 'change-to-id (symbol->string slot) 'change-to-type 'Voice) m)) (set! prevMoment moment) (set! prevSlot slot))) )) (for-each handle-split (ly:music-property partcombinemusic 'split-list)) (make-sequential-music (reverse! m oneChanges = \voiceChanges #part-one-slot-map \combined twoChanges = \voiceChanges #part-two-slot-map \combined %#(display (ly:music-property combined 'split-list)) %\displayMusic \oneChanges %\displayMusic \twoChanges % Wrap each part in a "Part" context which can be moved from one Voice % context to another. % % A hierarchy such as Staff/VoiceSlot/Voice might make more sense in % musical terms than Staff/Voice/Part. \layout { \context { \name "Part" \type "Engraver_group" } \context { \Voice \accepts "Part" } } \score { \new Staff << \new Voice = "1" \with { \voiceOne } << \new Part << \oneChanges \one >> >> \new Voice = "2" \with { \voiceTwo } << \new Part << \twoChanges \two >> >> \new Voice = "shared" \with { \override NoteHead.color = #red } << % Contexts need to be kept alive in order to change to them. #(skip-of-length one) #(skip-of-length two) >> \new NullVoice = "null" << #(skip-of-length one) #(skip-of-length two) >> >> } ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Issue 4212: fix out-of-bounds index in division_maior() (issue 189420043 by nine.fierce.ball...@gmail.com)
On 2015/01/02 14:36:34, dak wrote: The case I was worried about was (line_pos.begin () < it - 1) This expression is undefined if it == line_pos.begin () since line_pos.begin () - 1 is undefined, being before the start of the array. Two lines up there is assert (line_pos.begin () < it), so it looks OK. https://codereview.appspot.com/189420043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Issue 4212: fix out-of-bounds index in division_maior() (issue 189420043 by nine.fierce.ball...@gmail.com)
On 2015/01/02 14:16:54, Dan Eble wrote: On 2015/01/02 08:56:03, dak wrote: > In particular, the compiler is allowed to make > line_pos.begin () < whatever the same as line_pos.begin () != whatever. * std::vector elements must be contiguous after C++03 (http://en.cppreference.com/w/cpp/container/vector) * it[n] is convertible to a reference and is equivalent to *(i + n) (http://en.cppreference.com/w/cpp/concept/RandomAccessIterator) Therefore there should be no problem with "x.begin() < it" as long as the vector is not empty and "it != x.end()". I'm not sure if anything constrains the implementation of x.end() to refer to the place this code assumes it does, so that might still be a problem. Still, I'm going to resist doing anything other than fixing the immediate problem. I do not want to risk spending a bunch of time debugging if I rewrite it wrong. The case I was worried about was (line_pos.begin () < it - 1) This expression is undefined if it == line_pos.begin () since line_pos.begin () - 1 is undefined, being before the start of the array. https://codereview.appspot.com/189420043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Doc: Clarified how to use clip-systems option (issue 186640043 by pkx1...@gmail.com)
just one nitpick, otherwise LGTM. https://codereview.appspot.com/186640043/diff/1/Documentation/notation/input.itely File Documentation/notation/input.itely (right): https://codereview.appspot.com/186640043/diff/1/Documentation/notation/input.itely#newcode2559 Documentation/notation/input.itely:2559: @ref{The layout block,,The @code{@bs{}layout} block}. No need for a third argument: @ref{The layout block} references the @node but will be rendered like the corresponding @sectioning argument (The @code{@bs{}layout} block) https://codereview.appspot.com/186640043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Issue 4212: fix out-of-bounds index in division_maior() (issue 189420043 by nine.fierce.ball...@gmail.com)
On 2015/01/02 08:56:03, dak wrote: In particular, the compiler is allowed to make line_pos.begin () < whatever the same as line_pos.begin () != whatever. * std::vector elements must be contiguous after C++03 (http://en.cppreference.com/w/cpp/container/vector) * it[n] is convertible to a reference and is equivalent to *(i + n) (http://en.cppreference.com/w/cpp/concept/RandomAccessIterator) Therefore there should be no problem with "x.begin() < it" as long as the vector is not empty and "it != x.end()". I'm not sure if anything constrains the implementation of x.end() to refer to the place this code assumes it does, so that might still be a problem. Still, I'm going to resist doing anything other than fixing the immediate problem. I do not want to risk spending a bunch of time debugging if I rewrite it wrong. https://codereview.appspot.com/189420043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Doc: Clarified how to use clip-systems option (issue 186640043 by pkx1...@gmail.com)
One nitpick, otherwise LGTM https://codereview.appspot.com/186640043/diff/1/Documentation/notation/input.itely File Documentation/notation/input.itely (right): https://codereview.appspot.com/186640043/diff/1/Documentation/notation/input.itely#newcode2541 Documentation/notation/input.itely:2541: This will extract a single fragment of the input file @code{starting} Should @code{starting} be @emph{starting} ? https://codereview.appspot.com/186640043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Issue 4212: fix out-of-bounds index in division_maior() (issue 189420043 by nine.fierce.ball...@gmail.com)
On 2015/01/02 08:56:03, dak wrote: On 2015/01/02 07:21:19, benko.pal wrote: > On 2015/01/01 23:08:56, Dan Eble wrote: > > On 2015/01/01 22:57:31, benko.pal wrote: > > > https://codereview.appspot.com/189420043/diff/1/lily/breathing-sign.cc > > > File lily/breathing-sign.cc (right): > > > > > > > > > https://codereview.appspot.com/189420043/diff/1/lily/breathing-sign.cc#newcode122 > lily/breathing-sign.cc:122: if (ydim[DOWN] < val && line_pos.begin () < it - 1) > I'd rather write > line_pos.begin () + 1 < it > but good catch anyway, thanks! Actually, all of those checks (existing and proposed) look like undefined behavior since they calculate a possibly non-existing iterator and compare with it. With most compilers and implementations things will probably work, but one can't really rely on it. In particular, the compiler is allowed to make line_pos.begin () < whatever the same as line_pos.begin () != whatever. it - 1 was used above as it[-1]; it exists, because ydim is a positive range (last if) strictly smaller than the whole staff (widening by negative amount), so it must be larger than begin, as asserted. https://codereview.appspot.com/189420043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: LSR item 523, fix typo
There isn't an @@file: the description is copied below. I'm assuming that the LSR export routine knows that it has to escape @ and { and so replaces them with @@ and @{. I know it also replaces with @code{, but am not sure whether would work, since it's not valid HTML: it would also not look good on the web version of the LSR. So I think might be the best bet. Existing description: Beat grouping within a measure is controlled by the context property beatStructure. Values of beatStructure are established for many time signatures in @file{scm/time-signature-settings.scm}. Values of beatStructure can be changed or set with \set. Alternatively, \time can be used to both set the time signature and establish the beat structure. For this, you specify the internal grouping of beats in a measure as a list of numbers (in Scheme syntax) before the time signature. \time applies to the Timing context, so it will not reset values of beatStructure or baseMoment that are set in other lower-level contexts, such as Voice. If the Measure_grouping_engraver is included in one of the display contexts, measure grouping signs will be created. Such signs ease reading rhythmically complex modern music. In the example, the 9/8 measure is grouped in two different patterns using the two different methods, while the 5/8 measure is grouped according to the default setting in @file{scm/time-signature-settings.scm}: -- Phil Holmes - Original Message - From: Federico Bruni To: Phil Holmes Cc: Devel ; Jean-Charles Malahieude Sent: Friday, January 02, 2015 9:42 AM Subject: Re: LSR item 523, fix typo 2015-01-02 10:25 GMT+01:00 Phil Holmes : Doc: correct texinfo formatting in snippet @@file@{…@} -> @file{…} This fix will be undone by the next LSR import. You should ask someone with write privilege to fix it on the LSR server: http://lsr.di.unimi.it/LSR/Item?id=523 I could do it, but am not sure of what to replace the 'file' tag with: ?? probably I don't undetstand your question.. AFAICS you should just change @@file to @file ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: LSR item 523, fix typo
2015-01-02 10:25 GMT+01:00 Phil Holmes : > Doc: correct texinfo formatting in snippet >> >> @@file@{…@} -> @file{…} >> >> This fix will be undone by the next LSR import. >> You should ask someone with write privilege to fix it on the LSR server: >> http://lsr.di.unimi.it/LSR/Item?id=523 >> > > > I could do it, but am not sure of what to replace the 'file' tag with: > ?? probably I don't undetstand your question.. AFAICS you should just change @@file to @file ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: LSR item 523, fix typo
- Original Message - From: "Federico Bruni" To: "Devel" ; "Jean-Charles Malahieude" Sent: Friday, January 02, 2015 8:14 AM Subject: LSR item 523, fix typo Jean-Charles, regarding this commit: commit c86ce585e9451663b80beb5d03ee28a00b07e8e8 Author: Jean-Charles Malahieude Date: Sun Dec 28 16:50:40 2014 +0100 Doc: correct texinfo formatting in snippet @@file@{…@} -> @file{…} This fix will be undone by the next LSR import. You should ask someone with write privilege to fix it on the LSR server: http://lsr.di.unimi.it/LSR/Item?id=523 I could do it, but am not sure of what to replace the 'file' tag with: ?? -- Phil Holmes ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Doc; CG - add more specific note for Guile (issue 193870043 by pkx1...@gmail.com)
On 2015/01/02 00:22:11, J_lowe wrote: On 2015/01/02 00:09:19, Trevor Daniels wrote: > https://codereview.appspot.com/193870043/diff/1/Documentation/included/compile.itexi > File Documentation/included/compile.itexi (right): > > https://codereview.appspot.com/193870043/diff/1/Documentation/included/compile.itexi#newcode78 > Documentation/included/compile.itexi:78: (1.8.8 - version 2.x is not currently > supported) > I think we're currently shipping Guile 1.8.7. Has Lily been tested with 1.8.8? > Just a query. > > Trevor Oh, I just did guile --version on my own System to see what it was I had installed and it came up with 1.8.8. (also guile-1.8 --version returns the same thing) I *assume* therefore that when I build LP from master and run it it is using 1.8.8 I do not have an pre-installed Linux or Windows system to test this. James Fine, 1.8.8 is probably right then. 2.19.15 was released with 1.8.7 but it seems latest in master uses 1.8.8. Trevor https://codereview.appspot.com/193870043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
Re: Issue 4212: fix out-of-bounds index in division_maior() (issue 189420043 by nine.fierce.ball...@gmail.com)
On 2015/01/02 07:21:19, benko.pal wrote: On 2015/01/01 23:08:56, Dan Eble wrote: > On 2015/01/01 22:57:31, benko.pal wrote: > > https://codereview.appspot.com/189420043/diff/1/lily/breathing-sign.cc > > File lily/breathing-sign.cc (right): > > > > > https://codereview.appspot.com/189420043/diff/1/lily/breathing-sign.cc#newcode122 > > lily/breathing-sign.cc:122: if (ydim[DOWN] < val && line_pos.begin () < it - > 1) > > I'd rather write > > line_pos.begin () + 1 < it > > but good catch anyway, thanks! > > I also find the whole surrounding code difficult to read, but I don't want to > spend any more time on this than I have to. Thanks for the feedback. your code is fine, I withdraw my suggestion (I should never hurry a review). thanks again! Actually, all of those checks (existing and proposed) look like undefined behavior since they calculate a possibly non-existing iterator and compare with it. With most compilers and implementations things will probably work, but one can't really rely on it. In particular, the compiler is allowed to make line_pos.begin () < whatever the same as line_pos.begin () != whatever. https://codereview.appspot.com/189420043/ ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel
LSR item 523, fix typo
Jean-Charles, regarding this commit: commit c86ce585e9451663b80beb5d03ee28a00b07e8e8 Author: Jean-Charles Malahieude Date: Sun Dec 28 16:50:40 2014 +0100 Doc: correct texinfo formatting in snippet @@file@{…@} -> @file{…} This fix will be undone by the next LSR import. You should ask someone with write privilege to fix it on the LSR server: http://lsr.di.unimi.it/LSR/Item?id=523 ___ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel