Le mer. 31 juil. 2024 à 18:18, Gilles Sadowski <gillese...@gmail.com> a écrit : > > Hello. > > A common accompaniment motive is "oom pah": > https://en.wikipedia.org/wiki/Oom-pah > > An excerpt of a LilyPond-generated score is attached. > I get this PDF output by encoding separately the "oom" ("bassoon" line) > and the "pah" (the chord line), for the purpose of getting the MIDI output > right: Bass note on the downbeat; chord on the upbeat. > However, this entails that in the PDF the chord name is also displayed > on the upbeat (as expected) despite it should also appear above the > downbeat in order to convey the correct semantics of the harmonic > structure. > > The excerpt below shows how the "upbeat" part is encoded (in its own file). > ---CUT--- > aMajorBar = \chordmode { > s8 a s a | > } > aMajorGMinorBar = \chordmode { > s8 g:m s g:m | > } > harmonyChords = \chordmode { > \time 2/4 > % Intro > \repeat percent 2 { > \aMajorBar > } > % A > \repeat volta 2 { > \aMajorGMinorBar > \aMajorBar > \aMajorGMinorBar > \aMajorBar > } > % etc. > } > harmony = \context ChordNames = "Harmony" { > \set chordChanges = ##t > \set ChordNames.midiInstrument = "accordion" > % > \harmonyChords > } > ---CUT--- > > Is there a recommended way to encode "oom pah" style accompaniment > that would produce both outputs (PDF and MIDI) right?
Partially answering my initial question, the correct outputs are achieved with encoding the upbeat accompaniment (and chord line) as ---CUT--- aMajorBar = \chordmode { \tag #'no-layout { s8 a s a | } \tag #'no-midi { a2 | } } ---CUT--- > If not, it looks like what I'm looking for is a function with two arguments > (a duration and a chord name) that would shift the graphics (to the left) > while not changing its timing position: > ---CUT--- > aMajorBar = \chordmode { > s8 \shiftChordSymbol { 8 a } s \shiftChordSymbol { 8 a } | > } > ---CUT--- Hence the new question: How to define an "oompah" function ---CUT--- aMajorBar = \oompah { a2 } ---CUT--- that would expand to ---CUT--- aMajorBar = \chordmode { \tag #'no-layout { a,,8:1 a e,,:1 a | } \tag #'no-midi { a2 | } } ---CUT--- i.e. from the chord name (and duration) argument, the function would create * the two "tag" blocks and * the "oom pah" motif that consists of the bass notes (I, V) and upbeat chords. Best regards, Gilles