Hello Walt, rather than switching between staves with different tunings, why not simply hide Staff lines if not required?
Use \stopStaff and \startStaff to change line positions. See the appended file for details. Cheers, Valentin Am Donnerstag, 6. Juni 2024, 19:25:45 MESZ schrieb Walt North: > Well... I'm getting closer. > > I got the alignment to work by adding two dummy string values at the > top. That looks like it makes the result line up without showing the two > dummy lines at the top. > > Now if I could just the get lines to show for the two low strings on the > notes that need them to help distinguish between 7th and 8th strings. > > Here is the code I added and the resulting image. > > steelGuitarSixStringCSixTuning = \stringTuning <e, g, a, c e g> > test = \stringTuning <g,, c, e, g, a, c e g g g > > > \new TabStaff { > \relative c { > \set Staff.stringTunings = \steelGuitarSixStringCSixTuning > e,4 e e e | e e e e > } > \relative c { > \set Staff.stringTunings = \test > e,4 e d a > } > \relative c { > \set Staff.stringTunings = \steelGuitarSixStringCSixTuning > e,4 e e e | e e e e > } > } > > On 6/6/2024 1:15 AM, Walt North wrote: > > ok - here is a made up example. Code and screenshot are below. > > > > Let's say I had a very short piece of 5 bars. > > > > 4 bars can be played fine on the upper six strings. > > > > But there is one bar that dips down into a couple of lower notes > > needing to be played on 7th and 8th strings. > > > > If this were a longer piece I was trying to fit on two pages I would > > be loosing a lot of space for the sake of just two bars if I use the > > eight string tab all the way through. > > > > In this example I can force the one bar to use eight string tab on its > > own tabStaff. But if I had maybe 3 or 4 such bars scattered through > > out the piece this starts to defeat my space saving goal. Refer to > > lines 1 through 3 in the screen shot. Note that second line uses an 8 > > string tabStaff. > > > > I have found by changing the string tuning in between notes in the > > same Tabstaff it seems to try to work but doesn't quite get there. > > Refer to the 4th line in the screen shot. It seems get a little > > confused when it tries to connect the bars with different numbers of > > lines. Line 4 in the screen shot should have the notes one line > > lower. It has the notes incorrectly shifted up one line and doesn't > > give any indication of what string is needed for the low notes (i.e. > > one or two lines below the TabStaff - similar to the behavior of > > adding ledger lines below a normal staff), > > > > Here is the lilypond code. > > > > \version "2.24.2" > > > > steelGuitarSixStringCSixTuning = \stringTuning <e, g, a, c e g> > > steelGuitarEightStringCSixTuning = \stringTuning <g,, c, e, g, a, c e g> > > > > %This is musically correct but it forces a separate line > > \new TabStaff { > > \relative c { > > \set Staff.stringTunings = \steelGuitarSixStringCSixTuning > > e,4 e e e | e e e e > > } > > } > > \new TabStaff { > > \relative c { > > \set Staff.stringTunings = \steelGuitarEightStringCSixTuning > > e,4 e c g > > } > > } > > \new TabStaff { > > \relative c { > > \set Staff.stringTunings = \steelGuitarSixStringCSixTuning > > e,4 e e e | e e e e > > } > > } > > > > %This seems to try to work but it gets a little confused becase > > %third bar should be one line lower and there is no indication > > %whether the lowest note is seventh or eight string. > > \new TabStaff { > > \relative c { > > \set Staff.stringTunings = \steelGuitarSixStringCSixTuning > > e,4 e e e | e e e e > > } > > \relative c { > > \set Staff.stringTunings = \steelGuitarEightStringCSixTuning > > e,4 e c g > > } > > \relative c { > > \set Staff.stringTunings = \steelGuitarSixStringCSixTuning > > e,4 e e e | e e e e > > } > > > > } > > > > > > And here is a screen shot of the result. > > > > On 6/5/2024 11:03 PM, David Kastrup wrote: > >> Walt North<waltno...@gmail.com> writes: > >>> I occasionally write out Tab notation parts for 6 or 8 string lap > >>> steel guitar. I have created tuning entries for these and it works > >>> well using Minimum fret and max fret difference values. Here is my > >>> question. 90% of the time I only need the upper six strings and just > >>> occasionally dip down to the 7th and 8th strings for a few > >>> notes. Which means most of the time there is unneeded page space used > >>> up. I could use different tab staffs intermittently but that gets > >>> pretty cumbersome when it is only be an occasional note or two. And > >>> I've never been able to get things realigned vertically when going > >>> back and forth between 6 string and 8 string tabstaff. > >>> > >>> Is there any approach that would add just a lower tabstaff line for > >>> the 7th or 8th string as needed - similar to the way ledger lines are > >>> added to regular staff when the notes go down to middle C or lower? > >>> > >>> Maybe something with markup? > >> > >> Have you tried adding the Ledger_line_engraver to your TabStaff ? > >> > >> Do you have any example code to work with?
\version "2.25.13" %%%%% This code to better bar lines when staff extent changes %%%%% (especially on breaks). This only affects extent. Most likely it makes sense to also adjust e.g. %%%%% repeat dot position for left and right side. This would optimally need properties for left and right %%%%% extent. % Simple engraver that adds the left hand staff symbols to barlines #(define (bar-line-left-ss-engraver context) (let ((left-ss #f) (current-ss #f) (barlines '())) (make-engraver (acknowledgers ((staff-symbol-interface engraver grob source-engraver) (set! current-ss grob)) ((bar-line-interface engraver grob source-engraver) (set! barlines (cons grob barlines)))) ((process-acknowledged engraver) (for-each (lambda (grob) (ly:grob-set-object! grob 'left-staff-symbol left-ss)) barlines) (set! left-ss current-ss) (set! barlines '()))))) % Redefinintion of ly:bar-line::calc-bar-extent@scm/bar-line.scm which includes lhs ss in extent #(define (ly:bar-line::calc-bar-extent-left grob) (let* ((r-staff-symbol (ly:grob-object grob 'staff-symbol)) (staff-symbol (ly:grob-object grob 'left-staff-symbol)) (staff-symbol (if (ly:grob? staff-symbol) staff-symbol r-staff-symbol))) (if (ly:grob? staff-symbol) (let ((staff-extent (ly:grob-property staff-symbol 'widened-extent)) (bar-line-color (ly:grob-property grob 'color)) (staff-color (ly:grob-property staff-symbol 'color))) ;; FIXME: "red" not eq? to #(rgb-color 1 0 0) (if (eq? bar-line-color staff-color) ;; Due to rounding problems, bar lines extending to the outermost edges ;; of the staff lines appear wrongly in on-screen display ;; (and, to a lesser extent, in print) - they stick out a pixel. ;; The solution is to extend bar lines only to the middle ;; of the staff line - unless they have different colors, ;; when it would be undesirable. ;; ;; This reduction should not influence whether the bar is to be ;; expanded later, so length is not updated on purpose. (let ((half-staff-line-thickness (* 1/2 (ly:staff-symbol-line-thickness grob)))) (interval-widen staff-extent (- half-staff-line-thickness))) staff-extent)) '(0 . 0)))) #(define (ly:bar-line::calc-bar-extent-symmetric grob) (let ((ext-r (ly:bar-line::calc-bar-extent grob)) (ext-l (ly:bar-line::calc-bar-extent-left grob))) (cond ((= (ly:item-break-dir grob) LEFT) ext-l) ((= (ly:item-break-dir grob) RIGHT) ext-r) (else (interval-union ext-l ext-r))))) \layout { \context { \Staff \consists #bar-line-left-ss-engraver \override BarLine.bar-extent = #ly:bar-line::calc-bar-extent-symmetric } \context { \TabStaff \consists #bar-line-left-ss-engraver \override BarLine.bar-extent = #ly:bar-line::calc-bar-extent-symmetric } } %%%%%%%%%% steelGuitarEightStringCSixTuning = \stringTuning <g,, c, e, g, a, c e g> sixStrings = { \stopStaff \override Staff.StaffSymbol.line-positions = #'(1 -1 3 -3 5 -5) \startStaff } eightStrings = { \stopStaff \override Staff.StaffSymbol.line-positions = #'(1 -1 3 -3 5 -5 -7 -9) \startStaff } % Simple engraver that shifts all grobs with the rhythmic-head-interface by some offset #(define ((shift-staff-space-engraver offset) context) (make-engraver (acknowledgers ((rhythmic-head-interface engraver grob source-engraver) (ly:grob-set-property! grob 'staff-position (+ (ly:grob-property grob 'staff-position) offset)))))) \new TabStaff \with { instrumentName = "Git" stringTunings = \steelGuitarEightStringCSixTuning % Only show six strings \sixStrings % Shift position of tab note heads so that lowest strings are offcenter % (alternatively use shifted line positions and set clefPosition to 2, % but then things like Instrument Name will be offcenter) \consists #(shift-staff-space-engraver -2) } \relative c \repeat unfold 6 { e,4 e e e | e e e e | \eightStrings e e c g | \sixStrings e' e e e | e e e e }
signature.asc
Description: This is a digitally signed message part.