Andrew,

On Tue, Apr 28, 2015 at 4:46 AM, Andrew Bernard <andrew.bern...@gmail.com>
wrote:

> Hi Urs and David,
>
> Thanks so much. Yes, my chords are in voices so the slurs all face the
> same direction accordingly. I was completely unaware of this aspect of
> engraving. I had better study more scores and order that copy of Behind
> Bars!
>
> But then the question becomes transformed - can you tell the tie engraver
> for a voice to override its default behaviour, even though that may be
> technically incorrect? I have literally several hundred I need to tweak.
>
>
No easy way that I know of.  Or, rather, no way that doesn't involve a lot
of copied code from various files.  The attached should make life easier,
but note that it won't work in at least one construct.

Best,
David
\version "2.19.17"

#(define direction-polyphonic-grobs
  '(AccidentalSuggestion
    DotColumn
    Dots
    Fingering
    LaissezVibrerTie
    LigatureBracket
    MultiMeasureRest
    PhrasingSlur
    RepeatTie
    Rest
    Script
    Slur
    Stem
    TextScript
    ;;Tie
    TupletBracket
    TrillSpanner))

#(define general-grace-settings
  `((Voice Stem font-size -3)
    (Voice Flag font-size -3)
    (Voice NoteHead font-size -3)
    (Voice TabNoteHead font-size -4)
    (Voice Dots font-size -3)
    (Voice Stem length-fraction 0.8)
    (Voice Stem no-stem-extend #t)
    (Voice Beam beam-thickness 0.384)
    (Voice Beam length-fraction 0.8)
    (Voice Accidental font-size -4)
    (Voice AccidentalCautionary font-size -4)
    (Voice Script font-size -3)
    (Voice Fingering font-size -8)
    (Voice StringNumber font-size -8)))

#(define (make-voice-props-set n)
  (make-sequential-music
   (append
    (map (lambda (x) (make-grob-property-set x 'direction
                                             (if (odd? n) -1 1)))
         direction-polyphonic-grobs)
    (list
     (make-property-set 'graceSettings general-grace-settings)
     (make-grob-property-set 'NoteColumn 'horizontal-shift (quotient n 2))))))

#(define (make-voice-props-override n)
  (make-sequential-music
   (append
    (map (lambda (x) (make-grob-property-override x 'direction
                                                  (if (odd? n) -1 1)))
         direction-polyphonic-grobs)
    (list
     (make-property-set 'graceSettings general-grace-settings)
     (make-grob-property-override 'NoteColumn 'horizontal-shift (quotient n 2))))))

#(define (make-voice-props-revert)
  (make-sequential-music
   (append
    (map (lambda (x) (make-grob-property-revert x 'direction))
         direction-polyphonic-grobs)
    (list (make-property-unset 'graceSettings)
          (make-grob-property-revert 'NoteColumn 'horizontal-shift)))))

voiceOne   = #(context-spec-music (make-voice-props-set 0)  'Voice)
voiceTwo   = #(context-spec-music (make-voice-props-set 1)  'Voice)
voiceThree = #(context-spec-music (make-voice-props-set 2)  'Voice)
voiceFour  = #(context-spec-music (make-voice-props-set 3)  'Voice)
oneVoice   = #(context-spec-music (make-voice-props-revert) 'Voice)

chord = { <c' e' g'>~ <c' e' g'> }

{
  \chord
  \voiceOne \chord 
  \voiceTwo \chord
  << {  \voiceOne <c'' e''>~ <c'' e''> } \new Voice { \voiceTwo <c' e'>~ <c' e'> } >>
  % does not work
  << { <c'' e''>~ <c'' e''> } \\ { <c' e'>~ <c' e'> } >>
}
    
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to