For some reason my replies don't seem to be making back to the user list.  Will try one more time - apologies if this ends up being a duplicate.

--------------------

In my attempt to keep the example trimmed down I ended up leaving out key details.  So I have some stuff back in. And some of the stuff would be hiding in include files but they are included in this example.

The goal is to have two or more verse/chorus sets of notes. Normally there would be chord symbols etc. The notes would be backing notes behind the vocal and I have left the vocal stuff out.  The backing notes can be played on either a standard guitar tuning or on a steel guitar C6 tuning.  So depending on the note sequence run, the frets and strings used would differ depending what instrument they are being played on.  My goal is to define the note sequence once and then fill in any specific instrument fretting/string details as needed.  In this made up example set of notes I would want the fist measure of the verse and the first measure of the chorus to use default fretting and strings.  The second measure would want to start on a specific fret and for the last note to specify a string. Again... just a made up example to demonstrate what I'm trying to do.  Eventually after I get this working some of the boiler plate stuff would be in include files.

Magnus indicated that << ... >> is not the correct syntax and that { .... } should be used - but I couldn't get that to work either.

Lucas example works in the case he has but I couldn't quite get it to work in my case.

Thanks for any other feedback. It's late and I'm probably leaving some detail out.

\version "2.24.2"

\language "english"

steelGuitarSixStringCSixTuning = \stringTuning <c e g a c' e'>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

bckngNotes = \relative c' {
  d,8 e f g a b c d | d, e f g a b c d |
}

gtrBackingNoteDetails = {
  s1 |
  \set restrainOpenStrings = ##t
  \set minimumFret = #3
  s2. s4\2 |
}

stlBackingNoteDetails = {
  \set Staff.stringTunings = \steelGuitarSixStringCSixTuning
  s1 |
  \set restrainOpenStrings = ##t
  \set minimumFret = #2
  s2. s4\2 |
}

verseScore =
<<
  <<
    \tag #'gtrBackingNotes \context TabStaff = "gtrBackingNotes"
    << \gtrBackingNoteDetails \bckngNotes  >>

    \tag #'stlBackingNotes \context TabStaff = "stlBackingNotes"
    << \stlBackingNoteDetails \bckngNotes  >>

  >>
>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

bckngNotes = \relative c' {
  \break e,8 f g a b c d e | e, f g a b c d e
}

gtrBackingNoteDetails = {
  s1 |
  \set restrainOpenStrings = ##t
  \set minimumFret = #3
  s2. s4\2 |
}

stlBackingNoteDetails = {
  \set Staff.stringTunings = \steelGuitarSixStringCSixTuning
  s1 |
  \set restrainOpenStrings = ##t
  \set minimumFret = #2
  s2. s4\2 |
}

chorusScore =
<<
  <<
    \tag #'gtrBackingNotes \context TabStaff = "gtrBackingNotes"
    << \gtrBackingNoteDetails \bckngNotes >>

    \tag #'stlBackingNotes \context TabStaff = "stlBackingNotes"
    <<\stlBackingNoteDetails \bckngNotes >>

  >>
>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
fullScore = {
  \verseScore
  \chorusScore
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\book {
  \bookOutputName "Standard Guitar tab"
  \score {
    <<
      \keepWithTag #'(gtrBackingNotes)
      \fullScore
    >>
  }
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\book {
  \bookOutputName "Steel Guitar tab"
  \score {
    <<
      \keepWithTag #'(stlBackingNotes)
      \fullScore
    >>
  }
}


Reply via email to