Re: Doubled entries with partcombiner
Am 10.04.2015 um 23:07 schrieb Urs Liska: Am 10.04.2015 um 23:05 schrieb Urs Liska: Am 10.04.2015 um 01:29 schrieb Urs Liska: Am 08.04.2015 um 10:18 schrieb Mark Knoop: At 09:35 on 08 Apr 2015, Urs Liska wrote: Am 8. April 2015 08:28:47 MESZ, schrieb Urs Liska : Hi all, what is the most viable approach to suppress all the doubled items like makuos, markups dynamics etc. that are produced by the partcombiner? Perhaps the merge-rests-engraver in OLL is adaptable? I could now look at that code, and it seems promising. Provided it can perform its action later than the partcombiner. But I think this should be the case. Unfortunately I'm not sure yet if I manage to make that work. In any case I don't think I'll be able to adapt it to spanners because that would require a significant additional layer of housekeeping compared to "simple" markups. OK, I've done a very primitive rewriting of the merge-rests-engraver, as can be seen in the attachment. Surprisingly the file compiled without real errors on first try, but it issued a warning " Sorry, hit the wrong keyboard shortcut ;-( The file issued the warning: warning: unknown translator: `merge-markups-engraver' warning: cannot find: `merge-markups-engraver' and produced "normal" output. Can anyone point me to the right direction to make this "engraver" noticed by the \score? OK, sorry, I immediately found two errors whose fixes make the file compile without warnings - but at first still without visible result. In line 37 I have to feed "markups" into the for-each loop and not "mkup". And the engraver has to be consisted like \consists #merge-markups-engraver, And from there I was able to solve my initial request with regards to markups. See attached file. I managed to remove doubled markups and also DynamicText items. However, the next step would be to catch hairpins and text spanners too - because they are also very annoying in partcombined staves. PLEASE help me with this because a) I'm quite urgently in need to fix this stuff for a current project and b) I'm sure this will result in a very helpful tool for common use. Many thanks in advance Urs Thanks Urs ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user \version "2.18.0" % Merge identical TextScript objects in multiple voices of a staff, % like they are produced by the partcombiner. % Based on an engraver by Jay Anderson, from % "http://www.mail-archive.com/lilypond-user%40gnu.org/msg69608.html"; % Engraver listening for TextScript grobs. % When two or more TextScripts are present at the same moment % and their text content is identical, all but the first one % are omitted through setting their 'stencil property to false. #(define merge-markups-engraver (lambda (context) (let ((markups '()) (processed-markups '())) `((start-translation-timestep . ,(lambda (trans) (set! markups '( (stop-translation-timestep . ,(lambda (trans) (if (> (length markups) 1) (begin ;; There are more than one markups at the time-step (set! processed-markups '()) (for-each (lambda (mkup) ;; Retrieve the text content for the iterated markup grob (let ((text (markup->string (ly:grob-property mkup 'text (if (member text processed-markups) ;; If we have already encountered this text omit the grob ... (ly:grob-set-property! mkup 'stencil #f) ;; ... else accept it this time and add it to the list of ;; encountered texts (set! processed-markups (append processed-markups (list text)) (reverse markups)) (acknowledgers (text-interface . ,(lambda (engraver grob source-engraver) (if (member (assoc-ref (ly:grob-property grob 'meta) 'name) '(TextScript DynamicText )) (set! markups (cons grob markups)) %%{ musica = \relative c'' { \partcombineApart c1^\markup "Test" c1^\markup "Test" c1^\markup "Test" % TODO % Also handle hairpins (or other spanners). % Obviously removing the stencil of the middle \p doesn't do any harm % to the behaviour of the hairpins. c1 \< c1 \p c1 \> c1 \! } musicb = \relative c' { c1_\markup "Test" c1_\markup "Prost" c1 _\markup "Test" ^\markup "Test-alternative" c1 \< c1 \p c1 \> c1 \! } \score { \new Staff \with { \consists #merge-markups-engraver } \partcombine \musica \musicb \layout
Re: Doubled entries with partcombiner
Am 10.04.2015 um 23:05 schrieb Urs Liska: Am 10.04.2015 um 01:29 schrieb Urs Liska: Am 08.04.2015 um 10:18 schrieb Mark Knoop: At 09:35 on 08 Apr 2015, Urs Liska wrote: Am 8. April 2015 08:28:47 MESZ, schrieb Urs Liska : Hi all, what is the most viable approach to suppress all the doubled items like makuos, markups dynamics etc. that are produced by the partcombiner? Perhaps the merge-rests-engraver in OLL is adaptable? I could now look at that code, and it seems promising. Provided it can perform its action later than the partcombiner. But I think this should be the case. Unfortunately I'm not sure yet if I manage to make that work. In any case I don't think I'll be able to adapt it to spanners because that would require a significant additional layer of housekeeping compared to "simple" markups. OK, I've done a very primitive rewriting of the merge-rests-engraver, as can be seen in the attachment. Surprisingly the file compiled without real errors on first try, but it issued a warning " Sorry, hit the wrong keyboard shortcut ;-( The file issued the warning: warning: unknown translator: `merge-markups-engraver' warning: cannot find: `merge-markups-engraver' and produced "normal" output. Can anyone point me to the right direction to make this "engraver" noticed by the \score? Thanks Urs \version "2.18.0" \header { snippet-title = "merge-rests-engraver" snippet-author = "Jay Anderson" snippet-source = "http://www.mail-archive.com/lilypond-user%40gnu.org/msg69608.html"; snippet-description = \markup { Merge rests of equal duration in different voice } tags = "merge, rest, rests, voice, voices" status = "ready" } #(define has-one-or-less (lambda (lst) (or (null? lst) (null? (cdr lst) #(define has-at-least-two (lambda (lst) (not (has-one-or-less lst #(define (all-equal lst pred) (or (has-one-or-less lst) (and (pred (car lst) (cadr lst)) (all-equal (cdr lst) pred #(define merge-markups-engraver (lambda (context) (let ((markups-equal? (lambda (markup-a markup-b) (string=? (markup->string markup-a) (markup->string markup-b (markups '())) `((start-translation-timestep . ,(lambda (trans) (set! markups '( (stop-translation-timestep . ,(lambda (trans) (if (and (has-at-least-two markups) (all-equal markups markups-equal?)) (for-each (lambda (mkup) (ly:grob-set-property! mkup 'Y-offset 0)) mkup (acknowledgers (text-interface . ,(lambda (engraver grob source-engraver) (if (eq? 'Markup (assoc-ref (ly:grob-property grob 'meta) 'name)) (set! markups (cons grob markups)) \score { \new Staff \with { \consists merge-markups-engraver } << \new Voice { \voiceOne c''^\markup "Test" } \new Voice { \voiceTwo c'_\markup "Test" } >> \layout {} }___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Doubled entries with partcombiner
Am 10.04.2015 um 01:29 schrieb Urs Liska: Am 08.04.2015 um 10:18 schrieb Mark Knoop: At 09:35 on 08 Apr 2015, Urs Liska wrote: Am 8. April 2015 08:28:47 MESZ, schrieb Urs Liska : Hi all, what is the most viable approach to suppress all the doubled items like makuos, markups dynamics etc. that are produced by the partcombiner? Perhaps the merge-rests-engraver in OLL is adaptable? I could now look at that code, and it seems promising. Provided it can perform its action later than the partcombiner. But I think this should be the case. Unfortunately I'm not sure yet if I manage to make that work. In any case I don't think I'll be able to adapt it to spanners because that would require a significant additional layer of housekeeping compared to "simple" markups. OK, I've done a very primitive rewriting of the merge-rests-engraver, as can be seen in the attachment. Surprisingly the file compiled without real errors on first try, but it issued a warning " ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Doubled entries with partcombiner
On Wed, Apr 08, 2015 at 06:18:20PM +0200, Reinhold Kainhofer wrote: > Dear Urs, > I'm using a tag for those items: > > r8 r8 c,8(-\tag #'non-partcombine \pp | % 91 > d4) cis8 | % 92 > > And then in the partcombine call, I filter out that tag: > >\partcombine{\removeWithTag #'non-partcombine > \VChorSIMusic}{\removeWithTag #'non-partcombine \VChorSIIMusic} [...] Thanks for the tip, this worked wonders for a score I'm working on right now! T -- This is not a sentence. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Doubled entries with partcombiner
Dear Urs, I'm using a tag for those items: r8 r8 c,8(-\tag #'non-partcombine \pp | % 91 d4) cis8 | % 92 And then in the partcombine call, I filter out that tag: \partcombine{\removeWithTag #'non-partcombine \VChorSIMusic}{\removeWithTag #'non-partcombine \VChorSIIMusic} However, in many cases, the voices can actually be combined, but the partcombiner simply does not detect this. E.g. Voice 1: d2\< c2 | c1\!\ff Voice 2: h2\< a4 g | a1\!\ff Due to the different rhythm, the partcombiner will keep this apart by default. Some explicit \partcombineChordsOnce solve the double dynamics issue in this case (and provide better partcombining): Voice 1: \partcombineChordsOnce d2\< c2 | \partcombineChordsOnce c1\!\ff Voice 2: h2\< a4 g | a1\!\ff Best regards, Reinhold Am 2015-04-08 um 09:35 schrieb Urs Liska: Am 8. April 2015 08:28:47 MESZ, schrieb Urs Liska : Hi all, what is the most viable approach to suppress all the doubled items like makuos, markups dynamics etc. that are produced by the partcombiner? TIA Urs ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user -- -- Reinhold Kainhofer, reinh...@kainhofer.com, http://www.kainhofer.com/ * Open Tools, Software Development, http://www.open-tools.net/ * Edition Kainhofer, Music Publisher, http://www.edition-kainhofer.com/ ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Doubled entries with partcombiner
At 09:35 on 08 Apr 2015, Urs Liska wrote: >Am 8. April 2015 08:28:47 MESZ, schrieb Urs Liska : >>Hi all, >> >>what is the most viable approach to suppress all the doubled items >>like makuos, > >markups > >> dynamics etc. that are produced by the partcombiner? Perhaps the merge-rests-engraver in OLL is adaptable? -- Mark Knoop ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: Doubled entries with partcombiner
Am 8. April 2015 08:28:47 MESZ, schrieb Urs Liska : >Hi all, > >what is the most viable approach to suppress all the doubled items like >makuos, markups > dynamics etc. that are produced by the partcombiner? > >TIA >Urs > > > >___ >lilypond-user mailing list >lilypond-user@gnu.org >https://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Doubled entries with partcombiner
Hi all, what is the most viable approach to suppress all the doubled items like makuos, dynamics etc. that are produced by the partcombiner? TIA Urs___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user