[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "Quote" Chord Track in another Staff
From: |
Thomas Morley |
Subject: |
Re: "Quote" Chord Track in another Staff |
Date: |
Sat, 8 Feb 2020 13:02:28 +0100 |
Am Sa., 8. Feb. 2020 um 12:42 Uhr schrieb <address@hidden>:
>
> Hi all,
>
> please consider the following snippet:
>
>
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> \version "2.19.83"
>
>
>
> notes = \relative c' {
>
> \repeat unfold 8 {
>
> c4 d e f |
>
> }
>
> }
>
>
>
> otherNotes = \relative c' {
>
> c1 d e f g^\markup "C" a^\markup "D" b c
>
> }
>
>
>
> chordTrack = \chordmode {
>
> \repeat unfold 2 {
>
> c1 d e f |
>
> }
>
> }
>
>
>
> \score {
>
> <<
>
> \new ChordNames \chordTrack
>
> \new Staff \notes
>
> \new Staff \otherNotes
>
> >>
>
> }
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
>
>
> I’ve got the normal chords at the top and I would like to have parts of that
> chord-track again over the second staff (simulated with the two
> markup-commands).
>
> Of course I could just use a second variable containing only the chords I
> want and leaving the rest blank, but I’m curious if there is a way to re-use
> the first chords.
>
> How can this be done in a more “elegant” way?
>
>
>
> Thanks in advance
Hi,
you could try (ee inline comments):
chordTrack = \chordmode {
\repeat unfold 2 {
c1 d e f |
}
}
%% make 'chordTrack' quotable
\addQuote "chrds" { \chordTrack }
notes = \relative c' {
\repeat unfold 8 {
c4 d e f |
}
}
otherNotes = \relative c' {
c1 d e f
%% refer to the preexisting and named ChordNames-context, to put in the quotes
\context ChordNames = "chrds-2"
\quoteDuring "chrds" {
%% while putting quotes into the relevant ChordNames-context, refer to
%% the preexisting and named Staff-context to continue entering "normal"
%% stuff
\context Staff = "2" { g1 a }
}
b c
}
\score {
<<
\new ChordNames \chordTrack
\new Staff \notes
%% initiate a ChordNames-context which may be filled form 'otherNotes'
\new ChordNames = "chrds-2"
\new Staff = "2" \otherNotes
>>
}
Not sure, if someone would call it "elegent" ...
Cheers,
Harm
- "Quote" Chord Track in another Staff, sir.teddy.the.first, 2020/02/08
- Re: "Quote" Chord Track in another Staff,
Thomas Morley <=
- AW: "Quote" Chord Track in another Staff, sir.teddy.the.first, 2020/02/08
- Re: "Quote" Chord Track in another Staff, Thomas Morley, 2020/02/08
- Re: "Quote" Chord Track in another Staff, David Kastrup, 2020/02/08
- AW: "Quote" Chord Track in another Staff, sir.teddy.the.first, 2020/02/08
- Re: "Quote" Chord Track in another Staff, Thomas Morley, 2020/02/08
- AW: "Quote" Chord Track in another Staff, sir.teddy.the.first, 2020/02/08