Hello,

Le 26/03/2021 à 15:23, bart deruyter a écrit :
Hey,

- thanks for the idea, but after some thought, I'm afraid it won't work. Glissandi don't seem to be the right tool anyway since in the regular staff I'd have to hide it, and when I'd need a real 'glissando' as glissando, I'd have to unhide it. I'm sure it would end up being a real mess, certainly when someone else would edit the file later on.

I've already tried to find a way to achieve a regular line as sustain line, if that can be rotated or adjusted, but I only found three styles, text, bracket and mixed. Is there a way to change it in a regular line and adjust the angle? Using a sustain pedal-line would be more appropriate because that I could consistently hide in the regular staff. And that is what these lines represent anyway. Guitarists, nor lutists use it in a regular staff anyway, as far as I know, so it could easily be hidden in the regular staff.

Hijacking piano pedals is doable. However, I went for a different approach, using the Episema grob. This is much simpler as its callbacks are those from the line-spanner-interface already, and it is contained in the same VerticalAxisGroup as the StaffSymbol (unlike piano pedals which are spaced on a different line, with all the implications to let them join specific staff positions).

-My solution for the dots does not seem to be good after all. I've added the "New_fingering_engraver" to the tabstaff and modified the strokefinger to show a dot.
At first it worked, but when applying it in chords, I get this error:
programming error: no side-axis setting found for grob StrokeFinger.

When the Tabstaff is commented out, lilypond does not complain. When used on a single note (in the chord, or at a standalone note) lilypond doesn't complain either. My guess is that TabStaff can't completely handle fingering, at least not right hand fingering because normally we don't add fingeringnotation in a tabstaff. Or maybe I have to add another 'consists' that I'm not aware of?


A comment in ly/engraver-init.ly tells that Script_column_engraver must come before New_fingering_engraver:

https://gitlab.com/lilypond/lilypond/-/blob/master/ly/engraver-init.ly#L251

Thus, one has to \remove the Script_column_engraver and add it later again.

Note that these two engravers are designed to operate in voice-like contexts, not staff-like contexts.

I've added the .ly file in attachment so everyone can see what I'm trying to achieve (I've omitted the glissando for now).

- This leads me to a third issue I had, but somewhat solved: the font. To get the right appearance you must have the font installed (= the 'somewhat' :-) ). It probably will fallback to a default font if you don't have it. Today I discovered Musescore appears to have similar fonts for lute tablature. If french tablature letters can be included in lilyponds default font, maybe these might be an interesting starting point.

I can confirm that this renders awfully over here.

If you want to make a feature request for LilyPond, the bug-lilypond list is the way to go:

http://lilypond.org/contact.html

Best,
Jean

\version "2.22.0"


#(define (raise-by-half-space grob)
    (ly:grob-set-property! grob
                           'staff-position
                           (+ 1.0 (ly:grob-property grob 'staff-position))))

#(define (calc-pseudo-pedal-bound-info grob)
   (let* ((staff-symbol (ly:grob-object grob 'staff-symbol))
          (staff-space (ly:staff-symbol-staff-space staff-symbol))
          (left-Y (* -1.5 staff-space))
          (right-Y (* -0.5 staff-space)))
     `((left . ((Y . ,left-Y)))
       (right . ((Y . ,right-Y))))))


\layout {
  indent = 0
  \context {
    \Score
    \override SpacingSpanner.spacing-increment = 3
  }
  \context {
    \TabStaff
    tablatureFormat = #fret-letter-tablature-format 
    stringTunings = \stringTuning <g, c e a >
    fretLabels = #'("a" "b" "c" "d" "e" "f" "g" "h" "i" "k" "l")
    pedalSustainStyle = #'bracket
    \remove "Clef_engraver"
    \remove "Time_signature_engraver"
    \override StrokeFinger.staff-padding = ##f
    \omit StringNumber
    \override TabNoteHead.whiteout = ##f
    \override TabNoteHead.before-line-breaking = #raise-by-half-space
    \override TabNoteHead.font-name = "LeRoy"
  }
  \context {
    \Staff
    \omit StringNumber
    \omit StrokeFinger
  }
  \context {
    \TabVoice
    \remove "Script_column_engraver"
    \consists "New_fingering_engraver"
    \consists "Script_column_engraver"
    \consists "Episema_engraver"
    \override Episema.Y-offset = 0
    \override Episema.bound-details = #calc-pseudo-pedal-bound-info
  }
  \context {
    \Dynamics
    \consists "Note_heads_engraver"
    \omit NoteHead
    \override NoteHead.X-extent = #'(0 . 0.65)
    \consists "Stem_engraver"
    \override Stem.length = 6
    \override Stem.direction = #UP
    \override Flag.stencil = #old-straight-flag
    \override VerticalAxisGroup.staff-affinity = #DOWN
    \override VerticalAxisGroup.nonstaff-relatedstaff-spacing.minimum-distance = 10
    \override VerticalAxisGroup.nonstaff-unrelatedstaff-spacing.padding = 2.5
  }
}

RHd = \rightHandFinger \markup \fontsize #4 \musicglyph "dots.dot"

mySustainOn = \episemInitium
mySustainOff = \episemFinis


music = \relative c' {
  \mergeDifferentlyHeadedOn
  \mergeDifferentlyDottedOn
  \time 2/4
  <c e-\RHd g-\RHd>2
  <<
    { a8  b'\mySustainOn c_\RHd fis\mySustainOff }
    \\
    { \voiceTwo a,,4. }
  >>
}

rhythm = {
  c4 16 s s s
}



<< 
  \new Staff {
    \music
  }
  \new Dynamics \scaleDurations 2 \rhythm
  
  \new TabStaff {
    \override Beam.concaveness = #10000
    \transpose c c, { \music}
  }
>>

Reply via email to