And in case it makes any difference.  Some sections will lyrics. Some will have polyponic parts.  Etc.  So not all sections will look the same which is why I am doing multiple sections.

On 1/5/2025 7:38 PM, Walt North wrote:

I have a case where I will be printing out tablature for two guitarist that use different tunings.

I will be reusing the same melody notes saved in variables and just need to supply different tunings and minimum frets for the different results.

Below is a MWE example of what I'm trying to do.  I have it work fairly well so I'm just looking for one more refinement. The music is in multiple sections.  If possible it would be nice to consolidate the sections into one variable.  But then I'm not having any luck coming up with the right syntax to connect the tuning specifics to the sections.  The first section works ok but not the second sections.

In the music image below the last line should be showing fret 12.  If this is not possible I at least have something that will work well enough.

Refer to code and MWE.

\version "2.24.4"

roOn = \set restrainOpenStrings = ##t
mfZero = \set minimumFret = #0
mfFive = \set minimumFret = #5
mfTen = \set minimumFret = #10

% music
theMusicSectionOne =
{
  <<
    \new ChordNames \chordmode { \section \sectionLabel "section one" c1 \break }
    \new TabStaff <<
      \context TabVoice = "sectionone" \relative {
        c'4 c c c
        \voiceOne
      }
    >>
  >>
}
theMusicSectionTwo =
{
  <<
    \new ChordNames \chordmode { \section \sectionLabel "section two"c1 \break }
    \new TabStaff <<
      \context TabVoice = "sectiontwo" \relative {
        d'4 d d d
        \voiceOne
      }
    >>
  >>
}

% the next two sections are doable...
%    at least all the music notes are defined once above

% note that his is a MWE .. the actual music would have
% several parts where different frets are specified.

% for guitar tunning one
% frets
theFretsSectionOne = \context TabVoice = "sectionone" { \mfFive }
theFretsSectionTwo = \context TabVoice = "sectiontwo" { \mfFive }

\score {
  {
    <<
      \theMusicSectionOne
      \theFretsSectionOne
    >>
    <<
      \theMusicSectionTwo
      \theFretsSectionTwo
    >>
  }
}

% for guitar tuning two
% frets
theFretsSectionOne = \context TabVoice = "sectionone" { \mfTen }
theFretsSectionTwo = \context TabVoice = "sectiontwo" { \mfTen }

\score {
  {
    <<
      \theMusicSectionOne
      \theFretsSectionOne
    >>
    <<
      \theMusicSectionTwo
      \theFretsSectionTwo
    >>
  }
}

%if possible this is would I would to be to ...
% consolidate all the melody in one variable.
theScore = \context Score = "thescore"
{
  \theMusicSectionOne
  \theMusicSectionTwo
}

\score {
  {
    <<
      \theScore
      {
        \theFretsSectionOne
        \theFretsSectionTwo
      }
    >>
  }
}




Reply via email to