Darn. Well almost. The octave tweak is only good for one note. Which
actually makes sense from a code point of view. I'll have to find
another work around to switch octave for a longer string of notes.
\version "2.24.2"
melody = \relative c' {
c4 d e f |
c d e f |
s4 g g g |
}
guitarTweaks = {
s1 |
\set restrainOpenStrings = ##f
\set minimumFret = #3
s4\3 s4*3 |
c'4 s s s |
}
banjoTweaks = {
s1 |
\set restrainOpenStrings = ##f
\set minimumFret = #1
s4\3 s4*3 |
c''4 s s s |
}
\markup Guitar
\score {
\new TabStaff {
\new TabVoice {
<<
\melody
\guitarTweaks
>>
}
}
}
\markup Banjo
\score {
\new TabStaff \with {
stringTunings = #banjo-open-g-tuning
} {
\new TabVoice {
<<
\melody
\banjoTweaks
>>
}
}
}
On 9/12/2024 3:48 PM, Walt North wrote:
This is working great for the most part. One thing I have had a bit
of trouble with is octave. But I have a workaround that will work for
the most part for simple cases.
There are a handful of notes that I want in different octave for some
instruments. \resetRelativeOctave does not seem to work when in the
tweaked code. But for those handful of cases I can put a skip in the
main melody and then the specific octave note in the tweaked line,
\version "2.24.2"
melody = \relative c' {
c4 d e f |
c d e f |
s1 |
}
guitarTweaks = {
s1 |
\set restrainOpenStrings = ##f
\set minimumFret = #3
s4\3 s4*3 |
c'1 |
}
banjoTweaks = {
s1 |
\set restrainOpenStrings = ##f
\set minimumFret = #1
s4\3 s4*3 |
c''1 |
}
\markup Guitar
\score {
\new TabStaff {
\new TabVoice {
<<
\melody
\guitarTweaks
>>
}
}
}
\markup Banjo
\score {
\new TabStaff \with {
stringTunings = #banjo-open-g-tuning
} {
\new TabVoice {
<<
\melody
\banjoTweaks
>>
}
}
}
On 9/10/2024 12:05 PM, Walt North wrote:
Excellent - exactly what I was looking for..
On 9/10/2024 11:58 AM, Xavier Scheuer wrote:
On Tue, 10 Sept 2024 at 17:04, Walt North <[email protected]> wrote:
>
> Is there any way to do this? What follows is a made up example. I
have a melody that may be shared across different string instruments.
>
> I'd like to be able to reuse the melody notes and not repeat that
for each instrument. The different instruments may require different
restrain option, minimum frets and/or string numbers throughout the
piece.
Hello,
This seems to work.
guitarTweaks = {
s1 |
\set restrainOpenStrings = ##t
\set minimumFret = #3
s4\3 s4*3 |
}
banjoTweaks = {
s1 |
\set restrainOpenStrings = ##f
\set minimumFret = #5
s4\4 s4*3 |
}
\markup Guitar
\score {
\new TabStaff {
\new TabVoice {
<<
\melody
\guitarTweaks
>>
}
}
}
\markup Banjo
\score {
\new TabStaff \with {
stringTunings = #banjo-open-g-tuning
} {
\new TabVoice {
<<
\melody
\banjoTweaks
>>
}
}
}
Kind regards,
Xavier